Short answer: this is not possible.
Long explanation: if you want to use #selector
, the methods must be subjective Objective-C, so your code will look like this:
@objc func someFunc(_ word: String) {
}
@objc func someFunc(_ number: Int) {
}
Thanks to the annotation, @objc
they are now exposed to Objective-C and a consistent tone is created. Objective-C can use it to call Swift methods.
Objective-C , objc_msgSend
: , , , . :
'someFunc' Objective-C selector 'someFunc:' Objective-C.
- , .