Hello,
I had a question regarding Extensions. I am not able to understand why the following scenario is getting compiled successfully
for example consider:
An extension to String in file in Project
extension String {
func localize()->String{
let localString = "Project String"
return localString
}
}
Same extension in a cocoaPod
extension String {
func localize()->String{
let podString = "Pod String"
return podString
}
}
When I run the project the extension method of String in pod is ignored, and the one from project is getting called. What I believe is that, compiler should throw, Invalid redeclaration of 'localize()'.
code tested in xCode 11.3, Swift 4.2