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, resonance 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. Alignment on short axis [ ] Alignment on long axis [ ] J tot J J AE11 0.1 MeV 0.3 MeV 0 4 8 12 16 0 4 8 12 16 20 24 J tot J J ABCE11 Config3 Config2 0.5 MeV 1.4 MeV J z [ ] J tot J J Config1 0.2 MeV 1.1 MeV J J tot J J z [ ] 0.9 MeV 1.4 MeV 0.5 MeV 1.4 MeV J x [ ] J tot J J Config3* J x [ ] J tot J J FIG. 13: (Color online) Composition of the total angular momentum at both the bandhead and the maximum rotational frequency in the TAC-CDFT calculations with the configurations of Config1, Config2, Config3, and Config3*. Taken from Ref. [98].