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 the properties of nuclei and many nuclear phenomena. Recently, the self-consistent tilted axis cranking covariant density functional theories based on the non-linear meson-exchange models and a point-coupling interaction were established, and applied successfully to investigate the magnetic and antimagnetic rotations. This paper mainly reviews the application of the tilted axis cranking covariant density functional theory in the magnetic rotation and antimagnetic rotation phenomena. Take $^{60}$Ni, $^{105}$Cd and $^{110}$Cd as examples, we will introduce the description on the energy spectra, the relation between the spin and the rotational frequency, the reduced $M1$ and $E2$ transition probabilities. By investigating the orientation of the neutron and proton angular momenta, the shears mechanism for the magnetic rotation and the two-shears-like mechanism for the antimagnetic rotation are examined.