从Swift3.0开始,一些OC中的用法被放弃,这其中包括NSFoundation的前缀NS被放弃等
- OC中传统for循环被弃用
2.NSFile,NSUserdefault等变身File,userDefault
3.i++、++i被弃用,只能使用i += 1
错误汇总:
- Closure use of non-escaping parameter 'complication' may allow it to escape
解决方案:complication:(_ result:[String]) -> ()修改为在闭包参数前添加@escaping,修改后闭包 complication:@escaping (_ result:[String]) -> ()
2.dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /var/containers/Bundle/Application/xxx.app/xxx-Swift
Reason: no suitable image found.
解决方案:target-Build Settings-embed->YES