I am trying to check out the new CocoaPods platform setup to get some Pods, and I am having problems using Swift in my Objective-C project.
First of all, this is CocoaPods prerelease 0.35, you can read about how to use it and install it here .
Here is my current subfile:
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' pod 'MBProgressHUD' pod 'SLPagingViewSwift'
MBProgressHUD is a general indicator of rotation, and SLPagingViewSwift is a random project that I found by typing Swift in search for cocoapods. Here is the ViewController.m in my project:
Here's the SLPagingViewSwift :
class SLPagingViewSwift: UIViewController, UIScrollViewDelegate {
As you can see, it inherits from the UIViewController , so you should not just select it and initialize it. If I add the file separately as soon as the file, the above code will work fine. I know this works.
tl; dr
How can I use the pure Swift Framework created by CocoaPods in the Objective-C class?
Troubleshooting
Mostly I tried to use various imported goods. Apple recommends @import style here

But I tried several other varieties:
// Compiler Error
I also tried several other Swift libraries from time to time to find out if I can click anything.
I see nothing in Cocoapods problems that can help this, I also did not find anything in their blog / release.
Note
If I add the SLPagingViewSwift.swift file separately to the project in the old-fashioned way, it works fine.
objective-c swift cocoapods
Logan Jan 17 '15 at 2:50 2015-01-17 02:50
source share