Magnetic rotation and antimagnetic rotation are exotic rotational phenomena observed in weakly deformed or near-spherical nuclei, which are respectively interpreted in terms of the shears mechanism and two shearslike mechanism. Since their observations, magnetic rotation and antimagnetic rotation phenomena have been mainly investigated in the framework of tilted axis cranking based on the pairing plus quadrupole model. For the last decades, the covariant density functional theory and its extension have been proved to be successful in describing series of nuclear ground-states and excited states properties, including the binding energies, radii, single-particle spectra, reso- nance states, halo phenomena, magnetic moments, magnetic rotation, low-lying excitations, shape phase transitions, collective rotation and vibrations, etc. This review will mainly focus on the tilted axis cranking covariant density functional theory and its application for the magnetic rotation and antimagnetic rotation phenomena.