Swift老项目更新语法提示,看出变化 了啥

privatefileprivate

image.png

UIBarButtonItemStyle.PlainUIBarButtonItemStyle.plain

image.png

.CGColor.cgColor

image.png

NSBundle.mainBundle().infoDictionaryBundle.main.infoDictionary更精简

image.png

方法名位置调整
.popViewControllerAnimated(true)popViewController(animated: true),animated飞升了

image.png

内部参数外部参数

image.png

通知中心嗨起来
NSNotificationCenter.defaultCenter()NotificationCenter.default
键盘通知名从UIKeyboardWillChangeFrameNotificationNSNotification.Name.UIKeyboardWillChangeFrame

image.png

这个开始有点头晕了
好像是selector的引用从Selector("interactivePopGestureRecognizer")#selector(getter: UINavigationController.interactivePopGestureRecognizer)

image.png

NSTimeIntervalTimeInterval

image.png

UITextViewDelegate有变,这个一敲Xcode会有提示的,不用记


image.png

GCD更精简

DispatchQueue.global().async {

    DispatchQueue.main.async {

        self.label?.text = "finished"

    }

}


let delay = DispatchTime.now() + .seconds(60)
DispatchQueue.main.after(when: delay) {
    // Do something
}

image.png

已放弃更新,太多报错,Swift真是坑

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容