Swift 代码片段

 

1、导航栏背景色和标题颜色

navigationController.navigationBar.barTintColor = .red //背景色
navigationController.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] //标题颜色
self.navigationController?.navigationBar.tintColor = UIColor.white //左右按钮文字颜色

 

2、App退出到桌面最小化

UIControl().sendAction(#selector(NSXPCConnection.suspend),
                               to: UIApplication.shared, for: nil)

 

posted @ 2019-06-01 14:47  wq95230  阅读(161)  评论(0编辑  收藏  举报