1

升级 Swift 3

 3 years ago
source link: http://yyny.me/2017/05/04/2017-5-4-%E5%8D%87%E7%BA%A7%20Swift%203/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

升级 Swift 3

Posted on

2017-05-04 Edited on 2020-11-12 In iOS

Tutorial

拖了好久,终于跟产品争取到时间来做 Swift 3 的升级,历时6天,目前已经升级完成,简单记录一下吧。

time.png

time.png

  1. 升级 Pod 中和项目的 Swift 三方库:先查看三方库是否有对应 Swift 3 版本,如果没有的话,是否有替代方案。**现在大部分三方库都支持了 Swift 3,非 Swift 三方库暂且不要升级**
  2. Xcode Auto-Fix(**注意不要选中 pod 中已升级的三方库**
  3. 编译后就可以开始 fix 一大波错误啦 /(ㄒoㄒ)/~~
  1. DeviceToken.description is 32 bytes, 导致注册 token 失败,收不到 push。解决方案
  1. 用另外一台电脑做升级,这样在遇到疑问时,还可以查看原来的代码,比如三方库的方法。
  2. 流程3中的错误确实有很多,改着改着不免心烦意乱,这里可以选择注释大法,错误的地方全部注释掉,编译成功后,再从一个 vc 开始改。
Buy me a coffee

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK