My project currently uses the Swift and Objectice-C languages. To make it work, Ive followed the recommendations of the official documentation . And now I can use Swift in Objective-C and vice versa.
But the problem arises when some of the Swift clusters have overloaded methods. Swift supports method overloading, but not Objective-C.
Example:
func random(#lower: Int , upper: Int) -> Int {
return lower + Int(arc4random_uniform(UInt32(upper - lower + 1)))
}
func random(#lower: CGFloat , upper: CGFloat) -> CGFloat {
return CGFloat(arc4random() % 1) / 0
}
The automatically generated file "MyNameProductModule-Swift.h" cannot compile because there are methods with the "same" signature.
Questions:
a) Did I miss something important?
b) Is there any solution other than renaming the methods?
c) Framework/Library Swift, , , Framework/Library Objective C ?
!