我在每个 UIViewController 中编写了以下代码:
var navBar = self.navigationController?.navigationBar
navBar?.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
我不想在UIViewController
我创建的每一个中都写这些。我很懒惰,我不想重复自己。我无法添加它extension
。那么我可以做些什么来在创建时不必编写这段代码UIViewController
呢?