Xcode 8 beta 6 fails to recognize Swift 3 types.

I'm working on a project that I started with Xcode 8 beta 2 using Swift 3 and everything has been working flawlessly. Today I updated to Xcode 8 beta 6 on my iMac and right away my code failed to compile. I've now got over 70 errors similar to the following:


Use of undeclared type 'SortDescriptor'

Use of undeclared type 'Date'

Method does not override any method from its superclass

If I change the code to Swift 2.2 syntax the code compiles, obviously the new Xcode is failing to recognize Swift 3 for some reason. I tried using the syntax converter and it fails.


I recalled that my macbook had Xcode 8 beta 2 on it so I tried opening the project on there and I still had the errors. I believe that opening my project files on my iMac in Xcode 8 beta 6 has changed a setting in my project file and I'm not sure if there is a way to correct this.


Has anyone experienced anything similar?

Answered by QuinceyMorris in 174221022

I believe some Cocoa class names had their NS prefix dropped in an earlier beta, then got the NS re-added later. It looks like you'll have to change e.g. SortDescriptor back to NSSortDescriptor manually.


There were a *lot* of syntax changes in Swift 3 since beta 2.

Accepted Answer

I believe some Cocoa class names had their NS prefix dropped in an earlier beta, then got the NS re-added later. It looks like you'll have to change e.g. SortDescriptor back to NSSortDescriptor manually.


There were a *lot* of syntax changes in Swift 3 since beta 2.

they really re-added the 'NS' prefixes? thanks I had no idea they did that.

Xcode 8 beta 6 fails to recognize Swift 3 types.
 
 
Q