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.

  1. you have first make sure you're prepending class declaration @objc it's available objective-c ones.

for example:

import foundation  // belongs target 'testproject' @objc class swiftcontroller: uiviewcontroller {      //... truncated  } 
  1. now have import name of target (that swift controller belongs to), appended '-swift.h'—exposing interface—like so:

    #import "testproject-swift.h"


Comments

Popular posts from this blog

javascript - Trigger mouseenter when an animated element touches mouse -

json - Zend error Connection -

java - Using Spring @Transactional with a combination of readOnly and write, when does this entity get committed? -