Sam Shaikh
Sam Shaikh

Reputation: 1646

How to use a POD which is compiled in Swift 3.0, into a Project made in 2.2?

I made my project in 2.2. Now I want to use a library which is compiled in 3.0. how can I use it.

I tried making legacy to NO and YES, and Unspecified, but not working. If I do Yes, it gives lots of errors as code is in 3.0, and I want 2.2 as base.

NOw what should I do

 pod 'EZSwipeController'

Its screenshot of document.

enter image description here

This is library

Upvotes: 0

Views: 162

Answers (2)

Rajat
Rajat

Reputation: 11127

You can do this, I am using a Swift 2.2 code in my project and i have installed EZSwipeController using pods and project is running successfully.

Here is what you needs to be done,

First select your Project

Check the screenshot

enter image description here

Then in the Build setting for the target set Use Legacy Swift Language Version to yes, like this

enter image description here

Now from the side navigation select Pods and then select EZSwipeController, like this

enter image description here

set Use Legacy Swift Language Version to yes.

By making this changes it will work.

Upvotes: 1

hnh
hnh

Reputation: 14815

The answer to this is pretty simple: You can't mix Swift 2 and Swift 3 codebases. Either you upgrade your project to Swift 3 (which probably makes sense anyways), or you backport the library you want to use to Swift 2.

Upvotes: 1

Related Questions