Swift code in Objective-C
Xcode allows to write you with a Swift and use it in your existing project which could be in Objective-C. Consider the below UserObject Swift Written Class. UserObject Class in Swift import Foundation class UserObject: NSObject { var userId: String ? func printName(nameValue: String ) -> Void { print ( "Name = \ ( nameValue )" ) } func printAnotherName(nameValue: String ) -> Void { print ( "Name = \ ( nameValue )" ) } } ViewController in Objective-C Now what if you want this newly written UserObject Swift Class to use in your existing Objective-C Class. @interface ViewController () @end @implementation ViewController - ( void )viewDidLoad { [ super viewDidLoad ]; UserObject *userObject = [[ UserObject ...