Created
December 13, 2016 22:37
-
-
Save Morbix/41a2b835f05ea79407a88ce1b18ff76d to your computer and use it in GitHub Desktop.
[iOS] Call Swift function inside Objective-C class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Add #import "MyFirstProjectOnSwift-Swift.h" in "MyObjectiveCLass.m" | |
2. Add @class mySwiftClass in MyObjectiveCLass.h; | |
3. Then in MyObjectiveCLass.m | |
mySwiftClass *myClass = [mySwiftClass new]; {Call Like This in any method wherever you want to call swift method.} | |
4. [myClass methodName]; | |
Source: http://stackoverflow.com/questions/24078043/call-swift-function-from-objective-c-class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment