Last active
August 29, 2015 14:23
-
-
Save IoDmitri/9fc19aaa52366ed5ff8e to your computer and use it in GitHub Desktop.
This file contains 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
// in the swift part | |
extension MyObjectiveCClass { | |
func myFunctionInSwift(){ | |
println("this is running in Swift") | |
} | |
} | |
//On the objective C Side | |
// MyObjectiveCClass.m | |
#import "MyobjectiveCClass.h" | |
#import Module_Name-Swift.h | |
//if you do not import your files in this order you will get a compiler error | |
@implementation MyObjectiveCClass : SuperClassDefinition | |
-(void)callSwiftFunction{ | |
[self myFunctionInSwift]; //"this is running in swift" | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment