astrolka astrolka - 17 days ago 7
Objective-C Question

CocoaPods install an old version of framework

CocoaPods - 1.1.1

My pod file looks like this:


target 'MyNewProject' do

pod 'XLPagerTabStrip', '~> 5.0'

pod 'AFNetworking', '~> 3.0'

end

use_frameworks!


XLPagerTabStrip
library is installed with an old swift version and xcode propose me convert it up to 2.3 or 3.0. This issue is noticed with other swift libraries e.g. Reactive Cocoa

Thank you!

Answer

As mintioned in XLPagerTabStrip - Change Log:

6.0.0

Swift 3 support

So updating its pod to the latest version should let it supports Swift 3 by default.

You can add it as pod 'XLPagerTabStrip' without specifying the version number, which causes to get latest version (it's the default behavior if you are not specifying the version number).

Change: pod 'XLPagerTabStrip', '~> 5.0' to pod 'XLPagerTabStrip'

As mentioned, you should get version 6.0.0 (latest version).

Finally, your pod file should look like:

target 'MyNewProject' do

pod 'XLPagerTabStrip'

pod 'AFNetworking', '~> 3.0'

end

use_frameworks!

Recap: After making sure that the latest version of a library has been released to support -for example- Swift 3, install it without specifying the version number. For more information, you can check Podfile Syntax Reference.

Hope this helped.

Comments