Use Swift 2.2 in Xcode 8

Use Swift 2.2 in Xcode 8?

It is not possible to use Swift2.2 in XCode8, and it is also not possible to use Swift2.3 or Swift3 in XCode3.

The best solution i found is to create a single project file that will compile for both iOS 9 (Xcode 7) and iOS 10 (Xcode 8), and that will support Swift2.2 and Swift2.3 (very similar).

Migrate from swift 2.2 to swift 3.0 in xcode 8

Swift 2.2 unfortunately doesn't work with Xcode 8. But Apple made a good move still supporting Swift 2.3, which is basically almost the same as 2.2.

The problem is with 3rd party libraries, which must be in the same version of Swift as your project.

So, if you're using Swift 2.3, you can't use libraries, that are written in Swift 3.0.

using Swift 2.2 Pods with XCode 8

Please check procedures here that will make your swift 2.2 or swift 2.3 pods compatible with Xcode8 as its.

As steps:

  1. To begin, open your project in Xcode 7. Go to project settings, open the Build settings tab, and click the “+” to add a User-Defined Setting: SWIFT_VERSION = 2.3
    Swift Sample Image 13

  2. In your Podfile you should put the following post install script. Don't forget to replace YOURTEAMID with your own

post_install do |installer|
installer.pods_project.build_configurations.each do |config|
# Configure Pod targets for Xcode 8 compatibility
config.build_settings['SWIFT_VERSION'] = '2.3'
config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = 'YOURTEAMID/'
config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO'
end
en

Keep in mind that will work fine with most Pods, but not all I still struggling with Eureka pod to work.

Is there any possible way to run my swift 2 project in Xcode 8?

Swift Sample Image 14

set Use Legacy Swift Language Version to Yes In Both Project And Targets

How can I use Swift 2.3 in XCode 8 Playgrounds?

Unfortunately, according to Apple it is impossible:

For instance, Playgrounds in Xcode only work with Swift 3, and notably the Swift Playgrounds app for iPad also uses Swift 3. Xcode project templates all use Swift 3, and all documentation is presented in a format appropriate for Swift 3.

More here.



Related Topics



Leave a reply



Submit