Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 convert to Swift 4.2 fails

I am getting this error trying to migrate to Swift 4.2 using the Xcode provided conversion tool. How do I fix it? The code builds fine otherwise.

enter image description here

like image 427
Deepak Sharma Avatar asked Sep 19 '18 19:09

Deepak Sharma


Video Answer


2 Answers

I had similar problem, solved it by

1- Change swift lang version in build setting of all app and test targets to 4.2

2- build app, errors will happen like UIControlState renamed to UIControl.state

3- fix all of the build errors

4- I updated all recommended settings by xcode

5- then I asked xcode to convert to swift4.2

updated all recommended settings

like image 111
Mohamed DiaaEldin Avatar answered Sep 20 '22 09:09

Mohamed DiaaEldin


Do you have any libraries in your project? I think you are trying to covert your project with dependencies and there are problems in them with new swift version. Try to uncheck all dependencies except your project and convert to new version of Swift

like image 37
Barbatosso Avatar answered Sep 18 '22 09:09

Barbatosso