Difficulties converting to Swift 3

后端 未结 3 1809
無奈伤痛
無奈伤痛 2021-01-30 01:30

After converting from Swift 2 to Swift 3 (even after converting edit-> convert -> to current swift syntax) I am getting lots of errors. Especially:

I am show

3条回答
  •  孤独总比滥情好
    2021-01-30 02:21

    I was converting a project and Xcode was not helping me with any fixes so I resorted to a couple of regex search-and-replaces:-

    CGPointMake\((.*),[ ]*([^\)]+)\)
    CGPoint(x:$1, y:$2)
    
    CGSizeMake\((.*),[ ]*([^\)]+)\)
    CGSize(width:$1, height:$2)
    

    Note they are not aware of nested parentheses , but probably good enough for 90% of cases.

提交回复
热议问题