Cocoa Pods now supports Swift code.

Downloaded an open source project Gulps and was trying to run “pod install”.

Suddenly came across this error:

Screen Shot 2015-05-21 at 9.09.33 pm

On further researching and going through this blog, got to know that, Cocoapods now supports swift pods (i.e pods written using swift language). We just need to add support for swift framework in our PodFile by specifying the command “use_frameworks!” at the end.

A sample could be found here : Gulps PodFile

However the support for swift pods have been added in Cocoapod version 0.36 and above and thus “use_frameworks!” command is recognised only in these versions. Older versions of cocoapods would give the above error. So we need to update our cocoapod to atleast version 0.36.

You can check your pod version by typing the following command in terminal:
pod  —-version

If the version is below 0.36, then update your cocoapod tool by running the following command in terminal:
sudo gem install cocoapods —-pre

On checking you should see your version upgraded to 0.36 or above.

Now go ahead and freely add swift libraries to your pod file !!!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s