从private
到fileprivate
从UIBarButtonItemStyle.Plain
到UIBarButtonItemStyle.plain
从
.CGColor
到.cgColor
从NSBundle.mainBundle().infoDictionary
到Bundle.main.infoDictionary
更精简
方法名位置调整
从.popViewControllerAnimated(true)
到popViewController(animated: true)
,animated飞升了
内部参数外部参数
通知中心嗨起来
NSNotificationCenter.defaultCenter()
到NotificationCenter.default
键盘通知名从UIKeyboardWillChangeFrameNotification
到 NSNotification.Name.UIKeyboardWillChangeFrame
这个开始有点头晕了
好像是selector的引用从Selector("interactivePopGestureRecognizer")
到#selector(getter: UINavigationController.interactivePopGestureRecognizer)
从NSTimeInterval
到TimeInterval
UITextViewDelegate有变,这个一敲Xcode会有提示的,不用记
GCD更精简
DispatchQueue.global().async {
DispatchQueue.main.async {
self.label?.text = "finished"
}
}
let delay = DispatchTime.now() + .seconds(60)
DispatchQueue.main.after(when: delay) {
// Do something
}
已放弃更新,太多报错,Swift真是坑