Skip to content

Instantly share code, notes, and snippets.

@IoDmitri
Last active August 29, 2015 14:23
Show Gist options
  • Save IoDmitri/9fc19aaa52366ed5ff8e to your computer and use it in GitHub Desktop.
Save IoDmitri/9fc19aaa52366ed5ff8e to your computer and use it in GitHub Desktop.
// 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