Thursday 15 August 2013

Call Swift function in Objective - C issue -



Call Swift function in Objective - C issue -

i have swift class below function:

public func testlogin(email: string, password: string, completion: (response: serverresponse)-> void) { }

i trying phone call function objective-c, getting errors, can please provide me syntax on how phone call above swift function using objective-c.

i created swift class instance, instance not identifying swift function:

swiftclass *instance = [swiftclass new];

any help appreciated.

make sure serverresponse somehow derived nsobject , alter completion type:

public func testlogin(email: string!, password: string!, completion: serverresponse! -> void) { }

objective-c swift

No comments:

Post a Comment