From Objective-C, to call a a Swift function with one argument you have to use bracket syntax and do something I've always found confusing: Add the word "With" before the argument and capitalize the argument label as in:
//swift extension
@objc public func getImageCalled(name: String?) -> UIImage? {
}
//Called from Objective-C
ImageClass *imgObject = [[ImageClass alloc] init];
UIImage * img = [imgObject getImageCalledWithName:myname];
How do you do this with two arguments as in:
@objc public func getImageCalled(name: String?,width:Int?) -> UIImage? {
}
[imgObject getImageCalledWithName:myname WithWidth:30]; is not working for me.
With<NameOfFirstParameter>is only a convention for the first argument, all subsequent arguments are just named the same. It originates from Objective-C where you don't specify a named argument for the first parameter due to its syntax.