我想更改后退按钮的字体,但不想像在其他答案中看到的那样,在AppDelegate中全局更改它:
UIBarButtonItem.appearance().setTitleTextAttributes
我尝试在ViewController中使用以下内容:
self.navigationItem.backBarButtonItem!.setTitleTextAttributes([NSAttributedString.Key.font: UIFont(name: "SFProDisplay-Semibold", size: 24)!], for: .normal)