Questions tagged [swift-modules]
3 questions
7
votes
1 answer
Redeclaring members in an extension hides the original member *sometimes*. Why?
By chance, I discovered that you can do this without the compiler complaining:
extension Date {
var timeIntervalSinceNow: TimeInterval {
return 1000
}
}
What's weirder, is that this actually evaluates to…

Sweeper
- 213,210
- 22
- 193
- 313
4
votes
1 answer
Dynamic dispatching protocol extension doesn't work multiple targets
This is my code in my main target(so not the test target):
protocol ProtocolA {
func dontCrash()
}
extension ProtocolA {
func dontCrash() {
fatalError()
}
func tryCrash() {
dontCrash()
}
}
class MyClass:…

J. Doe
- 12,159
- 9
- 60
- 114
2
votes
2 answers
Module not found when adding a framework to an existing Xcode project
I have created a simple swift framework from scratch and was able to use it by adding the framework to a newly created app project. Just to test, I've also created just another app project and was able to use the same framework there as well. But…

Mando
- 11,414
- 17
- 86
- 167