realm/realm-cocoa — pull request #889 by jpsim (2014-09-10 23:58:34+00:00)
Title: WIP Swift Syntax

Creating a work-in-progress pull-request for a potential Swift interface. Feedback from anyone is welcome.

@tgoyne @alazier hopefully we can discuss this approach in the office tomorrow.

Major points I still dislike with this:
1. `import Realm` will still expose the entirety of the Objective-C interface. This may be easily solved by creating a new `RealmSwift` target, but I haven't tested that yet.
2. Even with a `RealmSwift` target, all `RLMObject` methods will still be exposed, since `Object` is typealiased to `RLMObject`. We could work around this by checking for either `RLMObject` or `Object` as the parent class in the binding and creating an `Object` wrapper around `RLMObject`, much like the approach taken with most of the other Swift classes here.
3. This doesn't support generic array properties. See `ArrayProperty` for details.

Point 3 seems impossible to solve in an elegant way given Swift's current state.

Please note that I haven't yet updated the Swift tests (and won't until we discuss this approach), but you can refer to the examples for sample usage of this interface.