Fixed naming clash between Observable module and Observable class surfaced when any class name in the including project clashes with a class name in the framework #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Renamed module to "Observables" to get around unsurmountable issues with making the module work when there is a name clash with any class within the module when importing it as a framework (ie: Cocoapods). For example, if you have an Event class in your own project (ie: your domain models everyday events) Swift gets tripped up on being able to specify that an event is an Observable.Event as opposed to your own Event.
The reason for this is that both the framework module is called Observable as well contains a class called Observable. It's apparently an anti-practice in Swift to have the module use the same name as any of its existing classes. Event type aliasing gets tripped up by this (ie: "typealias ObservableEvent = Observables.Event" --> compiler can't distinguish between Observable the class and Observable the module, despite the "import Observable" declaration)
Thus, the solution was to rename the framework to "Observables" (or something similar). Unfortunately this is the only reliable way out of this (without renaming the Observable class itself). Alternatives would have been to rename the Observable class (not worth it) or giving up framework integration and copying files directly (not using Cocoapods).