ios - How to call a swift view controller in objective c? -
i have objective c controller, want call controller swift controller objc controller?
apparently it's quite easy.
- you have first make sure you're prepending class declaration
@objcit's available objective-c ones.
for example:
import foundation // belongs target 'testproject' @objc class swiftcontroller: uiviewcontroller { //... truncated } now have import name of target (that swift controller belongs to), appended
'-swift.h'—exposing interface—like so:#import "testproject-swift.h"
Comments
Post a Comment