1

I'm trying to learn IOS programming in Swift. So far I've a book on developing for IOS in Objective-C and Apple's book on Swift. I've decided to start from a simple IOS app that uses a slide-out navigation MMDrawerController.

I've installed the pod MMDrawerController via CocoaPods.

Since the installation of the pod did not use Xcode there were no any bridged headers created.

So, how can I start using this MMDrawerController written in Obj-C, installed via CocoaPods in my Swift project?

Is it possible at all?

Grigory
  • 992
  • 2
  • 18
  • 34
  • 2
    check out this [How to call Objective C code from Swift](http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift) you just have to create a new .m file and the bridge header is created. – Raja Vikram Jul 01 '15 at 10:31
  • 1
    Also : [How to use CocoaPods with Swift project](http://blogs.triffort.com/?p=370) – Swapnil Luktuke Jul 01 '15 at 10:35
  • @lukya, can you write an answer, I will mark it as THE answer. It actually helped me. – Grigory Jul 01 '15 at 11:28

2 Answers2

1

For create Bridge File follow this:

Right click for create "New File" -> select iOS "Source" -> Select "Header File" -> Give File name and click on create

Now: import header file of MMDrawerController in Bridge file

#import "MMDrawerController.h"
#import "MMDrawerVisualState.h"
#import "MMExampleDrawerVisualStateManager.h"
iOS Dev
  • 195
  • 9
0

For future readers I'd like to make an answer. Thanks to the commenter lukya who pointed to a useful link.

This article helped me http://blogs.triffort.com/?p=370

Grigory
  • 992
  • 2
  • 18
  • 34