Marino Faggiana hace 7 años
padre
commit
b67e67ccc0
Se han modificado 57 ficheros con 8987 adiciones y 4 borrados
  1. 2470 0
      Libraries external/Realm/Realm.framework/CHANGELOG.md
  2. 43 0
      Libraries external/Realm/Realm.framework/Headers/NSError+RLMSync.h
  3. 439 0
      Libraries external/Realm/Realm.framework/Headers/RLMArray.h
  4. 411 0
      Libraries external/Realm/Realm.framework/Headers/RLMCollection.h
  5. 204 0
      Libraries external/Realm/Realm.framework/Headers/RLMConstants.h
  6. 127 0
      Libraries external/Realm/Realm.framework/Headers/RLMMigration.h
  7. 535 0
      Libraries external/Realm/Realm.framework/Headers/RLMObject.h
  8. 43 0
      Libraries external/Realm/Realm.framework/Headers/RLMObjectBase.h
  9. 82 0
      Libraries external/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h
  10. 72 0
      Libraries external/Realm/Realm.framework/Headers/RLMObjectSchema.h
  11. 22 0
      Libraries external/Realm/Realm.framework/Headers/RLMPlatform.h
  12. 121 0
      Libraries external/Realm/Realm.framework/Headers/RLMProperty.h
  13. 652 0
      Libraries external/Realm/Realm.framework/Headers/RLMRealm.h
  14. 43 0
      Libraries external/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h
  15. 121 0
      Libraries external/Realm/Realm.framework/Headers/RLMRealmConfiguration.h
  16. 118 0
      Libraries external/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h
  17. 342 0
      Libraries external/Realm/Realm.framework/Headers/RLMResults.h
  18. 77 0
      Libraries external/Realm/Realm.framework/Headers/RLMSchema.h
  19. 69 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncConfiguration.h
  20. 106 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncCredentials.h
  21. 118 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncManager.h
  22. 55 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncPermission.h
  23. 90 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionChange.h
  24. 91 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionOffer.h
  25. 73 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionOfferResponse.h
  26. 112 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionResults.h
  27. 113 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionValue.h
  28. 159 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncSession.h
  29. 233 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncUser.h
  30. 181 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncUtil.h
  31. 106 0
      Libraries external/Realm/Realm.framework/Headers/RLMThreadSafeReference.h
  32. 44 0
      Libraries external/Realm/Realm.framework/Headers/Realm.h
  33. BIN
      Libraries external/Realm/Realm.framework/Info.plist
  34. 244 0
      Libraries external/Realm/Realm.framework/LICENSE
  35. 29 0
      Libraries external/Realm/Realm.framework/Modules/module.modulemap
  36. 60 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMAccessor.h
  37. 28 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMArray_Private.h
  38. 33 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMListBase.h
  39. 40 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMMigration_Private.h
  40. 71 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h
  41. 104 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h
  42. 104 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h
  43. 38 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMOptionalBase.h
  44. 139 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h
  45. 43 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h
  46. 52 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMRealm_Private.h
  47. 32 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMResults_Private.h
  48. 54 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h
  49. 38 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h
  50. 39 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncPermissionChange_Private.h
  51. 36 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncPermissionOfferResponse_Private.h
  52. 42 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncPermissionOffer_Private.h
  53. 35 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncPermission_Private.h
  54. 121 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h
  55. BIN
      Libraries external/Realm/Realm.framework/Realm
  56. 72 0
      Libraries external/Realm/Realm.framework/strip-frameworks.sh
  57. 61 4
      Nextcloud.xcodeproj/project.pbxproj

+ 2470 - 0
Libraries external/Realm/Realm.framework/CHANGELOG.md

@@ -0,0 +1,2470 @@
+2.7.0 Release notes (2017-05-03)
+=============================================================
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* Use reachability API to minimize the reconnection delay if the network
+  connection was lost.
+* Add `-[RLMSyncUser changePassword:completion:]` API to change the current
+  user's password if using Realm's 'password' authentication provider.
+  Requires any edition of the Realm Object Server 1.4.0 or later.
+* `{RLM}SyncConfiguration` now has an `enableSSLValidation` property
+  (and default parameter in the Swift initializer) to allow SSL validation
+  to be specified on a per-server basis.
+* Transactions between a synced Realm and a Realm Object Server can now
+  exceed 16 MB in size.
+* Add new APIs for changing and retrieving permissions for synchronized Realms.
+  These APIs are intended to replace the existing Realm Object-based permissions
+  system. Requires any edition of the Realm Object Server 1.1.0 or later.
+
+### Bugfixes
+
+* Support Realm model classes defined in Swift with overridden Objective-C
+  names (e.g. `@objc(Foo) class SwiftFoo: Object {}`).
+* Fix `-[RLMMigration enumerateObjects:block:]` returning incorrect `oldObject`
+  objects when enumerating a class name after previously deleting a `newObject`.
+* Fix an issue where `Realm.asyncOpen(...)` would fail to work when opening a
+  synchronized Realm for which the user only had read permissions.
+* Using KVC to set a `List` property to `nil` now clears it to match the
+  behavior of `RLMArray` properties.
+* Fix crash from `!m_awaiting_pong` assertion failure when using synced Realms.
+* Fix poor performance or hangs when performing case-insensitive queries on
+  indexed string properties that contain many characters that don't differ
+  between upper and lower case (e.g., numbers, punctuation).
+
+2.6.2 Release notes (2017-04-21)
+=============================================================
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix an issue where calling `Realm.asyncOpen(...)` with a synchronized Realm
+  configuration would fail with an "Operation canceled" error.
+* Fix initial collection notification sometimes not being delivered for synced
+  Realms.
+* Fix circular links sometimes resulting in objects not being marked as
+  modified in change notifications.
+
+2.6.1 Release notes (2017-04-18)
+=============================================================
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix an issue where calling `Realm.asyncOpen(...)` with a synchronized Realm
+  configuration would crash in error cases rather than report the error.
+  This is a small source breaking change if you were relying on the error
+  being reported to be a `Realm.Error`.
+
+2.6.0 Release notes (2017-04-18)
+=============================================================
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* Add a `{RLM}SyncUser.isAdmin` property indicating whether a user is a Realm
+  Object Server administrator.
+* Add an API to asynchronously open a Realm and deliver it to a block on a
+  given queue. This performs all work needed to get the Realm to
+  a usable state (such as running potentially time-consuming migrations) on a
+  background thread before dispatching to the given queue. In addition,
+  synchronized Realms wait for all remote content available at the time the
+  operation began to be downloaded and available locally.
+* Add `shouldCompactOnLaunch` block property when configuring a Realm to
+  determine if it should be compacted before being returned.
+* Speed up case-insensitive queries on indexed string properties.
+* Add RLMResults's collection aggregate methods to RLMArray.
+* Add support for calling the aggregate methods on unmanaged Lists.
+
+### Bugfixes
+
+* Fix a deadlock when multiple processes open a Realm at the same time.
+* Fix `value(forKey:)`/`value(forKeyPath:)` returning incorrect values for `List` properties.
+
+2.5.1 Release notes (2017-04-05)
+=============================================================
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix CocoaPods installation with static libraries and multiple platforms.
+* Fix uncaught "Bad version number" exceptions on the notification worker thread
+  followed by deadlocks when Realms refresh.
+
+2.5.0 Release notes (2017-03-28)
+=============================================================
+
+Files written by Realm this version cannot be read by earlier versions of Realm.
+Old files can still be opened and files open in read-only mode will not be
+modified.
+
+If using synchronized Realms, the Realm Object Server must be running version
+1.3.0 or later.
+
+Swift binaries are now produced for Swift 3.0, 3.0.1, 3.0.2 and 3.1.
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* Add support for multi-level object equality comparisons against `NULL`.
+* Add support for the `[d]` modifier on string comparison operators to perform
+  diacritic-insensitive comparisons.
+* Explicitly mark `[[RLMRealm alloc] init]` as unavailable.
+* Include the name of the problematic class in the error message when an
+  invalid property type is marked as the primary key.
+
+### Bugfixes
+
+* Fix incorrect column type assertions which could occur after schemas were
+  merged by sync.
+* Eliminate an empty write transaction when opening a synced Realm.
+* Support encrypting synchronized Realms by respecting the `encryptionKey` value
+  of the Realm's configuration.
+* Fix crash when setting an `{NS}Data` property close to 16MB.
+* Fix for reading `{NS}Data` properties incorrectly returning `nil`.
+* Reduce file size growth in cases where Realm versions were pinned while
+  starting write transactions.
+* Fix an assertion failure when writing to large `RLMArray`/`List` properties.
+* Fix uncaught `BadTransactLog` exceptions when pulling invalid changesets from
+  synchronized Realms.
+* Fix an assertion failure when an observed `RLMArray`/`List` is deleted after
+  being modified.
+
+2.4.4 Release notes (2017-03-13)
+=============================================================
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* Add `(RLM)SyncPermission` class to allow reviewing access permissions for
+  Realms. Requires any edition of the Realm Object Server 1.1.0 or later.
+* Further reduce the number of files opened per thread-specific Realm on macOS,
+  iOS and watchOS.
+
+### Bugfixes
+
+* Fix a crash that could occur if new Realm instances were created while the
+  application was exiting.
+* Fix a bug that could lead to bad version number errors when delivering
+  change notifications.
+* Fix a potential use-after-free bug when checking validity of results.
+* Fix an issue where a sync session might not close properly if it receives
+  an error while being torn down.
+* Fix some issues where a sync session might not reconnect to the server properly
+  or get into an inconsistent state if revived after invalidation.
+* Fix an issue where notifications might not fire when the children of an
+  observed object are changed.
+* Fix an issue where progress notifications on sync sessions might incorrectly
+  report out-of-date values.
+* Fix an issue where multiple threads accessing encrypted data could result in
+  corrupted data or crashes.
+* Fix an issue where certain `LIKE` queries could hang.
+* Fix an issue where `-[RLMRealm writeCopyToURL:encryptionKey:error]` could create
+  a corrupt Realm file.
+* Fix an issue where incrementing a synced Realm's schema version without actually
+  changing the schema could cause a crash.
+
+2.4.3 Release notes (2017-02-20)
+=============================================================
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* Avoid copying copy-on-write data structures, which can grow the file, when the
+  write does not actually change existing values.
+* Improve performance of deleting all objects in an RLMResults.
+* Reduce the number of files opened per thread-specific Realm on macOS.
+* Improve startup performance with large numbers of `RLMObject`/`Object`
+  subclasses.
+
+### Bugfixes
+
+* Fix synchronized Realms not downloading remote changes when an access token
+  expires and there are no local changes to upload.
+* Fix an issue where values set on a Realm object using `setValue(value:, forKey:)`
+  that were not themselves Realm objects were not properly converted into Realm
+  objects or checked for validity.
+* Fix an issue where `-[RLMSyncUser sessionForURL:]` could erroneously return a
+  non-nil value when passed in an invalid URL.
+* `SyncSession.Progress.fractionTransferred` now returns 1 if there are no
+  transferrable bytes.
+* Fix sync progress notifications registered on background threads by always
+  dispatching on a dedicated background queue.
+* Fix compilation issues with Xcode 8.3 beta 2.
+* Fix incorrect sync progress notification values for Realms originally created
+  using a version of Realm prior to 2.3.0.
+* Fix LLDB integration to be able to display summaries of `RLMResults` once more.
+* Reject Swift properties with names which cause them to fall in to ARC method
+  families rather than crashing when they are accessed.
+* Fix sorting by key path when the declared property order doesn't match the order
+  of properties in the Realm file, which can happen when properties are added in
+  different schema versions.
+
+2.4.2 Release notes (2017-01-30)
+=============================================================
+
+### Bugfixes
+
+* Fix an issue where RLMRealm instances could end up in the autorelease pool
+  for other threads.
+
+2.4.1 Release notes (2017-01-27)
+=============================================================
+
+### Bugfixes
+
+* Fix an issue where authentication tokens were not properly refreshed
+  automatically before expiring.
+
+2.4.0 Release notes (2017-01-26)
+=============================================================
+
+This release drops support for compiling with Swift 2.x.
+Swift 3.0.0 is now the minimum Swift version supported.
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* Add change notifications for individual objects with an API similar to that
+  of collection notifications.
+
+### Bugfixes
+
+* Fix Realm Objective-C compilation errors with Xcode 8.3 beta 1.
+* Fix several error handling issues when renewing expired authentication
+  tokens for synchronized Realms.
+* Fix a race condition leading to bad_version exceptions being thrown in
+  Realm's background worker thread.
+
+2.3.0 Release notes (2017-01-19)
+=============================================================
+
+### Sync Breaking Changes
+
+* Make `PermissionChange`'s `id` property a primary key.
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* Add `SyncPermissionOffer` and `SyncPermissionOfferResponse` classes to allow
+  creating and accepting permission change events to synchronized Realms between
+  different users.
+* Support monitoring sync transfer progress by registering notification blocks
+  on `SyncSession`. Specify the transfer direction (`.upload`/`.download`) and
+  mode (`.reportIndefinitely`/`.forCurrentlyOutstandingWork`) to monitor.
+
+### Bugfixes
+
+* Fix a call to `commitWrite(withoutNotifying:)` committing a transaction that
+  would not have triggered a notification incorrectly skipping the next
+  notification.
+* Fix incorrect results and crashes when conflicting object insertions are
+  merged by the synchronization mechanism when there is a collection
+  notification registered for that object type.
+
+2.2.0 Release notes (2017-01-12)
+=============================================================
+
+### Sync Breaking Changes (In Beta)
+
+* Sync-related error reporting behavior has been changed. Errors not related
+  to a particular user or session are only reported if they are classed as
+  'fatal' by the underlying sync engine.
+* Added `RLMSyncErrorClientResetError` to `RLMSyncError` enum.
+
+### API Breaking Changes
+
+* The following Objective-C APIs have been deprecated in favor of newer or preferred versions:
+
+| Deprecated API                                              | New API                                                     |
+|:------------------------------------------------------------|:------------------------------------------------------------|
+| `-[RLMArray sortedResultsUsingProperty:]`                   | `-[RLMArray sortedResultsUsingKeyPath:]`                    |
+| `-[RLMCollection sortedResultsUsingProperty:]`              | `-[RLMCollection sortedResultsUsingKeyPath:]`               |
+| `-[RLMResults sortedResultsUsingProperty:]`                 | `-[RLMResults sortedResultsUsingKeyPath:]`                  |
+| `+[RLMSortDescriptor sortDescriptorWithProperty:ascending]` | `+[RLMSortDescriptor sortDescriptorWithKeyPath:ascending:]` |
+| `RLMSortDescriptor.property`                                | `RLMSortDescriptor.keyPath`                                 |
+
+* The following Swift APIs have been deprecated in favor of newer or preferred versions:
+
+| Deprecated API                                        | New API                                          |
+|:------------------------------------------------------|:-------------------------------------------------|
+| `LinkingObjects.sorted(byProperty:ascending:)`        | `LinkingObjects.sorted(byKeyPath:ascending:)`    |
+| `List.sorted(byProperty:ascending:)`                  | `List.sorted(byKeyPath:ascending:)`              |
+| `RealmCollection.sorted(byProperty:ascending:)`       | `RealmCollection.sorted(byKeyPath:ascending:)`   |
+| `Results.sorted(byProperty:ascending:)`               | `Results.sorted(byKeyPath:ascending:)`           |
+| `SortDescriptor(property:ascending:)`                 | `SortDescriptor(keyPath:ascending:)`             |
+| `SortDescriptor.property`                             | `SortDescriptor.keyPath`                         |
+
+### Enhancements
+
+* Introduce APIs for safely passing objects between threads. Create a
+  thread-safe reference to a thread-confined object by passing it to the
+  `+[RLMThreadSafeReference referenceWithThreadConfined:]`/`ThreadSafeReference(to:)`
+  constructor, which you can then safely pass to another thread to resolve in
+  the new Realm with `-[RLMRealm resolveThreadSafeReference:]`/`Realm.resolve(_:)`.
+* Realm collections can now be sorted by properties over to-one relationships.
+* Optimized `CONTAINS` queries to use Boyer-Moore algorithm
+  (around 10x speedup on large datasets).
+
+### Bugfixes
+
+* Setting `deleteRealmIfMigrationNeeded` now also deletes the Realm if a file
+  format migration is required, such as when moving from a file last accessed
+  with Realm 0.x to 1.x, or 1.x to 2.x.
+* Fix queries containing nested `SUBQUERY` expressions.
+* Fix spurious incorrect thread exceptions when a thread id happens to be
+  reused while an RLMRealm instance from the old thread still exists.
+* Fixed various bugs in aggregate methods (max, min, avg, sum).
+
+2.1.2 Release notes (2016--12-19)
+=============================================================
+
+This release adds binary versions of Swift 3.0.2 frameworks built with Xcode 8.2.
+
+### Sync Breaking Changes (In Beta)
+
+* Rename occurences of "iCloud" with "CloudKit" in APIs and comments to match
+  naming in the Realm Object Server.
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* Add support for 'LIKE' queries (wildcard matching).
+
+### Bugfixes
+
+* Fix authenticating with CloudKit.
+* Fix linker warning about "Direct access to global weak symbol".
+
+2.1.1 Release notes (2016-12-02)
+=============================================================
+
+### Enhancements
+
+* Add `RealmSwift.ObjectiveCSupport.convert(object:)` methods to help write
+  code that interoperates between Realm Objective-C and Realm Swift APIs.
+* Throw exceptions when opening a Realm with an incorrect configuration, like:
+    * `readOnly` set with a sync configuration.
+    * `readOnly` set with a migration block.
+    * migration block set with a sync configuration.
+* Greatly improve performance of write transactions which make a large number of
+  changes to indexed properties, including the automatic migration when opening
+  files written by Realm 1.x.
+
+### Bugfixes
+
+* Reset sync metadata Realm in case of decryption error.
+* Fix issue preventing using synchronized Realms in Xcode Playgrounds.
+* Fix assertion failure when migrating a model property from object type to
+  `RLMLinkingObjects` type.
+* Fix a `LogicError: Bad version number` exception when using `RLMResults` with
+  no notification blocks and explicitly called `-[RLMRealm refresh]` from that
+  thread.
+* Logged-out users are no longer returned from `+[RLMSyncUser currentUser]` or
+  `+[RLMSyncUser allUsers]`.
+* Fix several issues which could occur when the 1001st object of a given type
+  was created or added to an RLMArray/List, including crashes when rerunning
+  existing queries and possibly data corruption.
+* Fix a potential crash when the application exits due to a race condition in
+  the destruction of global static variables.
+* Fix race conditions when waiting for sync uploads or downloads to complete
+  which could result in crashes or the callback being called too early.
+
+2.1.0 Release notes (2016-11-18)
+=============================================================
+
+### Sync Breaking Changes (In Beta)
+
+* None.
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Add the ability to skip calling specific notification blocks when committing
+  a write transaction.
+
+### Bugfixes
+
+* Deliver collection notifications when beginning a write transaction which
+  advances the read version of a Realm (previously only Realm-level
+  notifications were sent).
+* Fix some scenarios which would lead to inconsistent states when using
+  collection notifications.
+* Fix several race conditions in the notification functionality.
+* Don't send Realm change notifications when canceling a write transaction.
+
+2.0.4 Release notes (2016-11-14)
+=============================================================
+
+### Sync Breaking Changes (In Beta)
+
+* Remove `RLMAuthenticationActions` and replace
+  `+[RLMSyncCredential credentialWithUsername:password:actions:]` with
+  `+[RLMSyncCredential credentialsWithUsername:password:register:]`.
+* Rename `+[RLMSyncUser authenticateWithCredential:]` to
+  `+[RLMSyncUser logInWithCredentials:]`.
+* Rename "credential"-related types and methods to
+  `RLMSyncCredentials`/`SyncCredentials` and consistently refer to credentials
+  in the plural form.
+* Change `+[RLMSyncUser all]` to return a dictionary of identifiers to users and
+  rename to:
+  * `+[RLMSyncUser allUsers]` in Objective-C.
+  * `SyncUser.allUsers()` in Swift 2.
+  * `SyncUser.all` in Swift 3.
+* Rename `SyncManager.sharedManager()` to `SyncManager.shared` in Swift 3.
+* Change `Realm.Configuration.syncConfiguration` to take a `SyncConfiguration`
+  struct rather than a named tuple.
+* `+[RLMSyncUser logInWithCredentials:]` now invokes its callback block on a
+  background queue.
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Add `+[RLMSyncUser currentUser]`.
+* Add the ability to change read, write and management permissions for
+  synchronized Realms using the management Realm obtained via the
+  `-[RLMSyncUser managementRealmWithError:]` API and the
+  `RLMSyncPermissionChange` class.
+
+### Bugfixes
+
+* None.
+
+2.0.3 Release notes (2016-10-27)
+=============================================================
+
+This release adds binary versions of Swift 3.0.1 frameworks built with Xcode 8.1
+GM seed.
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix a `BadVersion` exception caused by a race condition when delivering
+  collection change notifications.
+* Fix an assertion failure when additional model classes are added and
+  `deleteRealmIfMigrationNeeded` is enabled.
+* Fix a `BadTransactLog` exception when deleting an `RLMResults` in a synced
+  Realm.
+* Fix an assertion failure when a write transaction is in progress at the point
+  of process termination.
+* Fix a crash that could occur when working with a `RLMLinkingObject` property
+  of an unmanaged object.
+
+2.0.2 Release notes (2016-10-05)
+=============================================================
+
+This release is not protocol-compatible with previous version of the Realm
+Mobile Platform.
+
+### API breaking changes
+
+* Rename Realm Swift's `User` to `SyncUser` to make clear that it relates to the
+  Realm Mobile Platform, and to avoid potential conflicts with other `User` types.
+
+### Bugfixes
+
+* Fix Realm headers to be compatible with pre-C++11 dialects of Objective-C++.
+* Fix incorrect merging of RLMArray/List changes when objects with the same
+  primary key are created on multiple devices.
+* Fix bad transaction log errors after deleting objects on a different device.
+* Fix a BadVersion error when a background worker finishes running while older
+  results from that worker are being delivered to a different thread.
+
+2.0.1 Release notes (2016-09-29)
+=============================================================
+
+### Bugfixes
+
+* Fix an assertion failure when opening a Realm file written by a 1.x version
+  of Realm which has an indexed nullable int or bool property.
+
+2.0.0 Release notes (2016-09-27)
+=============================================================
+
+This release introduces support for the Realm Mobile Platform!
+See <https://realm.io/news/introducing-realm-mobile-platform/> for an overview
+of these great new features.
+
+### API breaking changes
+
+* By popular demand, `RealmSwift.Error` has been moved from the top-level
+  namespace into a `Realm` extension and is now `Realm.Error`, so that it no
+  longer conflicts with `Swift.Error`.
+* Files written by Realm 2.0 cannot be read by 1.x or earlier versions. Old
+  files can still be opened.
+
+### Enhancements
+
+* The .log, .log_a and .log_b files no longer exist and the state tracked in
+  them has been moved to the main Realm file. This reduces the number of open
+  files needed by Realm, improves performance of both opening and writing to
+  Realms, and eliminates a small window where committing write transactions
+  would prevent other processes from opening the file.
+
+### Bugfixes
+
+* Fix an assertion failure when sorting by zero properties.
+* Fix a mid-commit crash in one process also crashing all other processes with
+  the same Realm open.
+* Properly initialize new nullable float and double properties added to
+  existing objects to null rather than 0.
+* Fix a stack overflow when objects with indexed string properties had very
+  long common prefixes.
+* Fix a race condition which could lead to crashes when using async queries or
+  collection notifications.
+* Fix a bug which could lead to incorrect state when an object which links to
+  itself is deleted from the Realm.
+
+1.1.0 Release notes (2016-09-16)
+=============================================================
+
+This release brings official support for Xcode 8, Swift 2.3 and Swift 3.0.
+Prebuilt frameworks are now built with Xcode 7.3.1 and Xcode 8.0.
+
+### API breaking changes
+
+* Deprecate `migrateRealm:` in favor of new `performMigrationForConfiguration:error:` method
+  that follows Cocoa's NSError conventions.
+* Fix issue where `RLMResults` used `id `instead of its generic type as the return
+  type of subscript.
+
+### Enhancements
+
+* Improve error message when using NSNumber incorrectly in Swift models.
+* Further reduce the download size of the prebuilt static libraries.
+* Improve sort performance, especially on non-nullable columns.
+* Allow partial initialization of object by `initWithValue:`, deferring
+  required property checks until object is added to Realm.
+
+### Bugfixes
+
+* Fix incorrect truncation of the constant value for queries of the form
+  `column < value` for `float` and `double` columns.
+* Fix crash when an aggregate is accessed as an `Int8`, `Int16`, `Int32`, or `Int64`.
+* Fix a race condition that could lead to a crash if an RLMArray or List was
+  deallocated on a different thread than it was created on.
+* Fix a crash when the last reference to an observed object is released from
+  within the observation.
+* Fix a crash when `initWithValue:` is used to create a nested object for a class
+  with an uninitialized schema.
+* Enforce uniqueness for `RealmOptional` primary keys when using the `value` setter.
+
+1.0.2 Release notes (2016-07-13)
+=============================================================
+
+### API breaking changes
+
+* Attempting to add an object with no properties to a Realm now throws rather than silently
+  doing nothing.
+
+### Enhancements
+
+* Swift: A `write` block may now `throw`, reverting any changes already made in
+  the transaction.
+* Reduce address space used when committing write transactions.
+* Significantly reduce the download size of prebuilt binaries and slightly
+  reduce the final size contribution of Realm to applications.
+* Improve performance of accessing RLMArray properties and creating objects
+  with List properties.
+
+### Bugfixes
+
+* Fix a crash when reading the shared schema from an observed Swift object.
+* Fix crashes or incorrect results when passing an array of values to
+  `createOrUpdate` after reordering the class's properties.
+* Ensure that the initial call of a Results notification block is always passed
+  .Initial even if there is a write transaction between when the notification
+  is added and when the first notification is delivered.
+* Fix a crash when deleting all objects in a Realm while fast-enumerating query
+  results from that Realm.
+* Handle EINTR from flock() rather than crashing.
+* Fix incorrect behavior following a call to `[RLMRealm compact]`.
+* Fix live updating and notifications for Results created from a predicate involving
+  an inverse relationship to be triggered when an object at the other end of the relationship
+  is modified.
+
+1.0.1 Release notes (2016-06-12)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Significantly improve performance of opening Realm files, and slightly
+  improve performance of committing write transactions.
+
+### Bugfixes
+
+* Swift: Fix an error thrown when trying to create or update `Object` instances via
+  `add(:_update:)` with a primary key property of type `RealmOptional`.
+* Xcode playground in Swift release zip now runs successfully.
+* The `key` parameter of `Realm.objectForPrimaryKey(_:key:)`/ `Realm.dynamicObjectForPrimaryKey(_:key:)`
+ is now marked as optional.
+* Fix a potential memory leak when closing Realms after a Realm file has been
+  opened on multiple threads which are running in active run loops.
+* Fix notifications breaking on tvOS after a very large number of write
+  transactions have been committed.
+* Fix a "Destruction of mutex in use" assertion failure after an error while
+  opening a file.
+* Realm now throws an exception if an `Object` subclass is defined with a managed Swift `lazy` property.
+  Objects with ignored `lazy` properties should now work correctly.
+* Update the LLDB script to work with recent changes to the implementation of `RLMResults`.
+* Fix an assertion failure when a Realm file is deleted while it is still open,
+  and then a new Realm is opened at the same path. Note that this is still not
+  a supported scenario, and may break in other ways.
+
+1.0.0 Release notes (2016-05-25)
+=============================================================
+
+No changes since 0.103.2.
+
+0.103.2 Release notes (2016-05-24)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Improve the error messages when an I/O error occurs in `writeCopyToURL`.
+
+### Bugfixes
+
+* Fix an assertion failure which could occur when opening a Realm after opening
+  that Realm failed previously in some specific ways in the same run of the
+  application.
+* Reading optional integers, floats, and doubles from within a migration block
+  now correctly returns `nil` rather than 0 when the stored value is `nil`.
+
+0.103.1 Release notes (2016-05-19)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix a bug that sometimes resulted in a single object's NSData properties
+  changing from `nil` to a zero-length non-`nil` NSData when a different object
+  of the same type was deleted.
+
+0.103.0 Release notes (2016-05-18)
+=============================================================
+
+### API breaking changes
+
+* All functionality deprecated in previous releases has been removed entirely.
+* Support for Xcode 6.x & Swift prior to 2.2 has been completely removed.
+* `RLMResults`/`Results` now become empty when a `RLMArray`/`List` or object
+  they depend on is deleted, rather than throwing an exception when accessed.
+* Migrations are no longer run when `deleteRealmIfMigrationNeeded` is set,
+  recreating the file instead.
+
+### Enhancements
+
+* Added `invalidated` properties to `RLMResults`/`Results`, `RLMLinkingObjects`/`LinkingObjects`,
+  `RealmCollectionType` and `AnyRealmCollection`. These properties report whether the Realm
+  the object is associated with has been invalidated.
+* Some `NSError`s created by Realm now have more descriptive user info payloads.
+
+### Bugfixes
+
+* None.
+
+0.102.1 Release notes (2016-05-13)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Return `RLMErrorSchemaMismatch` error rather than the more generic `RLMErrorFail`
+  when a migration is required.
+* Improve the performance of allocating instances of `Object` subclasses
+  that have `LinkingObjects` properties.
+
+### Bugfixes
+
+* `RLMLinkingObjects` properties declared in Swift subclasses of `RLMObject`
+  now work correctly.
+* Fix an assertion failure when deleting all objects of a type, inserting more
+  objects, and then deleting some of the newly inserted objects within a single
+  write transaction when there is an active notification block for a different
+  object type which links to the objects being deleted.
+* Fix crashes and/or incorrect results when querying over multiple levels of
+  `LinkingObjects` properties.
+* Fix opening read-only Realms on multiple threads at once.
+* Fix a `BadTransactLog` exception when storing dates before the unix epoch (1970-01-01).
+
+0.102.0 Release notes (2016-05-09)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Add a method to rename properties during migrations:
+  * Swift: `Migration.renamePropertyForClass(_:oldName:newName:)`
+  * Objective-C: `-[RLMMigration renamePropertyForClass:oldName:newName:]`
+* Add `deleteRealmIfMigrationNeeded` to
+  `RLMRealmConfiguration`/`Realm.Configuration`. When this is set to `true`,
+  the Realm file will be automatically deleted and recreated when there is a
+  schema mismatch rather than migrated to the new schema.
+
+### Bugfixes
+
+* Fix `BETWEEN` queries that traverse `RLMArray`/`List` properties to ensure that
+  a single related object satisfies the `BETWEEN` criteria, rather than allowing
+  different objects in the array to satisfy the lower and upper bounds.
+* Fix a race condition when a Realm is opened on one thread while it is in the
+  middle of being closed on another thread which could result in crashes.
+* Fix a bug which could result in changes made on one thread being applied
+  incorrectly on other threads when those threads are refreshed.
+* Fix crash when migrating to the new date format introduced in 0.101.0.
+* Fix crash when querying inverse relationships when objects are deleted.
+
+0.101.0 Release notes (2016-05-04)
+=============================================================
+
+### API breaking changes
+
+* Files written by this version of Realm cannot be read by older versions of
+  Realm. Existing files will automatically be upgraded when they are opened.
+
+### Enhancements
+
+* Greatly improve performance of collection change calculation for complex
+  object graphs, especially for ones with cycles.
+* NSDate properties now support nanoseconds precision.
+* Opening a single Realm file on multiple threads now shares a single memory
+  mapping of the file for all threads, significantly reducing the memory
+  required to work with large files.
+* Crashing while in the middle of a write transaction no longer blocks other
+  processes from performing write transactions on the same file.
+* Improve the performance of refreshing a Realm (including via autorefresh)
+  when there are live Results/RLMResults objects for that Realm.
+
+### Bugfixes
+
+* Fix an assertion failure of "!more_before || index >= std::prev(it)->second)"
+  in `IndexSet::do_add()`.
+* Fix a crash when an `RLMArray` or `List` object is destroyed from the wrong
+  thread.
+
+0.100.0 Release notes (2016-04-29)
+=============================================================
+
+### API breaking changes
+
+* `-[RLMObject linkingObjectsOfClass:forProperty]` and `Object.linkingObjects(_:forProperty:)`
+  are deprecated in favor of properties of type `RLMLinkingObjects` / `LinkingObjects`.
+
+### Enhancements
+
+* The automatically-maintained inverse direction of relationships can now be exposed as
+  properties of type `RLMLinkingObjects` / `LinkingObjects`. These properties automatically
+  update to reflect the objects that link to the target object, can be used in queries, and
+  can be filtered like other Realm collection types.
+* Queries that compare objects for equality now support multi-level key paths.
+
+### Bugfixes
+
+* Fix an assertion failure when a second write transaction is committed after a
+  write transaction deleted the object containing an RLMArray/List which had an
+  active notification block.
+* Queries that compare `RLMArray` / `List` properties using != now give the correct results.
+
+0.99.1 Release notes (2016-04-26)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix a scenario that could lead to the assertion failure
+  "m_advancer_sg->get_version_of_current_transaction() ==
+  new_notifiers.front()->version()".
+
+0.99.0 Release notes (2016-04-22)
+=============================================================
+
+### API breaking changes
+
+* Deprecate properties of type `id`/`AnyObject`. This type was rarely used,
+  rarely useful and unsupported in every other Realm binding.
+* The block for `-[RLMArray addNotificationBlock:]` and
+  `-[RLMResults addNotificationBlock:]` now takes another parameter.
+* The following Objective-C APIs have been deprecated in favor of newer or preferred versions:
+
+| Deprecated API                                         | New API                                               |
+|:-------------------------------------------------------|:------------------------------------------------------|
+| `-[RLMRealm removeNotification:]`                      | `-[RLMNotificationToken stop]`                        |
+| `RLMRealmConfiguration.path`                           | `RLMRealmConfiguration.fileURL`                       |
+| `RLMRealm.path`                                        | `RLMRealmConfiguration.fileURL`                       |
+| `RLMRealm.readOnly`                                    | `RLMRealmConfiguration.readOnly`                      |
+| `+[RLMRealm realmWithPath:]`                           | `+[RLMRealm realmWithURL:]`                           |
+| `+[RLMRealm writeCopyToPath:error:]`                   | `+[RLMRealm writeCopyToURL:encryptionKey:error:]`     |
+| `+[RLMRealm writeCopyToPath:encryptionKey:error:]`     | `+[RLMRealm writeCopyToURL:encryptionKey:error:]`     |
+| `+[RLMRealm schemaVersionAtPath:error:]`               | `+[RLMRealm schemaVersionAtURL:encryptionKey:error:]` |
+| `+[RLMRealm schemaVersionAtPath:encryptionKey:error:]` | `+[RLMRealm schemaVersionAtURL:encryptionKey:error:]` |
+
+* The following Swift APIs have been deprecated in favor of newer or preferred versions:
+
+| Deprecated API                                | New API                                  |
+|:----------------------------------------------|:-----------------------------------------|
+| `Realm.removeNotification(_:)`                | `NotificationToken.stop()`               |
+| `Realm.Configuration.path`                    | `Realm.Configuration.fileURL`            |
+| `Realm.path`                                  | `Realm.Configuration.fileURL`            |
+| `Realm.readOnly`                              | `Realm.Configuration.readOnly`           |
+| `Realm.writeCopyToPath(_:encryptionKey:)`     | `Realm.writeCopyToURL(_:encryptionKey:)` |
+| `schemaVersionAtPath(_:encryptionKey:error:)` | `schemaVersionAtURL(_:encryptionKey:)`   |
+
+### Enhancements
+
+* Add information about what rows were added, removed, or modified to the
+  notifications sent to the Realm collections.
+* Improve error when illegally appending to an `RLMArray` / `List` property from a default value
+  or the standalone initializer (`init()`) before the schema is ready.
+
+### Bugfixes
+
+* Fix a use-after-free when an associated object's dealloc method is used to
+  remove observers from an RLMObject.
+* Fix a small memory leak each time a Realm file is opened.
+* Return a recoverable `RLMErrorAddressSpaceExhausted` error rather than
+  crash when there is insufficient available address space on Realm
+  initialization or write commit.
+
+0.98.8 Release notes (2016-04-15)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fixed a bug that caused some encrypted files created using
+  `-[RLMRealm writeCopyToPath:encryptionKey:error:]` to fail to open.
+
+0.98.7 Release notes (2016-04-13)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Mark further initializers in Objective-C as NS_DESIGNATED_INITIALIZER to prevent that these aren't
+  correctly defined in Swift Object subclasses, which don't qualify for auto-inheriting the required initializers.
+* `-[RLMResults indexOfObjectWithPredicate:]` now returns correct results
+  for `RLMResults` instances that were created by filtering an `RLMArray`.
+* Adjust how RLMObjects are destroyed in order to support using an associated
+  object on an RLMObject to remove KVO observers from that RLMObject.
+* `-[RLMResults indexOfObjectWithPredicate:]` now returns the index of the first matching object for a
+  sorted `RLMResults`, matching its documented behavior.
+* Fix a crash when canceling a transaction that set a relationship.
+* Fix a crash when a query referenced a deleted object.
+
+0.98.6 Release notes (2016-03-25)
+=============================================================
+
+Prebuilt frameworks are now built with Xcode 7.3.
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix running unit tests on iOS simulators and devices with Xcode 7.3.
+
+0.98.5 Release notes (2016-03-14)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix a crash when opening a Realm on 32-bit iOS devices.
+
+0.98.4 Release notes (2016-03-10)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Properly report changes made by adding an object to a Realm with
+  addOrUpdate:/createOrUpdate: to KVO observers for existing objects with that
+  primary key.
+* Fix crashes and assorted issues when a migration which added object link
+  properties is rolled back due to an error in the migration block.
+* Fix assertion failures when deleting objects within a migration block of a
+  type which had an object link property added in that migration.
+* Fix an assertion failure in `Query::apply_patch` when updating certain kinds
+  of queries after a write transaction is committed.
+
+0.98.3 Release notes (2016-02-26)
+=============================================================
+
+### Enhancements
+
+* Initializing the shared schema is 3x faster.
+
+### Bugfixes
+
+* Using Realm Objective-C from Swift while having Realm Swift linked no longer causes that the
+  declared `ignoredProperties` are not taken into account.
+* Fix assertion failures when rolling back a migration which added Object link
+  properties to a class.
+* Fix potential errors when cancelling a write transaction which modified
+  multiple `RLMArray`/`List` properties.
+* Report the correct value for inWriteTransaction after attempting to commit a
+  write transaction fails.
+* Support CocoaPods 1.0 beginning from prerelease 1.0.0.beta.4 while retaining
+  backwards compatibility with 0.39.
+
+0.98.2 Release notes (2016-02-18)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Aggregate operations (`ANY`, `NONE`, `@count`, `SUBQUERY`, etc.) are now supported for key paths
+  that begin with an object relationship so long as there is a `RLMArray`/`List` property at some
+  point in a key path.
+* Predicates of the form `%@ IN arrayProperty` are now supported.
+
+### Bugfixes
+
+* Use of KVC collection operators on Swift collection types no longer throws an exception.
+* Fix reporting of inWriteTransaction in notifications triggered by
+  `beginWriteTransaction`.
+* The contents of `List` and `Optional` properties are now correctly preserved when copying
+  a Swift object from one Realm to another, and performing other operations that result in a
+  Swift object graph being recursively traversed from Objective-C.
+* Fix a deadlock when queries are performed within a Realm notification block.
+* The `ANY` / `SOME` / `NONE` qualifiers are now required in comparisons involving a key path that
+  traverse a `RLMArray`/`List` property. Previously they were only required if the first key in the
+  key path was an `RLMArray`/`List` property.
+* Fix several scenarios where the default schema would be initialized
+  incorrectly if the first Realm opened used a restricted class subset (via
+  `objectClasses`/`objectTypes`).
+
+0.98.1 Release notes (2016-02-10)
+=============================================================
+
+### Bugfixes
+
+* Fix crashes when deleting an object containing an `RLMArray`/`List` which had
+  previously been queried.
+* Fix a crash when deleting an object containing an `RLMArray`/`List` with
+  active notification blocks.
+* Fix duplicate file warnings when building via CocoaPods.
+* Fix crash or incorrect results when calling `indexOfObject:` on an
+  `RLMResults` derived from an `RLMArray`.
+
+0.98.0 Release notes (2016-02-04)
+=============================================================
+
+### API breaking changes
+
+* `+[RLMRealm realmWithPath:]`/`Realm.init(path:)` now inherits from the default
+  configuration.
+* Swift 1.2 is no longer supported.
+
+### Enhancements
+
+* Add `addNotificationBlock` to `RLMResults`, `Results`, `RLMArray`, and
+  `List`, which calls the given block whenever the collection changes.
+* Do a lot of the work for keeping `RLMResults`/`Results` up-to-date after
+  write transactions on a background thread to help avoid blocking the main
+  thread.
+* `NSPredicate`'s `SUBQUERY` operator is now supported. It has the following limitations:
+  * `@count` is the only operator that may be applied to the `SUBQUERY` expression.
+  * The `SUBQUERY(…).@count` expression must be compared with a constant.
+  * Correlated subqueries are not yet supported.
+
+### Bugfixes
+
+* None.
+
+0.97.1 Release notes (2016-01-29)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Swift: Added `Error` enum allowing to catch errors e.g. thrown on initializing
+  `RLMRealm`/`Realm` instances.
+* Fail with `RLMErrorFileNotFound` instead of the more generic `RLMErrorFileAccess`,
+  if no file was found when a realm was opened as read-only or if the directory part
+  of the specified path was not found when a copy should be written. 
+* Greatly improve performance when deleting objects with one or more indexed
+  properties.
+* Indexing `BOOL`/`Bool` and `NSDate` properties are now supported.
+* Swift: Add support for indexing optional properties.
+
+### Bugfixes
+
+* Fix incorrect results or crashes when using `-[RLMResults setValue:forKey:]`
+  on an RLMResults which was filtered on the key being set.
+* Fix crashes when an RLMRealm is deallocated from the wrong thread.
+* Fix incorrect results from aggregate methods on `Results`/`RLMResults` after
+  objects which were previously in the results are deleted.
+* Fix a crash when adding a new property to an existing class with over a
+  million objects in the Realm.
+* Fix errors when opening encrypted Realm files created with writeCopyToPath.
+* Fix crashes or incorrect results for queries that use relationship equality
+  in cases where the `RLMResults` is kept alive and instances of the target class
+  of the relationship are deleted.
+
+0.97.0 Release notes (2015-12-17)
+=============================================================
+
+### API breaking changes
+
+* All functionality deprecated in previous releases has been removed entirely.
+* Add generic type annotations to NSArrays and NSDictionaries in public APIs.
+* Adding a Realm notification block on a thread not currently running from
+  within a run loop throws an exception rather than silently never calling the
+  notification block.
+
+### Enhancements
+
+* Support for tvOS.
+* Support for building Realm Swift from source when using Carthage.
+* The block parameter of `-[RLMRealm transactionWithBlock:]`/`Realm.write(_:)` is 
+  now marked as `__attribute__((noescape))`/`@noescape`.
+* Many forms of queries with key paths on both sides of the comparison operator
+  are now supported.
+* Add support for KVC collection operators in `RLMResults` and `RLMArray`.
+* Fail instead of deadlocking in `+[RLMRealm sharedSchema]`, if a Swift property is initialized
+  to a computed value, which attempts to open a Realm on its own.
+
+### Bugfixes
+
+* Fix poor performance when calling `-[RLMRealm deleteObjects:]` on an
+  `RLMResults` which filtered the objects when there are other classes linking
+  to the type of the deleted objects.
+* An exception is now thrown when defining `Object` properties of an unsupported
+  type.
+
+0.96.3 Release notes (2015-12-04)
+=============================================================
+
+### Enhancements
+
+* Queries are no longer limited to 16 levels of grouping.
+* Rework the implementation of encrypted Realms to no longer interfere with
+  debuggers.
+
+### Bugfixes
+
+* Fix crash when trying to retrieve object instances via `dynamicObjects`.
+* Throw an exception when querying on a link providing objects, which are from a different Realm.
+* Return empty results when querying on a link providing an unattached object.
+* Fix crashes or incorrect results when calling `-[RLMRealm refresh]` during
+  fast enumeration.
+* Add `Int8` support for `RealmOptional`, `MinMaxType` and `AddableType`.
+* Set the default value for newly added non-optional NSData properties to a
+  zero-byte NSData rather than nil.
+* Fix a potential crash when deleting all objects of a class.
+* Fix performance problems when creating large numbers of objects with
+  `RLMArray`/`List` properties.
+* Fix memory leak when using Object(value:) for subclasses with
+  `List` or `RealmOptional` properties.
+* Fix a crash when computing the average of an optional integer property.
+* Fix incorrect search results for some queries on integer properties.
+* Add error-checking for nil realm parameters in many methods such as
+  `+[RLMObject allObjectsInRealm:]`.
+* Fix a race condition between commits and opening Realm files on new threads
+  that could lead to a crash.
+* Fix several crashes when opening Realm files.
+* `-[RLMObject createInRealm:withValue:]`, `-[RLMObject createOrUpdateInRealm:withValue:]`, and
+  their variants for the default Realm now always match the contents of an `NSArray` against properties
+  in the same order as they are defined in the model.
+
+0.96.2 Release notes (2015-10-26)
+=============================================================
+
+Prebuilt frameworks are now built with Xcode 7.1.
+
+### Bugfixes
+
+* Fix ignoring optional properties in Swift.
+* Fix CocoaPods installation on case-sensitive file systems.
+
+0.96.1 Release notes (2015-10-20)
+=============================================================
+
+### Bugfixes
+
+* Support assigning `Results` to `List` properties via KVC.
+* Honor the schema version set in the configuration in `+[RLMRealm migrateRealm:]`.
+* Fix crash when using optional Int16/Int32/Int64 properties in Swift.
+
+0.96.0 Release notes (2015-10-14)
+=============================================================
+
+* No functional changes since beta2.
+
+0.96.0-beta2 Release notes (2015-10-08)
+=============================================================
+
+### Bugfixes
+
+* Add RLMOptionalBase.h to the podspec.
+
+0.96.0-beta Release notes (2015-10-07)
+=============================================================
+
+### API breaking changes
+
+* CocoaPods v0.38 or greater is now required to install Realm and RealmSwift
+  as pods.
+
+### Enhancements
+
+* Functionality common to both `List` and `Results` is now declared in a
+  `RealmCollectionType` protocol that both types conform to.
+* `Results.realm` now returns an `Optional<Realm>` in order to conform to
+  `RealmCollectionType`, but will always return `.Some()` since a `Results`
+  cannot exist independently from a `Realm`.
+* Aggregate operations are now available on `List`: `min`, `max`, `sum`,
+  `average`.
+* Committing write transactions (via `commitWrite` / `commitWriteTransaction` and
+  `write` / `transactionWithBlock`) now optionally allow for handling errors when
+  the disk is out of space.
+* Added `isEmpty` property on `RLMRealm`/`Realm` to indicate if it contains any
+  objects.
+* The `@count`, `@min`, `@max`, `@sum` and `@avg` collection operators are now
+  supported in queries.
+
+### Bugfixes
+
+* Fix assertion failure when inserting NSData between 8MB and 16MB in size.
+* Fix assertion failure when rolling back a migration which removed an object
+  link or `RLMArray`/`List` property.
+* Add the path of the file being opened to file open errors.
+* Fix a crash that could be triggered by rapidly opening and closing a Realm
+  many times on multiple threads at once.
+* Fix several places where exception messages included the name of the wrong
+  function which failed.
+
+0.95.3 Release notes (2015-10-05)
+=============================================================
+
+### Bugfixes
+
+* Compile iOS Simulator framework architectures with `-fembed-bitcode-marker`.
+* Fix crashes when the first Realm opened uses a class subset and later Realms
+  opened do not.
+* Fix inconsistent errors when `Object(value: ...)` is used to initialize the
+  default value of a property of an `Object` subclass.
+* Throw an exception when a class subset has objects with array or object
+  properties of a type that are not part of the class subset.
+
+0.95.2 Release notes (2015-09-24)
+=============================================================
+
+* Enable bitcode for iOS and watchOS frameworks.
+* Build libraries with Xcode 7 final rather than the GM.
+
+0.95.1 Release notes (2015-09-23)
+=============================================================
+
+### Enhancements
+
+* Add missing KVO handling for moving and exchanging objects in `RLMArray` and
+  `List`.
+
+### Bugfixes
+
+* Setting the primary key property on persisted `RLMObject`s / `Object`s
+  via subscripting or key-value coding will cause an exception to be thrown.
+* Fix crash due to race condition in `RLMRealmConfiguration` where the default
+  configuration was in the process of being copied in one thread, while
+  released in another.
+* Fix crash when a migration which removed an object or array property is
+  rolled back due to an error.
+
+0.95.0 Release notes (2015-08-25)
+=============================================================
+
+### API breaking changes
+
+* The following APIs have been deprecated in favor of the new `RLMRealmConfiguration` class in Realm Objective-C:
+
+| Deprecated API                                                    | New API                                                                          |
+|:------------------------------------------------------------------|:---------------------------------------------------------------------------------|
+| `+[RLMRealm realmWithPath:readOnly:error:]`                       | `+[RLMRealm realmWithConfiguration:error:]`                                      |
+| `+[RLMRealm realmWithPath:encryptionKey:readOnly:error:]`         | `+[RLMRealm realmWithConfiguration:error:]`                                      |
+| `+[RLMRealm setEncryptionKey:forRealmsAtPath:]`                   | `-[RLMRealmConfiguration setEncryptionKey:]`                                     |
+| `+[RLMRealm inMemoryRealmWithIdentifier:]`                        | `+[RLMRealm realmWithConfiguration:error:]`                                      |
+| `+[RLMRealm defaultRealmPath]`                                    | `+[RLMRealmConfiguration defaultConfiguration]`                                  |
+| `+[RLMRealm setDefaultRealmPath:]`                                | `+[RLMRealmConfiguration setDefaultConfiguration:]`                              |
+| `+[RLMRealm setDefaultRealmSchemaVersion:withMigrationBlock]`     | `RLMRealmConfiguration.schemaVersion` and `RLMRealmConfiguration.migrationBlock` |
+| `+[RLMRealm setSchemaVersion:forRealmAtPath:withMigrationBlock:]` | `RLMRealmConfiguration.schemaVersion` and `RLMRealmConfiguration.migrationBlock` |
+| `+[RLMRealm migrateRealmAtPath:]`                                 | `+[RLMRealm migrateRealm:]`                                                      |
+| `+[RLMRealm migrateRealmAtPath:encryptionKey:]`                   | `+[RLMRealm migrateRealm:]`                                                      |
+
+* The following APIs have been deprecated in favor of the new `Realm.Configuration` struct in Realm Swift for Swift 1.2:
+
+| Deprecated API                                                | New API                                                                      |
+|:--------------------------------------------------------------|:-----------------------------------------------------------------------------|
+| `Realm.defaultPath`                                           | `Realm.Configuration.defaultConfiguration`                                   |
+| `Realm(path:readOnly:encryptionKey:error:)`                   | `Realm(configuration:error:)`                                                |
+| `Realm(inMemoryIdentifier:)`                                  | `Realm(configuration:error:)`                                                |
+| `Realm.setEncryptionKey(:forPath:)`                           | `Realm(configuration:error:)`                                                |
+| `setDefaultRealmSchemaVersion(schemaVersion:migrationBlock:)` | `Realm.Configuration.schemaVersion` and `Realm.Configuration.migrationBlock` |
+| `setSchemaVersion(schemaVersion:realmPath:migrationBlock:)`   | `Realm.Configuration.schemaVersion` and `Realm.Configuration.migrationBlock` |
+| `migrateRealm(path:encryptionKey:)`                           | `migrateRealm(configuration:)`                                               |
+
+* The following APIs have been deprecated in favor of the new `Realm.Configuration` struct in Realm Swift for Swift 2.0:
+
+| Deprecated API                                                | New API                                                                      |
+|:--------------------------------------------------------------|:-----------------------------------------------------------------------------|
+| `Realm.defaultPath`                                           | `Realm.Configuration.defaultConfiguration`                                   |
+| `Realm(path:readOnly:encryptionKey:) throws`                  | `Realm(configuration:) throws`                                               |
+| `Realm(inMemoryIdentifier:)`                                  | `Realm(configuration:) throws`                                               |
+| `Realm.setEncryptionKey(:forPath:)`                           | `Realm(configuration:) throws`                                               |
+| `setDefaultRealmSchemaVersion(schemaVersion:migrationBlock:)` | `Realm.Configuration.schemaVersion` and `Realm.Configuration.migrationBlock` |
+| `setSchemaVersion(schemaVersion:realmPath:migrationBlock:)`   | `Realm.Configuration.schemaVersion` and `Realm.Configuration.migrationBlock` |
+| `migrateRealm(path:encryptionKey:)`                           | `migrateRealm(configuration:)`                                               |
+
+* `List.extend` in Realm Swift for Swift 2.0 has been replaced with `List.appendContentsOf`,
+  mirroring changes to `RangeReplaceableCollectionType`.
+
+* Object properties on `Object` subclasses in Realm Swift must be marked as optional,
+  otherwise a runtime exception will be thrown.
+
+### Enhancements
+
+* Persisted properties of `RLMObject`/`Object` subclasses are now Key-Value
+  Observing compliant.
+* The different options used to create Realm instances have been consolidated
+  into a single `RLMRealmConfiguration`/`Realm.Configuration` object.
+* Enumerating Realm collections (`RLMArray`, `RLMResults`, `List<>`,
+  `Results<>`) now enumerates over a copy of the collection, making it no
+  longer an error to modify a collection during enumeration (either directly,
+  or indirectly by modifying objects to make them no longer match a query).
+* Improve performance of object insertion in Swift to bring it roughly in line
+  with Objective-C.
+* Allow specifying a specific list of `RLMObject` / `Object` subclasses to include
+  in a given Realm via `RLMRealmConfiguration.objectClasses` / `Realm.Configuration.objectTypes`.
+
+### Bugfixes
+
+* Subscripting on `RLMObject` is now marked as nullable.
+
+0.94.1 Release notes (2015-08-10)
+=============================================================
+
+### API breaking changes
+
+* Building for watchOS requires Xcode 7 beta 5.
+
+### Enhancements
+
+* `Object.className` is now marked as `final`.
+
+### Bugfixes
+
+* Fix crash when adding a property to a model without updating the schema
+  version.
+* Fix unnecessary redownloading of the core library when building from source.
+* Fix crash when sorting by an integer or floating-point property on iOS 7.
+
+0.94.0 Release notes (2015-07-29)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Reduce the amount of memory used by RLMRealm notification listener threads.
+* Avoid evaluating results eagerly when filtering and sorting.
+* Add nullability annotations to the Objective-C API to provide enhanced compiler
+  warnings and bridging to Swift.
+* Make `RLMResult`s and `RLMArray`s support Objective-C generics.
+* Add support for building watchOS and bitcode-compatible apps.
+* Make the exceptions thrown in getters and setters more informative.
+* Add `-[RLMArray exchangeObjectAtIndex:withObjectAtIndex]` and `List.swap(_:_:)`
+  to allow exchanging the location of two objects in the given `RLMArray` / `List`.
+* Added anonymous analytics on simulator/debugger runs.
+* Add `-[RLMArray moveObjectAtIndex:toIndex:]` and `List.move(from:to:)` to
+  allow moving objects in the given `RLMArray` / `List`.
+
+### Bugfixes
+
+* Processes crashing due to an uncaught exception inside a write transaction will
+  no longer cause other processes using the same Realm to hang indefinitely.
+* Fix incorrect results when querying for < or <= on ints that
+  require 64 bits to represent with a CPU that supports SSE 4.2.
+* An exception will no longer be thrown when attempting to reset the schema
+  version or encryption key on an open Realm to the current value.
+* Date properties on 32 bit devices will retain 64 bit second precision.
+* Wrap calls to the block passed to `enumerate` in an autoreleasepool to reduce
+  memory growth when migrating a large amount of objects.
+* In-memory realms no longer write to the Documents directory on iOS or
+  Application Support on OS X.
+
+0.93.2 Release notes (2015-06-12)
+=============================================================
+
+### Bugfixes
+
+* Fixed an issue where the packaged OS X Realm.framework was built with
+  `GCC_GENERATE_TEST_COVERAGE_FILES` and `GCC_INSTRUMENT_PROGRAM_FLOW_ARCS`
+  enabled.
+* Fix a memory leak when constructing standalone Swift objects with NSDate
+  properties.
+* Throw an exception rather than asserting when an invalidated object is added
+  to an RLMArray.
+* Fix a case where data loss would occur if a device was hard-powered-off
+  shortly after a write transaction was committed which had to expand the Realm
+  file.
+
+0.93.1 Release notes (2015-05-29)
+=============================================================
+
+### Bugfixes
+
+* Objects are no longer copied into standalone objects during object creation. This fixes an issue where
+  nested objects with a primary key are sometimes duplicated rather than updated.
+* Comparison predicates with a constant on the left of the operator and key path on the right now give
+  correct results. An exception is now thrown for predicates that do not yet support this ordering.
+* Fix some crashes in `index_string.cpp` with int primary keys or indexed int properties.
+
+0.93.0 Release notes (2015-05-27)
+=============================================================
+
+### API breaking changes
+
+* Schema versions are now represented as `uint64_t` (Objective-C) and `UInt64` (Swift) so that they have
+  the same representation on all architectures.
+
+### Enhancements
+
+* Swift: `Results` now conforms to `CVarArgType` so it can
+  now be passed as an argument to `Results.filter(_:...)`
+  and `List.filter(_:...)`.
+* Swift: Made `SortDescriptor` conform to the `Equatable` and
+  `StringLiteralConvertible` protocols.
+* Int primary keys are once again automatically indexed.
+* Improve error reporting when attempting to mark a property of a type that
+  cannot be indexed as indexed.
+
+### Bugfixes
+
+* Swift: `RealmSwift.framework` no longer embeds `Realm.framework`,
+  which now allows apps using it to pass iTunes Connect validation.
+
+0.92.4 Release notes (2015-05-22)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Swift: Made `Object.init()` a required initializer.
+* `RLMObject`, `RLMResults`, `Object` and `Results` can now be safely
+  deallocated (but still not used) from any thread.
+* Improve performance of `-[RLMArray indexOfObjectWhere:]` and `-[RLMArray
+  indexOfObjectWithPredicate:]`, and implement them for standalone RLMArrays.
+* Improved performance of most simple queries.
+
+### Bugfixes
+
+* The interprocess notification mechanism no longer uses dispatch worker threads, preventing it from
+  starving other GCD clients of the opportunity to execute blocks when dozens of Realms are open at once.
+
+0.92.3 Release notes (2015-05-13)
+=============================================================
+
+### API breaking changes
+
+* Swift: `Results.average(_:)` now returns an optional, which is `nil` if and only if the results
+  set is empty.
+
+### Enhancements
+
+* Swift: Added `List.invalidated`, which returns if the given `List` is no longer
+  safe to be accessed, and is analogous to `-[RLMArray isInvalidated]`.
+* Assertion messages are automatically logged to Crashlytics if it's loaded
+  into the current process to make it easier to diagnose crashes.
+
+### Bugfixes
+
+* Swift: Enumerating through a standalone `List` whose objects themselves
+  have list properties won't crash.
+* Swift: Using a subclass of `RealmSwift.Object` in an aggregate operator of a predicate
+  no longer throws a spurious type error.
+* Fix incorrect results for when using OR in a query on a `RLMArray`/`List<>`.
+* Fix incorrect values from `[RLMResults count]`/`Results.count` when using
+  `!=` on an int property with no other query conditions.
+* Lower the maximum doubling threshold for Realm file sizes from 128MB to 16MB
+  to reduce the amount of wasted space.
+
+0.92.2 Release notes (2015-05-08)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Exceptions raised when incorrect object types are used with predicates now contain more detailed information.
+* Added `-[RLMMigration deleteDataForClassName:]` and `Migration.deleteData(_:)`
+  to enable cleaning up after removing object subclasses
+
+### Bugfixes
+
+* Prevent debugging of an application using an encrypted Realm to work around
+  frequent LLDB hangs. Until the underlying issue is addressed you may set
+  REALM_DISABLE_ENCRYPTION=YES in your application's environment variables to
+  have requests to open an encrypted Realm treated as a request for an
+  unencrypted Realm.
+* Linked objects are properly updated in `createOrUpdateInRealm:withValue:`.
+* List properties on Objects are now properly initialized during fast enumeration.
+
+0.92.1 Release notes (2015-05-06)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* `-[RLMRealm inWriteTransaction]` is now public.
+* Realm Swift is now available on CoocaPods.
+
+### Bugfixes
+
+* Force code re-signing after stripping architectures in `strip-frameworks.sh`.
+
+0.92.0 Release notes (2015-05-05)
+=============================================================
+
+### API breaking changes
+
+* Migration blocks are no longer called when a Realm file is first created.
+* The following APIs have been deprecated in favor of newer method names:
+
+| Deprecated API                                         | New API                                               |
+|:-------------------------------------------------------|:------------------------------------------------------|
+| `-[RLMMigration createObject:withObject:]`             | `-[RLMMigration createObject:withValue:]`             |
+| `-[RLMObject initWithObject:]`                         | `-[RLMObject initWithValue:]`                         |
+| `+[RLMObject createInDefaultRealmWithObject:]`         | `+[RLMObject createInDefaultRealmWithValue:]`         |
+| `+[RLMObject createInRealm:withObject:]`               | `+[RLMObject createInRealm:withValue:]`               |
+| `+[RLMObject createOrUpdateInDefaultRealmWithObject:]` | `+[RLMObject createOrUpdateInDefaultRealmWithValue:]` |
+| `+[RLMObject createOrUpdateInRealm:withObject:]`       | `+[RLMObject createOrUpdateInRealm:withValue:]`       |
+
+### Enhancements
+
+* `Int8` properties defined in Swift are now treated as integers, rather than
+  booleans.
+* NSPredicates created using `+predicateWithValue:` are now supported.
+
+### Bugfixes
+
+* Compound AND predicates with no subpredicates now correctly match all objects.
+
+0.91.5 Release notes (2015-04-28)
+=============================================================
+
+### Bugfixes
+
+* Fix issues with removing search indexes and re-enable it.
+
+0.91.4 Release notes (2015-04-27)
+=============================================================
+
+### Bugfixes
+
+* Temporarily disable removing indexes from existing columns due to bugs.
+
+0.91.3 Release notes (2015-04-17)
+=============================================================
+
+### Bugfixes
+
+* Fix `Extra argument 'objectClassName' in call` errors when building via
+  CocoaPods.
+
+0.91.2 Release notes (2015-04-16)
+=============================================================
+
+* Migration blocks are no longer called when a Realm file is first created.
+
+### Enhancements
+
+* `RLMCollection` supports collection KVC operations.
+* Sorting `RLMResults` is 2-5x faster (typically closer to 2x).
+* Refreshing `RLMRealm` after a write transaction which inserts or modifies
+  strings or `NSData` is committed on another thread is significantly faster.
+* Indexes are now added and removed from existing properties when a Realm file
+  is opened, rather than only when properties are first added.
+
+### Bugfixes
+
+* `+[RLMSchema dynamicSchemaForRealm:]` now respects search indexes.
+* `+[RLMProperty isEqualToProperty:]` now checks for equal `indexed` properties.
+
+0.91.1 Release notes (2015-03-12)
+=============================================================
+
+### Enhancements
+
+* The browser will automatically refresh when the Realm has been modified
+  from another process.
+* Allow using Realm in an embedded framework by setting
+  `APPLICATION_EXTENSION_API_ONLY` to YES.
+
+### Bugfixes
+
+* Fix a crash in CFRunLoopSourceInvalidate.
+
+0.91.0 Release notes (2015-03-10)
+=============================================================
+
+### API breaking changes
+
+* `attributesForProperty:` has been removed from `RLMObject`. You now specify indexed
+  properties by implementing the `indexedProperties` method.
+* An exception will be thrown when calling `setEncryptionKey:forRealmsAtPath:`,
+  `setSchemaVersion:forRealmAtPath:withMigrationBlock:`, and `migrateRealmAtPath:`
+  when a Realm at the given path is already open.
+* Object and array properties of type `RLMObject` will no longer be allowed.
+
+### Enhancements
+
+* Add support for sharing Realm files between processes.
+* The browser will no longer show objects that have no persisted properties.
+* `RLMSchema`, `RLMObjectSchema`, and `RLMProperty` now have more useful descriptions.
+* Opening an encrypted Realm while a debugger is attached to the process no
+  longer throws an exception.
+* `RLMArray` now exposes an `isInvalidated` property to indicate if it can no
+  longer be accessed.
+
+### Bugfixes
+
+* An exception will now be thrown when calling `-beginWriteTransaction` from within a notification
+  triggered by calling `-beginWriteTransaction` elsewhere.
+* When calling `delete:` we now verify that the object being deleted is persisted in the target Realm.
+* Fix crash when calling `createOrUpdate:inRealm` with nested linked objects.
+* Use the key from `+[RLMRealm setEncryptionKey:forRealmsAtPath:]` in
+  `-writeCopyToPath:error:` and `+migrateRealmAtPath:`.
+* Comparing an RLMObject to a non-RLMObject using `-[RLMObject isEqual:]` or
+  `-isEqualToObject:` now returns NO instead of crashing.
+* Improved error message when an `RLMObject` subclass is defined nested within
+  another Swift declaration.
+* Fix crash when the process is terminated by the OS on iOS while encrypted realms are open.
+* Fix crash after large commits to encrypted realms.
+
+0.90.6 Release notes (2015-02-20)
+=============================================================
+
+### Enhancements
+
+* Improve compatiblity of encrypted Realms with third-party crash reporters.
+
+### Bugfixes
+
+* Fix incorrect results when using aggregate functions on sorted RLMResults.
+* Fix data corruption when using writeCopyToPath:encryptionKey:.
+* Maybe fix some assertion failures.
+
+0.90.5 Release notes (2015-02-04)
+=============================================================
+
+### Bugfixes
+
+* Fix for crashes when encryption is enabled on 64-bit iOS devices.
+
+0.90.4 Release notes (2015-01-29)
+=============================================================
+
+### Bugfixes
+
+* Fix bug that resulted in columns being dropped and recreated during migrations.
+
+0.90.3 Release notes (2015-01-27)
+=============================================================
+
+### Enhancements
+
+* Calling `createInDefaultRealmWithObject:`, `createInRealm:withObject:`,
+  `createOrUpdateInDefaultRealmWithObject:` or `createOrUpdateInRealm:withObject:`
+  is a no-op if the argument is an RLMObject of the same type as the receiver
+  and is already backed by the target realm.
+
+### Bugfixes
+
+* Fix incorrect column type assertions when the first Realm file opened is a
+  read-only file that is missing tables.
+* Throw an exception when adding an invalidated or deleted object as a link.
+* Throw an exception when calling `createOrUpdateInRealm:withObject:` when the
+  receiver has no primary key defined.
+
+0.90.1 Release notes (2015-01-22)
+=============================================================
+
+### Bugfixes
+
+* Fix for RLMObject being treated as a model object class and showing up in the browser.
+* Fix compilation from the podspec.
+* Fix for crash when calling `objectsWhere:` with grouping in the query on `allObjects`.
+
+0.90.0 Release notes (2015-01-21)
+=============================================================
+
+### API breaking changes
+
+* Rename `-[RLMRealm encryptedRealmWithPath:key:readOnly:error:]` to
+  `-[RLMRealm realmWithPath:encryptionKey:readOnly:error:]`.
+* `-[RLMRealm setSchemaVersion:withMigrationBlock]` is no longer global and must be called
+  for each individual Realm path used. You can now call `-[RLMRealm setDefaultRealmSchemaVersion:withMigrationBlock]`
+  for the default Realm and `-[RLMRealm setSchemaVersion:forRealmAtPath:withMigrationBlock:]` for all others;
+
+### Enhancements
+
+* Add `-[RLMRealm writeCopyToPath:encryptionKey:error:]`.
+* Add support for comparing string columns to other string columns in queries.
+
+### Bugfixes
+
+* Roll back changes made when an exception is thrown during a migration.
+* Throw an exception if the number of items in a RLMResults or RLMArray changes
+  while it's being fast-enumerated.
+* Also encrypt the temporary files used when encryption is enabled for a Realm.
+* Fixed crash in JSONImport example on OS X with non-en_US locale.
+* Fixed infinite loop when opening a Realm file in the Browser at the same time
+  as it is open in a 32-bit simulator.
+* Fixed a crash when adding primary keys to older realm files with no primary
+  keys on any objects.
+* Fixed a crash when removing a primary key in a migration.
+* Fixed a crash when multiple write transactions with no changes followed by a
+  write transaction with changes were committed without the main thread
+  RLMRealm getting a chance to refresh.
+* Fixed incomplete results when querying for non-null relationships.
+* Improve the error message when a Realm file is opened in multiple processes
+  at once.
+
+0.89.2 Release notes (2015-01-02)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix an assertion failure when invalidating a Realm which is in a write
+  transaction, has already been invalidated, or has never been used.
+* Fix an assertion failure when sorting an empty RLMArray property.
+* Fix a bug resulting in the browser never becoming visible on 10.9.
+* Write UTF-8 when generating class files from a realm file in the Browser.
+
+0.89.1 Release notes (2014-12-22)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Improve the error message when a Realm can't be opened due to lacking write
+  permissions.
+
+### Bugfixes
+
+* Fix an assertion failure when inserting rows after calling `deleteAllObjects`
+  on a Realm.
+* Separate dynamic frameworks are now built for the simulator and devices to
+  work around App Store submission errors due to the simulator version not
+  being automatically stripped from dynamic libraries.
+
+0.89.0 Release notes (2014-12-18)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Add support for encrypting Realm files on disk.
+* Support using KVC-compliant objects without getters or with custom getter
+  names to initialize RLMObjects with `createObjectInRealm` and friends.
+
+### Bugfixes
+
+* Merge native Swift default property values with defaultPropertyValues().
+* Don't leave the database schema partially updated when opening a realm fails
+  due to a migration being needed.
+* Fixed issue where objects with custom getter names couldn't be used to
+  initialize other objects.
+* Fix a major performance regression on queries on string properties.
+* Fix a memory leak when circularly linked objects are added to a Realm.
+
+0.88.0 Release notes (2014-12-02)
+=============================================================
+
+### API breaking changes
+
+* Deallocating an RLMRealm instance in a write transaction lacking an explicit
+  commit/cancel will now be automatically cancelled instead of committed.
+* `-[RLMObject isDeletedFromRealm]` has been renamed to `-[RLMObject isInvalidated]`.
+
+### Enhancements
+
+* Add `-[RLMRealm writeCopyToPath:]` to write a compacted copy of the Realm
+  another file.
+* Add support for case insensitive, BEGINSWITH, ENDSWITH and CONTAINS string
+  queries on array properties.
+* Make fast enumeration of `RLMArray` and `RLMResults` ~30% faster and
+  `objectAtIndex:` ~55% faster.
+* Added a lldb visualizer script for displaying the contents of persisted
+  RLMObjects when debugging.
+* Added method `-setDefaultRealmPath:` to change the default Realm path.
+* Add `-[RLMRealm invalidate]` to release data locked by the current thread.
+
+### Bugfixes
+
+* Fix for crash when running many simultaneous write transactions on background threads.
+* Fix for crashes caused by opening Realms at multiple paths simultaneously which have had
+  properties re-ordered during migration.
+* Don't run the query twice when `firstObject` or `lastObject` are called on an
+  `RLMResults` which has not had its results accessed already.
+* Fix for bug where schema version is 0 for new Realm created at the latest version.
+* Fix for error message where no migration block is specified when required.
+
+0.87.4 Release notes (2014-11-07)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* Fix browser location in release zip.
+
+0.87.3 Release notes (2014-11-06)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Added method `-linkingObjectsOfClass:forProperty:` to RLMObject to expose inverse
+  relationships/backlinks.
+
+### Bugfixes
+
+* Fix for crash due to missing search index when migrating an object with a string primary key
+  in a database created using an older versions (0.86.3 and earlier).
+* Throw an exception when passing an array containing a
+  non-RLMObject to -[RLMRealm addObjects:].
+* Fix for crash when deleting an object from multiple threads.
+
+0.87.0 Release notes (2014-10-21)
+=============================================================
+
+### API breaking changes
+
+* RLMArray has been split into two classes, `RLMArray` and `RLMResults`. RLMArray is
+  used for object properties as in previous releases. Moving forward all methods used to
+  enumerate, query, and sort objects return an instance of a new class `RLMResults`. This
+  change was made to support diverging apis and the future addition of change notifications
+  for queries.
+* The api for migrations has changed. You now call `setSchemaVersion:withMigrationBlock:` to
+  register a global migration block and associated version. This block is applied to Realms as
+  needed when opened for Realms at a previous version. The block can be applied manually if
+  desired by calling `migrateRealmAtPath:`.
+* `arraySortedByProperty:ascending:` was renamed to `sortedResultsUsingProperty:ascending`
+* `addObjectsFromArray:` on both `RLMRealm` and `RLMArray` has been renamed to `addObjects:`
+  and now accepts any container class which implements `NSFastEnumeration`
+* Building with Swift support now requires Xcode 6.1
+
+### Enhancements
+
+* Add support for sorting `RLMArray`s by multiple columns with `sortedResultsUsingDescriptors:`
+* Added method `deleteAllObjects` on `RLMRealm` to clear a Realm.
+* Added method `createObject:withObject:` on `RLMMigration` which allows object creation during migrations.
+* Added method `deleteObject:` on `RLMMigration` which allows object deletion during migrations.
+* Updating to core library version 0.85.0.
+* Implement `objectsWhere:` and `objectsWithPredicate:` for array properties.
+* Add `cancelWriteTransaction` to revert all changes made in a write transaction and end the transaction.
+* Make creating `RLMRealm` instances on background threads when an instance
+  exists on another thread take a fifth of the time.
+* Support for partial updates when calling `createOrUpdateWithObject:` and `addOrUpdateObject:`
+* Re-enable Swift support on OS X
+
+### Bugfixes
+
+* Fix exceptions when trying to set `RLMObject` properties after rearranging
+  the properties in a `RLMObject` subclass.
+* Fix crash on IN query with several thousand items.
+* Fix crash when querying indexed `NSString` properties.
+* Fixed an issue which prevented in-memory Realms from being used accross multiple threads.
+* Preserve the sort order when querying a sorted `RLMResults`.
+* Fixed an issue with migrations where if a Realm file is deleted after a Realm is initialized,
+  the newly created Realm can be initialized with an incorrect schema version.
+* Fix crash in `RLMSuperSet` when assigning to a `RLMArray` property on a standalone object.
+* Add an error message when the protocol for an `RLMArray` property is not a
+  valid object type.
+* Add an error message when an `RLMObject` subclass is defined nested within
+  another Swift class.
+
+0.86.3 Release notes (2014-10-09)
+=============================================================
+
+### Enhancements
+
+* Add support for != in queries on object relationships.
+
+### Bugfixes
+
+* Re-adding an object to its Realm no longer throws an exception and is now a no-op
+  (as it was previously).
+* Fix another bug which would sometimes result in subclassing RLMObject
+  subclasses not working.
+
+0.86.2 Release notes (2014-10-06)
+=============================================================
+
+### Bugfixes
+
+* Fixed issues with packaging "Realm Browser.app" for release.
+
+0.86.1 Release notes (2014-10-03)
+=============================================================
+
+### Bugfixes
+
+* Fix a bug which would sometimes result in subclassing RLMObject subclasses
+  not working.
+
+0.86.0 Release notes (2014-10-03)
+=============================================================
+
+### API breaking changes
+
+* Xcode 6 is now supported from the main Xcode project `Realm.xcodeproj`.
+  Xcode 5 is no longer supported.
+
+### Enhancements
+
+* Support subclassing RLMObject models. Although you can now persist subclasses,
+  polymorphic behavior is not supported (i.e. setting a property to an
+  instance of its subclass).
+* Add support for sorting RLMArray properties.
+* Speed up inserting objects with `addObject:` by ~20%.
+* `readonly` properties are automatically ignored rather than having to be
+  added to `ignoredProperties`.
+* Updating to core library version 0.83.1.
+* Return "[deleted object]" rather than throwing an exception when
+  `-description` is called on a deleted RLMObject.
+* Significantly improve performance of very large queries.
+* Allow passing any enumerable to IN clauses rather than just NSArray.
+* Add `objectForPrimaryKey:` and `objectInRealm:forPrimaryKey:` convenience
+  methods to fetch an object by primary key.
+
+### Bugfixes
+
+* Fix error about not being able to persist property 'hash' with incompatible
+  type when building for devices with Xcode 6.
+* Fix spurious notifications of new versions of Realm.
+* Fix for updating nested objects where some types do not have primary keys.
+* Fix for inserting objects from JSON with NSNull values when default values
+  should be used.
+* Trying to add a persisted RLMObject to a different Realm now throws an
+  exception rather than creating an uninitialized object.
+* Fix validation errors when using IN on array properties.
+* Fix errors when an IN clause has zero items.
+* Fix for chained queries ignoring all but the last query's conditions.
+
+0.85.0 Release notes (2014-09-15)
+=============================================================
+
+### API breaking changes
+
+* Notifications for a refresh being needed (when autorefresh is off) now send
+  the notification type RLMRealmRefreshRequiredNotification rather than
+  RLMRealmDidChangeNotification.
+
+### Enhancements
+
+* Updating to core library version 0.83.0.
+* Support for primary key properties (for int and string columns). Declaring a property
+  to be the primary key ensures uniqueness for that property for all objects of a given type.
+  At the moment indexes on primary keys are not yet supported but this will be added in a future
+  release.
+* Added methods to update or insert (upsert) for objects with primary keys defined.
+* `[RLMObject initWithObject:]` and `[RLMObject createInRealmWithObject:]` now support
+  any object type with kvc properties.
+* The Swift support has been reworked to work around Swift not being supported
+  in Frameworks on iOS 7.
+* Improve performance when getting the count of items matching a query but not
+  reading any of the objects in the results.
+* Add a return value to `-[RLMRealm refresh]` that indicates whether or not
+  there was anything to refresh.
+* Add the class name to the error message when an RLMObject is missing a value
+  for a property without a default.
+* Add support for opening Realms in read-only mode.
+* Add an automatic check for updates when using Realm in a simulator (the
+  checker code is not compiled into device builds). This can be disabled by
+  setting the REALM_DISABLE_UPDATE_CHECKER environment variable to any value.
+* Add support for Int16 and Int64 properties in Swift classes.
+
+### Bugfixes
+
+* Realm change notifications when beginning a write transaction are now sent
+  after updating rather than before, to match refresh.
+* `-isEqual:` now uses the default `NSObject` implementation unless a primary key
+  is specified for an RLMObject. When a primary key is specified, `-isEqual:` calls
+  `-isEqualToObject:` and a corresponding implementation for `-hash` is also implemented.
+
+0.84.0 Release notes (2014-08-28)
+=============================================================
+
+### API breaking changes
+
+* The timer used to trigger notifications has been removed. Notifications are now
+  only triggered by commits made in other threads, and can not currently be triggered
+  by changes made by other processes. Interprocess notifications will be re-added in
+  a future commit with an improved design.
+
+### Enhancements
+
+* Updating to core library version 0.82.2.
+* Add property `deletedFromRealm` to RLMObject to indicate objects which have been deleted.
+* Add support for the IN operator in predicates.
+* Add support for the BETWEEN operator in link queries.
+* Add support for multi-level link queries in predicates (e.g. `foo.bar.baz = 5`).
+* Switch to building the SDK from source when using CocoaPods and add a
+  Realm.Headers subspec for use in targets that should not link a copy of Realm
+  (such as test targets).
+* Allow unregistering from change notifications in the change notification
+  handler block.
+* Significant performance improvements when holding onto large numbers of RLMObjects.
+* Realm-Xcode6.xcodeproj now only builds using Xcode6-Beta6.
+* Improved performance during RLMArray iteration, especially when mutating
+  contained objects.
+
+### Bugfixes
+
+* Fix crashes and assorted bugs when sorting or querying a RLMArray returned
+  from a query.
+* Notifications are no longer sent when initializing new RLMRealm instances on background
+  threads.
+* Handle object cycles in -[RLMObject description] and -[RLMArray description].
+* Lowered the deployment target for the Xcode 6 projects and Swift examples to
+  iOS 7.0, as they didn't actually require 8.0.
+* Support setting model properties starting with the letter 'z'
+* Fixed crashes that could result from switching between Debug and Relase
+  builds of Realm.
+
+0.83.0 Release notes (2014-08-13)
+=============================================================
+
+### API breaking changes
+
+* Realm-Xcode6.xcodeproj now only builds using Xcode6-Beta5.
+* Properties to be persisted in Swift classes must be explicitly declared as `dynamic`.
+* Subclasses of RLMObject subclasses now throw an exception on startup, rather
+  than when added to a Realm.
+
+### Enhancements
+
+* Add support for querying for nil object properties.
+* Improve error message when specifying invalid literals when creating or
+  initializing RLMObjects.
+* Throw an exception when an RLMObject is used from the incorrect thread rather
+  than crashing in confusing ways.
+* Speed up RLMRealm instantiation and array property iteration.
+* Allow array and objection relation properties to be missing or null when
+  creating a RLMObject from a NSDictionary.
+
+### Bugfixes
+
+* Fixed a memory leak when querying for objects.
+* Fixed initializing array properties on standalone Swift RLMObject subclasses.
+* Fix for queries on 64bit integers.
+
+0.82.0 Release notes (2014-08-05)
+=============================================================
+
+### API breaking changes
+
+* Realm-Xcode6.xcodeproj now only builds using Xcode6-Beta4.
+
+### Enhancements
+
+* Updating to core library version 0.80.5.
+* Now support disabling the `autorefresh` property on RLMRealm instances.
+* Building Realm-Xcode6 for iOS now builds a universal framework for Simulator & Device.
+* Using NSNumber properties (unsupported) now throws a more informative exception.
+* Added `[RLMRealm defaultRealmPath]`
+* Proper implementation for [RLMArray indexOfObjectWhere:]
+* The default Realm path on OS X is now ~/Library/Application Support/[bundle
+  identifier]/default.realm rather than ~/Documents
+* We now check that the correct framework (ios or osx) is used at compile time.
+
+### Bugfixes
+
+* Fixed rapid growth of the realm file size.
+* Fixed a bug which could cause a crash during RLMArray destruction after a query.
+* Fixed bug related to querying on float properties: `floatProperty = 1.7` now works.
+* Fixed potential bug related to the handling of array properties (RLMArray).
+* Fixed bug where array properties accessed the wrong property.
+* Fixed bug that prevented objects with custom getters to be added to a Realm.
+* Fixed a bug where initializing a standalone object with an array literal would
+  trigger an exception.
+* Clarified exception messages when using unsupported NSPredicate operators.
+* Clarified exception messages when using unsupported property types on RLMObject subclasses.
+* Fixed a memory leak when breaking out of a for-in loop on RLMArray.
+* Fixed a memory leak when removing objects from a RLMArray property.
+* Fixed a memory leak when querying for objects.
+
+
+0.81.0 Release notes (2014-07-22)
+=============================================================
+
+### API breaking changes
+
+* None.
+
+### Enhancements
+
+* Updating to core library version 0.80.3.
+* Added support for basic querying of RLMObject and RLMArray properties (one-to-one and one-to-many relationships).
+  e.g. `[Person objectsWhere:@"dog.name == 'Alfonso'"]` or `[Person objectsWhere:@"ANY dogs.name == 'Alfonso'"]`
+  Supports all normal operators for numeric and date types. Does not support NSData properties or `BEGINSWITH`, `ENDSWITH`, `CONTAINS`
+  and other options for string properties.
+* Added support for querying for object equality in RLMObject and RLMArray properties (one-to-one and one-to-many relationships).
+  e.g. `[Person objectsWhere:@"dog == %@", myDog]` `[Person objectsWhere:@"ANY dogs == %@", myDog]` `[Person objectsWhere:@"ANY friends.dog == %@", dog]`
+  Only supports comparing objects for equality (i.e. ==)
+* Added a helper method to RLMRealm to perform a block inside a transaction.
+* OSX framework now supported in CocoaPods.
+
+### Bugfixes
+
+* Fixed Unicode support in property names and string contents (Chinese, Russian, etc.). Closing #612 and #604.
+* Fixed bugs related to migration when properties are removed.
+* Fixed keyed subscripting for standalone RLMObjects.
+* Fixed bug related to double clicking on a .realm file to launch the Realm Browser (thanks to Dean Moore).
+
+
+0.80.0 Release notes (2014-07-15)
+=============================================================
+
+### API breaking changes
+
+* Rename migration methods to -migrateDefaultRealmWithBlock: and -migrateRealmAtPath:withBlock:
+* Moved Realm specific query methods from RLMRealm to class methods on RLMObject (-allObjects: to +allObjectsInRealm: ect.)
+
+### Enhancements
+
+* Added +createInDefaultRealmWithObject: method to RLMObject.
+* Added support for array and object literals when calling -createWithObject: and -initWithObject: variants.
+* Added method -deleteObjects: to batch delete objects from a Realm
+* Support for defining RLMObject models entirely in Swift (experimental, see known issues).
+* RLMArrays in Swift support Sequence-style enumeration (for obj in array).
+* Implemented -indexOfObject: for RLMArray
+
+### Known Issues for Swift-defined models
+
+* Properties other than String, NSData and NSDate require a default value in the model. This can be an empty (but typed) array for array properties.
+* The previous caveat also implies that not all models defined in Objective-C can be used for object properties. Only Objective-C models with only implicit (i.e. primitives) or explicit default values can be used. However, any Objective-C model object can be used in a Swift array property.
+* Array property accessors don't work until its parent object has been added to a realm.
+* Realm-Bridging-Header.h is temporarily exposed as a public header. This is temporary and will be private again once rdar://17633863 is fixed.
+* Does not leverage Swift generics and still uses RLM-prefix everywhere. This is coming in #549.
+
+
+0.22.0 Release notes
+=============================================================
+
+### API breaking changes
+
+* Rename schemaForObject: to schemaForClassName: on RLMSchema
+* Removed -objects:where: and -objects:orderedBy:where: from RLMRealm
+* Removed -indexOfObjectWhere:, -objectsWhere: and -objectsOrderedBy:where: from RLMArray
+* Removed +objectsWhere: and +objectsOrderedBy:where: from RLMObject
+
+### Enhancements
+
+* New Xcode 6 project for experimental swift support.
+* New Realm Editor app for reading and editing Realm db files.
+* Added support for migrations.
+* Added support for RLMArray properties on objects.
+* Added support for creating in-memory default Realm.
+* Added -objectsWithClassName:predicateFormat: and -objectsWithClassName:predicate: to RLMRealm
+* Added -indexOfObjectWithPredicateFormat:, -indexOfObjectWithPredicate:, -objectsWithPredicateFormat:, -objectsWithPredi
+* Added +objectsWithPredicateFormat: and +objectsWithPredicate: to RLMObject
+* Now allows predicates comparing two object properties of the same type.
+
+
+0.20.0 Release notes (2014-05-28)
+=============================================================
+
+Completely rewritten to be much more object oriented.
+
+### API breaking changes
+
+* Everything
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* None.
+
+
+0.11.0 Release notes (not released)
+=============================================================
+
+The Objective-C API has been updated and your code will break!
+
+### API breaking changes
+
+* `RLMTable` objects can only be created with an `RLMRealm` object.
+* Renamed `RLMContext` to `RLMTransactionManager`
+* Renamed `RLMContextDidChangeNotification` to `RLMRealmDidChangeNotification`
+* Renamed `contextWithDefaultPersistence` to `managerForDefaultRealm`
+* Renamed `contextPersistedAtPath:` to `managerForRealmWithPath:`
+* Renamed `realmWithDefaultPersistence` to `defaultRealm`
+* Renamed `realmWithDefaultPersistenceAndInitBlock` to `defaultRealmWithInitBlock`
+* Renamed `find:` to `firstWhere:`
+* Renamed `where:` to `allWhere:`
+* Renamed `where:orderBy:` to `allWhere:orderBy:`
+
+### Enhancements
+
+* Added `countWhere:` on `RLMTable`
+* Added `sumOfColumn:where:` on `RLMTable`
+* Added `averageOfColumn:where:` on `RLMTable`
+* Added `minOfProperty:where:` on `RLMTable`
+* Added `maxOfProperty:where:` on `RLMTable`
+* Added `toJSONString` on `RLMRealm`, `RLMTable` and `RLMView`
+* Added support for `NOT` operator in predicates
+* Added support for default values
+* Added validation support in `createInRealm:withObject:`
+
+### Bugfixes
+
+* None.
+
+
+0.10.0 Release notes (2014-04-23)
+=============================================================
+
+TightDB is now Realm! The Objective-C API has been updated
+and your code will break!
+
+### API breaking changes
+
+* All references to TightDB have been changed to Realm.
+* All prefixes changed from `TDB` to `RLM`.
+* `TDBTransaction` and `TDBSmartContext` have merged into `RLMRealm`.
+* Write transactions now take an optional rollback parameter (rather than needing to return a boolean).
+* `addColumnWithName:` and variant methods now return the index of the newly created column if successful, `NSNotFound` otherwise.
+
+### Enhancements
+
+* `createTableWithName:columns:` has been added to `RLMRealm`.
+* Added keyed subscripting for RLMTable's first column if column is of type RLMPropertyTypeString.
+* `setRow:atIndex:` has been added to `RLMTable`.
+* `RLMRealm` constructors now have variants that take an writable initialization block
+* New object interface - tables created/retrieved using `tableWithName:objectClass:` return custom objects
+
+### Bugfixes
+
+* None.
+
+
+0.6.0 Release notes (2014-04-11)
+=============================================================
+
+### API breaking changes
+
+* `contextWithPersistenceToFile:error:` renamed to `contextPersistedAtPath:error:` in `TDBContext`
+* `readWithBlock:` renamed to `readUsingBlock:` in `TDBContext`
+* `writeWithBlock:error:` renamed to `writeUsingBlock:error:` in `TDBContext`
+* `readTable:withBlock:` renamed to `readTable:usingBlock:` in `TDBContext`
+* `writeTable:withBlock:error:` renamed to `writeTable:usingBlock:error:` in `TDBContext`
+* `findFirstRow` renamed to `indexOfFirstMatchingRow` on `TDBQuery`.
+* `findFirstRowFromIndex:` renamed to `indexOfFirstMatchingRowFromIndex:` on `TDBQuery`.
+* Return `NSNotFound` instead of -1 when appropriate.
+* Renamed `castClass` to `castToTytpedTableClass` on `TDBTable`.
+* `removeAllRows`, `removeRowAtIndex`, `removeLastRow`, `addRow` and `insertRow` methods
+  on table now return void instead of BOOL.
+
+### Enhancements
+* A `TDBTable` can now be queried using `where:` and `where:orderBy:` taking
+  `NSPredicate` and `NSSortDescriptor` as arguments.
+* Added `find:` method on `TDBTable` to find first row matching predicate.
+* `contextWithDefaultPersistence` class method added to `TDBContext`. Will create a context persisted
+  to a file in app/documents folder.
+* `renameColumnWithIndex:to:` has been added to `TDBTable`.
+* `distinctValuesInColumnWithIndex` has been added to `TDBTable`.
+* `dateIsBetween::`, `doubleIsBetween::`, `floatIsBetween::` and `intIsBetween::`
+  have been added to `TDBQuery`.
+* Column names in Typed Tables can begin with non-capital letters too. The generated `addX`
+  selector can look odd. For example, a table with one column with name `age`,
+  appending a new row will look like `[table addage:7]`.
+* Mixed typed values are better validated when rows are added, inserted,
+  or modified as object literals.
+* `addRow`, `insertRow`, and row updates can be done using objects
+   derived from `NSObject`.
+* `where` has been added to `TDBView`and `TDBViewProtocol`.
+* Adding support for "smart" contexts (`TDBSmartContext`).
+
+### Bugfixes
+
+* Modifications of a `TDBView` and `TDBQuery` now throw an exception in a readtransaction.
+
+
+0.5.0 Release notes (2014-04-02)
+=============================================================
+
+The Objective-C API has been updated and your code will break!
+Of notable changes a fast interface has been added.
+This interface includes specific methods to get and set values into Tightdb.
+To use these methods import `<Tightdb/TightdbFast.h>`.
+
+### API breaking changes
+
+* `getTableWithName:` renamed to `tableWithName:` in `TDBTransaction`.
+* `addColumnWithName:andType:` renamed to `addColumnWithName:type:` in `TDBTable`.
+* `columnTypeOfColumn:` renamed to `columnTypeOfColumnWithIndex` in `TDBTable`.
+* `columnNameOfColumn:` renamed to `nameOfColumnWithIndex:` in `TDBTable`.
+* `addColumnWithName:andType:` renamed to `addColumnWithName:type:` in `TDBDescriptor`.
+* Fast getters and setters moved from `TDBRow.h` to `TDBRowFast.h`.
+
+### Enhancements
+
+* Added `minDateInColumnWithIndex` and `maxDateInColumnWithIndex` to `TDBQuery`.
+* Transactions can now be started directly on named tables.
+* You can create dynamic tables with initial schema.
+* `TDBTable` and `TDBView` now have a shared protocol so they can easier be used interchangeably.
+
+### Bugfixes
+
+* Fixed bug in 64 bit iOS when inserting BOOL as NSNumber.
+
+
+0.4.0 Release notes (2014-03-26)
+=============================================================
+
+### API breaking changes
+
+* Typed interface Cursor has now been renamed to Row.
+* TDBGroup has been renamed to TDBTransaction.
+* Header files are renamed so names match class names.
+* Underscore (_) removed from generated typed table classes.
+* TDBBinary has been removed; use NSData instead.
+* Underscope (_) removed from generated typed table classes.
+* Constructor for TDBContext has been renamed to contextWithPersistenceToFile:
+* Table findFirstRow and min/max/sum/avg operations has been hidden.
+* Table.appendRow has been renamed to addRow.
+* getOrCreateTable on Transaction has been removed.
+* set*:inColumnWithIndex:atRowIndex: methods have been prefixed with TDB
+* *:inColumnWithIndex:atRowIndex: methods have been prefixed with TDB
+* addEmptyRow on table has been removed. Use [table addRow:nil] instead.
+* TDBMixed removed. Use id and NSObject instead.
+* insertEmptyRow has been removed from table. Use insertRow:nil atIndex:index instead.
+
+#### Enhancements
+
+* Added firstRow, lastRow selectors on view.
+* firstRow and lastRow on table now return nil if table is empty.
+* getTableWithName selector added on group.
+* getting and creating table methods on group no longer take error argument.
+* [TDBQuery parent] and [TDBQuery subtable:] selectors now return self.
+* createTable method added on Transaction. Throws exception if table with same name already exists.
+* Experimental support for pinning transactions on Context.
+* TDBView now has support for object subscripting.
+
+### Bugfixes
+
+* None.
+
+
+0.3.0 Release notes (2014-03-14)
+=============================================================
+
+The Objective-C API has been updated and your code will break!
+
+### API breaking changes
+
+* Most selectors have been renamed in the binding!
+* Prepend TDB-prefix on all classes and types.
+
+### Enhancements
+
+* Return types and parameters changed from size_t to NSUInteger.
+* Adding setObject to TightdbTable (t[2] = @[@1, @"Hello"] is possible).
+* Adding insertRow to TightdbTable.
+* Extending appendRow to accept NSDictionary.
+
+### Bugfixes
+
+* None.
+
+
+0.2.0 Release notes (2014-03-07)
+=============================================================
+
+The Objective-C API has been updated and your code will break!
+
+### API breaking changes
+
+* addRow renamed to addEmptyRow
+
+### Enhancements
+
+* Adding a simple class for version numbering.
+* Adding get-version and set-version targets to build.sh.
+* tableview now supports sort on column with column type bool, date and int
+* tableview has method for checking the column type of a specified column
+* tableview has method for getting the number of columns
+* Adding methods getVersion, getCoreVersion and isAtLeast.
+* Adding appendRow to TightdbTable.
+* Adding object subscripting.
+* Adding method removeColumn on table.
+
+### Bugfixes
+
+* None.

+ 43 - 0
Libraries external/Realm/Realm.framework/Headers/NSError+RLMSync.h

@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2017 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// NSError category extension providing methods to get data out of Realm's
+/// "client reset" error.
+@interface NSError (RLMSync)
+
+/**
+ Given a Realm Object Server client reset error, return the block that can
+ be called to manually initiate the client reset process, or nil if the
+ error isn't a client reset error.
+ */
+- (nullable void(^)(void))rlmSync_clientResetBlock NS_REFINED_FOR_SWIFT;
+
+/**
+ Given a Realm Object Server client reset error, return the path where the
+ backup copy of the Realm will be placed once the client reset process is
+ complete.
+ */
+- (nullable NSString *)rlmSync_clientResetBackedUpRealmPath NS_SWIFT_UNAVAILABLE("");
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 439 - 0
Libraries external/Realm/Realm.framework/Headers/RLMArray.h

@@ -0,0 +1,439 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+#import <Realm/RLMCollection.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMObject, RLMRealm, RLMResults<RLMObjectType: RLMObject *>, RLMNotificationToken;
+
+/**
+ `RLMArray` is the container type in Realm used to define to-many relationships.
+
+ Unlike an `NSArray`, `RLMArray`s hold a single type, specified by the `objectClassName` property.
+ This is referred to in these docs as the “type” of the array.
+
+ When declaring an `RLMArray` property, the type must be marked as conforming to a
+ protocol by the same name as the objects it should contain (see the
+ `RLM_ARRAY_TYPE` macro). In addition, the property can be declared using Objective-C
+ generics for better compile-time type safety.
+
+     RLM_ARRAY_TYPE(ObjectType)
+     ...
+     @property RLMArray<ObjectType *><ObjectType> *arrayOfObjectTypes;
+
+ `RLMArray`s can be queried with the same predicates as `RLMObject` and `RLMResult`s.
+
+ `RLMArray`s cannot be created directly. `RLMArray` properties on `RLMObject`s are
+ lazily created when accessed, or can be obtained by querying a Realm.
+
+ ### Key-Value Observing
+
+ `RLMArray` supports array key-value observing on `RLMArray` properties on `RLMObject`
+ subclasses, and the `invalidated` property on `RLMArray` instances themselves is
+ key-value observing compliant when the `RLMArray` is attached to a managed
+ `RLMObject` (`RLMArray`s on unmanaged `RLMObject`s will never become invalidated).
+
+ Because `RLMArray`s are attached to the object which they are a property of, they
+ do not require using the mutable collection proxy objects from
+ `-mutableArrayValueForKey:` or KVC-compatible mutation methods on the containing
+ object. Instead, you can call the mutation methods on the `RLMArray` directly.
+ */
+
+@interface RLMArray<RLMObjectType: RLMObject *> : NSObject<RLMCollection, NSFastEnumeration>
+
+#pragma mark - Properties
+
+/**
+ The number of objects in the array.
+ */
+@property (nonatomic, readonly, assign) NSUInteger count;
+
+/**
+ The class name (i.e. type) of the `RLMObject`s contained in the array.
+ */
+@property (nonatomic, readonly, copy) NSString *objectClassName;
+
+/**
+ The Realm which manages the array. Returns `nil` for unmanaged arrays.
+ */
+@property (nonatomic, readonly, nullable) RLMRealm *realm;
+
+/**
+ Indicates if the array can no longer be accessed.
+ */
+@property (nonatomic, readonly, getter = isInvalidated) BOOL invalidated;
+
+#pragma mark - Accessing Objects from an Array
+
+/**
+ Returns the object at the index specified.
+
+ @param index   The index to look up.
+
+ @return An `RLMObject` of the type contained in the array.
+ */
+- (RLMObjectType)objectAtIndex:(NSUInteger)index;
+
+/**
+ Returns the first object in the array.
+
+ Returns `nil` if called on an empty array.
+
+ @return An `RLMObject` of the type contained in the array.
+ */
+- (nullable RLMObjectType)firstObject;
+
+/**
+ Returns the last object in the array.
+
+ Returns `nil` if called on an empty array.
+
+ @return An `RLMObject` of the type contained in the array.
+ */
+- (nullable RLMObjectType)lastObject;
+
+
+
+#pragma mark - Adding, Removing, and Replacing Objects in an Array
+
+/**
+ Adds an object to the end of the array.
+
+ @warning This method may only be called during a write transaction.
+
+ @param object  An `RLMObject` of the type contained in the array.
+ */
+- (void)addObject:(RLMObjectType)object;
+
+/**
+ Adds an array of objects to the end of the array.
+
+ @warning This method may only be called during a write transaction.
+
+ @param objects     An enumerable object such as `NSArray` or `RLMResults` which contains objects of the
+                    same class as the array.
+ */
+- (void)addObjects:(id<NSFastEnumeration>)objects;
+
+/**
+ Inserts an object at the given index.
+
+ Throws an exception if the index exceeds the bounds of the array.
+
+ @warning This method may only be called during a write transaction.
+
+ @param anObject  An `RLMObject` of the type contained in the array.
+ @param index   The index at which to insert the object.
+ */
+- (void)insertObject:(RLMObjectType)anObject atIndex:(NSUInteger)index;
+
+/**
+ Removes an object at the given index.
+
+ Throws an exception if the index exceeds the bounds of the array.
+
+ @warning This method may only be called during a write transaction.
+
+ @param index   The array index identifying the object to be removed.
+ */
+- (void)removeObjectAtIndex:(NSUInteger)index;
+
+/**
+ Removes the last object in the array.
+
+ @warning This method may only be called during a write transaction.
+*/
+- (void)removeLastObject;
+
+/**
+ Removes all objects from the array.
+
+ @warning This method may only be called during a write transaction.
+ */
+- (void)removeAllObjects;
+
+/**
+ Replaces an object at the given index with a new object.
+
+ Throws an exception if the index exceeds the bounds of the array.
+
+ @warning This method may only be called during a write transaction.
+
+ @param index       The index of the object to be replaced.
+ @param anObject    An object (of the same type as returned from the `objectClassName` selector).
+ */
+- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(RLMObjectType)anObject;
+
+/**
+ Moves the object at the given source index to the given destination index.
+
+ Throws an exception if the index exceeds the bounds of the array.
+
+ @warning This method may only be called during a write transaction.
+
+ @param sourceIndex      The index of the object to be moved.
+ @param destinationIndex The index to which the object at `sourceIndex` should be moved.
+ */
+- (void)moveObjectAtIndex:(NSUInteger)sourceIndex toIndex:(NSUInteger)destinationIndex;
+
+/**
+ Exchanges the objects in the array at given indices.
+
+ Throws an exception if either index exceeds the bounds of the array.
+
+ @warning This method may only be called during a write transaction.
+
+ @param index1 The index of the object which should replace the object at index `index2`.
+ @param index2 The index of the object which should replace the object at index `index1`.
+ */
+- (void)exchangeObjectAtIndex:(NSUInteger)index1 withObjectAtIndex:(NSUInteger)index2;
+
+#pragma mark - Querying an Array
+
+/**
+ Returns the index of an object in the array.
+
+ Returns `NSNotFound` if the object is not found in the array.
+
+ @param object  An object (of the same type as returned from the `objectClassName` selector).
+ */
+- (NSUInteger)indexOfObject:(RLMObjectType)object;
+
+/**
+ Returns the index of the first object in the array matching the predicate.
+
+ @param predicateFormat A predicate format string, optionally followed by a variable number of arguments.
+
+ @return    The index of the object, or `NSNotFound` if the object is not found in the array.
+ */
+- (NSUInteger)indexOfObjectWhere:(NSString *)predicateFormat, ...;
+
+/// :nodoc:
+- (NSUInteger)indexOfObjectWhere:(NSString *)predicateFormat args:(va_list)args;
+
+/**
+ Returns the index of the first object in the array matching the predicate.
+
+ @param predicate   The predicate with which to filter the objects.
+
+ @return    The index of the object, or `NSNotFound` if the object is not found in the array.
+ */
+- (NSUInteger)indexOfObjectWithPredicate:(NSPredicate *)predicate;
+
+/**
+ Returns all the objects matching the given predicate in the array.
+
+ @param predicateFormat A predicate format string, optionally followed by a variable number of arguments.
+
+ @return                An `RLMResults` of objects that match the given predicate.
+ */
+- (RLMResults<RLMObjectType> *)objectsWhere:(NSString *)predicateFormat, ...;
+
+/// :nodoc:
+- (RLMResults<RLMObjectType> *)objectsWhere:(NSString *)predicateFormat args:(va_list)args;
+
+/**
+ Returns all the objects matching the given predicate in the array.
+
+ @param predicate   The predicate with which to filter the objects.
+
+ @return            An `RLMResults` of objects that match the given predicate
+ */
+- (RLMResults<RLMObjectType> *)objectsWithPredicate:(NSPredicate *)predicate;
+
+/**
+ Returns a sorted `RLMResults` from the array.
+
+ @param keyPath     The key path to sort by.
+ @param ascending   The direction to sort in.
+
+ @return    An `RLMResults` sorted by the specified key path.
+ */
+- (RLMResults<RLMObjectType> *)sortedResultsUsingKeyPath:(NSString *)keyPath ascending:(BOOL)ascending;
+
+/**
+ Returns a sorted `RLMResults` from the array.
+
+ @param property    The property name to sort by.
+ @param ascending   The direction to sort in.
+
+ @return    An `RLMResults` sorted by the specified property.
+ */
+- (RLMResults<RLMObjectType> *)sortedResultsUsingProperty:(NSString *)property ascending:(BOOL)ascending
+    __deprecated_msg("Use `-sortedResultsUsingKeyPath:ascending:`");
+
+/**
+ Returns a sorted `RLMResults` from the array.
+
+ @param properties  An array of `RLMSortDescriptor`s to sort by.
+
+ @return    An `RLMResults` sorted by the specified properties.
+ */
+- (RLMResults<RLMObjectType> *)sortedResultsUsingDescriptors:(NSArray<RLMSortDescriptor *> *)properties;
+
+/// :nodoc:
+- (RLMObjectType)objectAtIndexedSubscript:(NSUInteger)index;
+
+/// :nodoc:
+- (void)setObject:(RLMObjectType)newValue atIndexedSubscript:(NSUInteger)index;
+
+#pragma mark - Notifications
+
+/**
+ Registers a block to be called each time the array changes.
+
+ The block will be asynchronously called with the initial array, and then
+ called again after each write transaction which changes any of the objects in
+ the array, which objects are in the results, or the order of the objects in the
+ array.
+
+ The `changes` parameter will be `nil` the first time the block is called.
+ For each call after that, it will contain information about
+ which rows in the array were added, removed or modified. If a write transaction
+ did not modify any objects in the array, the block is not called at all.
+ See the `RLMCollectionChange` documentation for information on how the changes
+ are reported and an example of updating a `UITableView`.
+
+ If an error occurs the block will be called with `nil` for the results
+ parameter and a non-`nil` error. Currently the only errors that can occur are
+ when opening the Realm on the background worker thread.
+
+ Notifications are delivered via the standard run loop, and so can't be
+ delivered while the run loop is blocked by other activity. When
+ notifications can't be delivered instantly, multiple notifications may be
+ coalesced into a single notification. This can include the notification
+ with the initial results. For example, the following code performs a write
+ transaction immediately after adding the notification block, so there is no
+ opportunity for the initial notification to be delivered first. As a
+ result, the initial notification will reflect the state of the Realm after
+ the write transaction.
+
+     Person *person = [[Person allObjectsInRealm:realm] firstObject];
+     NSLog(@"person.dogs.count: %zu", person.dogs.count); // => 0
+     self.token = [person.dogs addNotificationBlock(RLMArray<Dog *> *dogs,
+                                                    RLMCollectionChange *changes,
+                                                    NSError *error) {
+         // Only fired once for the example
+         NSLog(@"dogs.count: %zu", dogs.count) // => 1
+     }];
+     [realm transactionWithBlock:^{
+         Dog *dog = [[Dog alloc] init];
+         dog.name = @"Rex";
+         [person.dogs addObject:dog];
+     }];
+     // end of run loop execution context
+
+ You must retain the returned token for as long as you want updates to continue
+ to be sent to the block. To stop receiving updates, call `-stop` on the token.
+
+ @warning This method cannot be called during a write transaction, or when the
+          containing Realm is read-only.
+ @warning This method may only be called on a managed array.
+
+ @param block The block to be called each time the array changes.
+ @return A token which must be held for as long as you want updates to be delivered.
+ */
+- (RLMNotificationToken *)addNotificationBlock:(void (^)(RLMArray<RLMObjectType> *__nullable array,
+                                                         RLMCollectionChange *__nullable changes,
+                                                         NSError *__nullable error))block __attribute__((warn_unused_result));
+
+#pragma mark - Aggregating Property Values
+
+/**
+ Returns the minimum (lowest) value of the given property among all the objects in the array.
+
+     NSNumber *min = [object.arrayProperty minOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose minimum value is desired. Only properties of
+                 types `int`, `float`, `double`, and `NSDate` are supported.
+
+ @return The minimum value of the property, or `nil` if the array is empty.
+ */
+- (nullable id)minOfProperty:(NSString *)property;
+
+/**
+ Returns the maximum (highest) value of the given property among all the objects in the array.
+
+     NSNumber *max = [object.arrayProperty maxOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose maximum value is desired. Only properties of
+                 types `int`, `float`, `double`, and `NSDate` are supported.
+
+ @return The maximum value of the property, or `nil` if the array is empty.
+ */
+- (nullable id)maxOfProperty:(NSString *)property;
+
+/**
+ Returns the sum of the values of a given property over all the objects in the array.
+
+     NSNumber *sum = [object.arrayProperty sumOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose values should be summed. Only properties of
+                 types `int`, `float`, and `double` are supported.
+
+ @return The sum of the given property.
+ */
+- (NSNumber *)sumOfProperty:(NSString *)property;
+
+/**
+ Returns the average value of a given property over the objects in the array.
+
+     NSNumber *average = [object.arrayProperty averageOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose average value should be calculated. Only
+                 properties of types `int`, `float`, and `double` are supported.
+
+ @return    The average value of the given property, or `nil` if the array is empty.
+ */
+- (nullable NSNumber *)averageOfProperty:(NSString *)property;
+
+
+#pragma mark - Unavailable Methods
+
+/**
+ `-[RLMArray init]` is not available because `RLMArray`s cannot be created directly.
+ `RLMArray` properties on `RLMObject`s are lazily created when accessed, or can be obtained by querying a Realm.
+ */
+- (instancetype)init __attribute__((unavailable("RLMArrays cannot be created directly")));
+
+/**
+ `+[RLMArray new]` is not available because `RLMArray`s cannot be created directly.
+ `RLMArray` properties on `RLMObject`s are lazily created when accessed, or can be obtained by querying a Realm.
+ */
++ (instancetype)new __attribute__((unavailable("RLMArrays cannot be created directly")));
+
+@end
+
+/// :nodoc:
+@interface RLMArray (Swift)
+// for use only in Swift class definitions
+- (instancetype)initWithObjectClassName:(NSString *)objectClassName;
+@end
+
+NS_ASSUME_NONNULL_END

+ 411 - 0
Libraries external/Realm/Realm.framework/Headers/RLMCollection.h

@@ -0,0 +1,411 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+#import "RLMThreadSafeReference.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMRealm, RLMResults, RLMObject, RLMSortDescriptor, RLMNotificationToken, RLMCollectionChange;
+
+/**
+ A homogenous collection of `RLMObject` instances. Examples of conforming types include `RLMArray`,
+ `RLMResults`, and `RLMLinkingObjects`.
+ */
+@protocol RLMCollection <NSFastEnumeration, RLMThreadConfined>
+
+@required
+
+#pragma mark - Properties
+
+/**
+ The number of objects in the collection.
+ */
+@property (nonatomic, readonly, assign) NSUInteger count;
+
+/**
+ The class name (i.e. type) of the `RLMObject`s contained in the collection.
+ */
+@property (nonatomic, readonly, copy) NSString *objectClassName;
+
+/**
+ The Realm which manages the collection, or `nil` for unmanaged collections.
+ */
+@property (nonatomic, readonly) RLMRealm *realm;
+
+#pragma mark - Accessing Objects from a Collection
+
+/**
+ Returns the object at the index specified.
+
+ @param index   The index to look up.
+
+ @return An `RLMObject` of the type contained in the collection.
+ */
+- (id)objectAtIndex:(NSUInteger)index;
+
+/**
+ Returns the first object in the collection.
+
+ Returns `nil` if called on an empty collection.
+
+ @return An `RLMObject` of the type contained in the collection.
+ */
+- (nullable id)firstObject;
+
+/**
+ Returns the last object in the collection.
+
+ Returns `nil` if called on an empty collection.
+
+ @return An `RLMObject` of the type contained in the collection.
+ */
+- (nullable id)lastObject;
+
+#pragma mark - Querying a Collection
+
+/**
+ Returns the index of an object in the collection.
+
+ Returns `NSNotFound` if the object is not found in the collection.
+
+ @param object  An object (of the same type as returned from the `objectClassName` selector).
+ */
+- (NSUInteger)indexOfObject:(RLMObject *)object;
+
+/**
+ Returns the index of the first object in the collection matching the predicate.
+
+ @param predicateFormat A predicate format string, optionally followed by a variable number of arguments.
+
+ @return    The index of the object, or `NSNotFound` if the object is not found in the collection.
+ */
+- (NSUInteger)indexOfObjectWhere:(NSString *)predicateFormat, ...;
+
+/// :nodoc:
+- (NSUInteger)indexOfObjectWhere:(NSString *)predicateFormat args:(va_list)args;
+
+/**
+ Returns the index of the first object in the collection matching the predicate.
+
+ @param predicate   The predicate with which to filter the objects.
+
+ @return    The index of the object, or `NSNotFound` if the object is not found in the collection.
+ */
+- (NSUInteger)indexOfObjectWithPredicate:(NSPredicate *)predicate;
+
+/**
+ Returns all objects matching the given predicate in the collection.
+
+ @param predicateFormat A predicate format string, optionally followed by a variable number of arguments.
+
+ @return    An `RLMResults` containing objects that match the given predicate.
+ */
+- (RLMResults *)objectsWhere:(NSString *)predicateFormat, ...;
+
+/// :nodoc:
+- (RLMResults *)objectsWhere:(NSString *)predicateFormat args:(va_list)args;
+
+/**
+ Returns all objects matching the given predicate in the collection.
+
+ @param predicate   The predicate with which to filter the objects.
+
+ @return            An `RLMResults` containing objects that match the given predicate.
+ */
+- (RLMResults *)objectsWithPredicate:(NSPredicate *)predicate;
+
+/**
+ Returns a sorted `RLMResults` from the collection.
+
+ @param keyPath     The keyPath to sort by.
+ @param ascending   The direction to sort in.
+
+ @return    An `RLMResults` sorted by the specified key path.
+ */
+- (RLMResults *)sortedResultsUsingKeyPath:(NSString *)keyPath ascending:(BOOL)ascending;
+
+/**
+ Returns a sorted `RLMResults` from the collection.
+
+ @param property    The property name to sort by.
+ @param ascending   The direction to sort in.
+
+ @return    An `RLMResults` sorted by the specified property.
+ */
+- (RLMResults *)sortedResultsUsingProperty:(NSString *)property ascending:(BOOL)ascending
+    __deprecated_msg("Use `-sortedResultsUsingKeyPath:ascending:`");
+
+/**
+ Returns a sorted `RLMResults` from the collection.
+
+ @param properties  An array of `RLMSortDescriptor`s to sort by.
+
+ @return    An `RLMResults` sorted by the specified properties.
+ */
+- (RLMResults *)sortedResultsUsingDescriptors:(NSArray<RLMSortDescriptor *> *)properties;
+
+/// :nodoc:
+- (id)objectAtIndexedSubscript:(NSUInteger)index;
+
+/**
+ Returns an `NSArray` containing the results of invoking `valueForKey:` using `key` on each of the collection's objects.
+
+ @param key The name of the property.
+
+ @return An `NSArray` containing results.
+ */
+- (nullable id)valueForKey:(NSString *)key;
+
+/**
+ Invokes `setValue:forKey:` on each of the collection's objects using the specified `value` and `key`.
+
+ @warning This method may only be called during a write transaction.
+
+ @param value The object value.
+ @param key   The name of the property.
+ */
+- (void)setValue:(nullable id)value forKey:(NSString *)key;
+
+#pragma mark - Notifications
+
+/**
+ Registers a block to be called each time the collection changes.
+
+ The block will be asynchronously called with the initial collection, and then
+ called again after each write transaction which changes either any of the
+ objects in the collection, or which objects are in the collection.
+
+ The `change` parameter will be `nil` the first time the block is called.
+ For each call after that, it will contain information about
+ which rows in the collection were added, removed or modified. If a write transaction
+ did not modify any objects in this collection, the block is not called at all.
+ See the `RLMCollectionChange` documentation for information on how the changes
+ are reported and an example of updating a `UITableView`.
+
+ If an error occurs the block will be called with `nil` for the collection
+ parameter and a non-`nil` error. Currently the only errors that can occur are
+ when opening the Realm on the background worker thread.
+
+ At the time when the block is called, the collection object will be fully
+ evaluated and up-to-date, and as long as you do not perform a write transaction
+ on the same thread or explicitly call `-[RLMRealm refresh]`, accessing it will
+ never perform blocking work.
+
+ Notifications are delivered via the standard run loop, and so can't be
+ delivered while the run loop is blocked by other activity. When
+ notifications can't be delivered instantly, multiple notifications may be
+ coalesced into a single notification. This can include the notification
+ with the initial collection. For example, the following code performs a write
+ transaction immediately after adding the notification block, so there is no
+ opportunity for the initial notification to be delivered first. As a
+ result, the initial notification will reflect the state of the Realm after
+ the write transaction.
+
+     id<RLMCollection> collection = [Dog allObjects];
+     NSLog(@"dogs.count: %zu", dogs.count); // => 0
+     self.token = [collection addNotificationBlock:^(id<RLMCollection> dogs,
+                                                  RLMCollectionChange *changes,
+                                                  NSError *error) {
+         // Only fired once for the example
+         NSLog(@"dogs.count: %zu", dogs.count); // => 1
+     }];
+     [realm transactionWithBlock:^{
+         Dog *dog = [[Dog alloc] init];
+         dog.name = @"Rex";
+         [realm addObject:dog];
+     }];
+     // end of run loop execution context
+
+ You must retain the returned token for as long as you want updates to continue
+ to be sent to the block. To stop receiving updates, call `-stop` on the token.
+
+ @warning This method cannot be called during a write transaction, or when the
+          containing Realm is read-only.
+
+ @param block The block to be called each time the collection changes.
+ @return A token which must be held for as long as you want collection notifications to be delivered.
+ */
+- (RLMNotificationToken *)addNotificationBlock:(void (^)(id<RLMCollection> __nullable collection,
+                                                         RLMCollectionChange *__nullable change,
+                                                         NSError *__nullable error))block __attribute__((warn_unused_result));
+
+#pragma mark - Aggregating Property Values
+
+/**
+ Returns the minimum (lowest) value of the given property among all the objects
+ in the collection.
+
+     NSNumber *min = [results minOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose minimum value is desired. Only properties of
+                 types `int`, `float`, `double`, and `NSDate` are supported.
+
+ @return The minimum value of the property, or `nil` if the Results are empty.
+ */
+- (nullable id)minOfProperty:(NSString *)property;
+
+/**
+ Returns the maximum (highest) value of the given property among all the objects
+ in the collection.
+
+     NSNumber *max = [results maxOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose maximum value is desired. Only properties of
+                 types `int`, `float`, `double`, and `NSDate` are supported.
+
+ @return The maximum value of the property, or `nil` if the Results are empty.
+ */
+- (nullable id)maxOfProperty:(NSString *)property;
+
+/**
+ Returns the sum of the values of a given property over all the objects in the collection.
+
+     NSNumber *sum = [results sumOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose values should be summed. Only properties of
+                 types `int`, `float`, and `double` are supported.
+
+ @return The sum of the given property.
+ */
+- (NSNumber *)sumOfProperty:(NSString *)property;
+
+/**
+ Returns the average value of a given property over the objects in the collection.
+
+     NSNumber *average = [results averageOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose average value should be calculated. Only
+                 properties of types `int`, `float`, and `double` are supported.
+
+ @return    The average value of the given property, or `nil` if the Results are empty.
+ */
+- (nullable NSNumber *)averageOfProperty:(NSString *)property;
+
+@end
+
+/**
+ An `RLMSortDescriptor` stores a property name and a sort order for use with
+ `sortedResultsUsingDescriptors:`. It is similar to `NSSortDescriptor`, but supports
+ only the subset of functionality which can be efficiently run by Realm's query
+ engine.
+ 
+ `RLMSortDescriptor` instances are immutable.
+ */
+@interface RLMSortDescriptor : NSObject
+
+#pragma mark - Properties
+
+/**
+ The key path which the sort descriptor orders results by.
+ */
+@property (nonatomic, readonly) NSString *keyPath;
+
+/**
+ Whether the descriptor sorts in ascending or descending order.
+ */
+@property (nonatomic, readonly) BOOL ascending;
+
+#pragma mark - Methods
+
+/**
+ Returns a new sort descriptor for the given key path and sort direction.
+ */
++ (instancetype)sortDescriptorWithKeyPath:(NSString *)keyPath ascending:(BOOL)ascending;
+
+/**
+ Returns a copy of the receiver with the sort direction reversed.
+ */
+- (instancetype)reversedSortDescriptor;
+
+#pragma mark - Deprecated
+
+/**
+ The name of the property which the sort descriptor orders results by.
+ */
+@property (nonatomic, readonly) NSString *property __deprecated_msg("Use `-keyPath`");
+
+/**
+ Returns a new sort descriptor for the given property name and sort direction.
+ */
++ (instancetype)sortDescriptorWithProperty:(NSString *)propertyName ascending:(BOOL)ascending
+    __deprecated_msg("Use `+sortDescriptorWithKeyPath:ascending:`");
+
+@end
+
+/**
+ A `RLMCollectionChange` object encapsulates information about changes to collections
+ that are reported by Realm notifications.
+
+ `RLMCollectionChange` is passed to the notification blocks registered with
+ `-addNotificationBlock` on `RLMArray` and `RLMResults`, and reports what rows in the
+ collection changed since the last time the notification block was called.
+
+ The change information is available in two formats: a simple array of row
+ indices in the collection for each type of change, and an array of index paths
+ in a requested section suitable for passing directly to `UITableView`'s batch
+ update methods. A complete example of updating a `UITableView` named `tv`:
+
+     [tv beginUpdates];
+     [tv deleteRowsAtIndexPaths:[changes deletionsInSection:0] withRowAnimation:UITableViewRowAnimationAutomatic];
+     [tv insertRowsAtIndexPaths:[changes insertionsInSection:0] withRowAnimation:UITableViewRowAnimationAutomatic];
+     [tv reloadRowsAtIndexPaths:[changes modificationsInSection:0] withRowAnimation:UITableViewRowAnimationAutomatic];
+     [tv endUpdates];
+
+ All of the arrays in an `RLMCollectionChange` are always sorted in ascending order.
+ */
+@interface RLMCollectionChange : NSObject
+/// The indices of objects in the previous version of the collection which have
+/// been removed from this one.
+@property (nonatomic, readonly) NSArray<NSNumber *> *deletions;
+
+/// The indices in the new version of the collection which were newly inserted.
+@property (nonatomic, readonly) NSArray<NSNumber *> *insertions;
+
+/**
+ The indices in the new version of the collection which were modified.
+ 
+ For `RLMResults`, this means that one or more of the properties of the object at
+ that index were modified (or an object linked to by that object was
+ modified).
+ 
+ For `RLMArray`, the array itself being modified to contain a
+ different object at that index will also be reported as a modification.
+ */
+@property (nonatomic, readonly) NSArray<NSNumber *> *modifications;
+
+/// Returns the index paths of the deletion indices in the given section.
+- (NSArray<NSIndexPath *> *)deletionsInSection:(NSUInteger)section;
+
+/// Returns the index paths of the insertion indices in the given section.
+- (NSArray<NSIndexPath *> *)insertionsInSection:(NSUInteger)section;
+
+/// Returns the index paths of the modification indices in the given section.
+- (NSArray<NSIndexPath *> *)modificationsInSection:(NSUInteger)section;
+@end
+
+NS_ASSUME_NONNULL_END

+ 204 - 0
Libraries external/Realm/Realm.framework/Headers/RLMConstants.h

@@ -0,0 +1,204 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+// For compatibility with Xcode 7, before extensible string enums were introduced,
+#ifdef NS_EXTENSIBLE_STRING_ENUM
+#define RLM_EXTENSIBLE_STRING_ENUM NS_EXTENSIBLE_STRING_ENUM
+#define RLM_EXTENSIBLE_STRING_ENUM_CASE_SWIFT_NAME(_, extensible_string_enum) NS_SWIFT_NAME(extensible_string_enum)
+#else
+#define RLM_EXTENSIBLE_STRING_ENUM
+#define RLM_EXTENSIBLE_STRING_ENUM_CASE_SWIFT_NAME(fully_qualified, _) NS_SWIFT_NAME(fully_qualified)
+#endif
+
+#if __has_attribute(ns_error_domain) && (!defined(__cplusplus) || !__cplusplus || __cplusplus >= 201103L)
+#define RLM_ERROR_ENUM(type, name, domain) \
+    _Pragma("clang diagnostic push") \
+    _Pragma("clang diagnostic ignored \"-Wignored-attributes\"") \
+    NS_ENUM(type, __attribute__((ns_error_domain(domain))) name) \
+    _Pragma("clang diagnostic pop")
+#else
+#define RLM_ERROR_ENUM(type, name, domain) NS_ENUM(type, name)
+#endif
+
+
+#pragma mark - Enums
+
+/**
+ `RLMPropertyType` is an enumeration describing all property types supported in Realm models.
+
+ For more information, see [Realm Models](https://realm.io/docs/objc/latest/#models).
+ */
+// Make sure numbers match those in <realm/data_type.hpp>
+typedef NS_ENUM(int32_t, RLMPropertyType) {
+
+#pragma mark - Primitive types
+
+    /** Integers: `NSInteger`, `int`, `long`, `Int` (Swift) */
+    RLMPropertyTypeInt    = 0,
+    /** Booleans: `BOOL`, `bool`, `Bool` (Swift) */
+    RLMPropertyTypeBool   = 1,
+    /** Floating-point numbers: `float`, `Float` (Swift) */
+    RLMPropertyTypeFloat  = 9,
+    /** Double-precision floating-point numbers: `double`, `Double` (Swift) */
+    RLMPropertyTypeDouble = 10,
+
+#pragma mark - Object types
+
+    /** Strings: `NSString`, `String` (Swift) */
+    RLMPropertyTypeString = 2,
+    /** Binary data: `NSData` */
+    RLMPropertyTypeData   = 4,
+    /** 
+     Any object: `id`.
+     
+     This property type is no longer supported for new models. However, old models with any-typed properties are still
+     supported for migration purposes.
+     */
+    RLMPropertyTypeAny    = 6,
+    /** Dates: `NSDate` */
+    RLMPropertyTypeDate   = 8,
+
+#pragma mark - Array/Linked object types
+
+    /** Realm model objects. See [Realm Models](https://realm.io/docs/objc/latest/#models) for more information. */
+    RLMPropertyTypeObject = 12,
+    /** Realm arrays. See [Realm Models](https://realm.io/docs/objc/latest/#models) for more information. */
+    RLMPropertyTypeArray  = 13,
+    /** Realm linking objects. See [Realm Models](https://realm.io/docs/objc/latest/#models) for more information. */
+    RLMPropertyTypeLinkingObjects = 14,
+};
+
+/** An error domain identifying Realm-specific errors. */
+extern NSString * const RLMErrorDomain;
+
+/** An error domain identifying non-specific system errors. */
+extern NSString * const RLMUnknownSystemErrorDomain;
+
+/**
+ `RLMError` is an enumeration representing all recoverable errors. It is associated with the
+ Realm error domain specified in `RLMErrorDomain`.
+ */
+typedef RLM_ERROR_ENUM(NSInteger, RLMError, RLMErrorDomain) {
+    /** Denotes a general error that occurred when trying to open a Realm. */
+    RLMErrorFail                  = 1,
+
+    /** Denotes a file I/O error that occurred when trying to open a Realm. */
+    RLMErrorFileAccess            = 2,
+
+    /** 
+     Denotes a file permission error that ocurred when trying to open a Realm.
+     
+     This error can occur if the user does not have permission to open or create
+     the specified file in the specified access mode when opening a Realm.
+     */
+    RLMErrorFilePermissionDenied  = 3,
+
+    /** Denotes an error where a file was to be written to disk, but another file with the same name already exists. */
+    RLMErrorFileExists            = 4,
+
+    /**
+     Denotes an error that occurs if a file could not be found.
+     
+     This error may occur if a Realm file could not be found on disk when trying to open a
+     Realm as read-only, or if the directory part of the specified path was not found when
+     trying to write a copy.
+     */
+    RLMErrorFileNotFound          = 5,
+
+    /** 
+     Denotes an error that occurs if a file format upgrade is required to open the file,
+     but upgrades were explicitly disabled.
+     */
+    RLMErrorFileFormatUpgradeRequired = 6,
+
+    /** 
+     Denotes an error that occurs if the database file is currently open in another
+     process which cannot share with the current process due to an
+     architecture mismatch.
+     
+     This error may occur if trying to share a Realm file between an i386 (32-bit) iOS
+     Simulator and the Realm Browser application. In this case, please use the 64-bit
+     version of the iOS Simulator.
+     */
+    RLMErrorIncompatibleLockFile  = 8,
+
+    /** Denotes an error that occurs when there is insufficient available address space. */
+    RLMErrorAddressSpaceExhausted = 9,
+
+    /** Denotes an error that occurs if there is a schema version mismatch, so that a migration is required. */
+    RLMErrorSchemaMismatch = 10,
+};
+
+#pragma mark - Constants
+
+#pragma mark - Notification Constants
+
+/**
+ A notification indicating that changes were made to a Realm.
+*/
+typedef NSString * RLMNotification RLM_EXTENSIBLE_STRING_ENUM;
+
+/**
+ This notification is posted by a Realm when the data in that Realm has changed.
+
+ More specifically, this notification is posted after a Realm has been refreshed to
+ reflect a write transaction. This can happen when an autorefresh occurs, when
+ `-[RLMRealm refresh]` is called, after an implicit refresh from `-[RLMRealm beginWriteTransaction]`,
+ or after a local write transaction is completed.
+ */
+extern RLMNotification const RLMRealmRefreshRequiredNotification
+RLM_EXTENSIBLE_STRING_ENUM_CASE_SWIFT_NAME(RLMRealmRefreshRequiredNotification, RefreshRequired);
+
+/**
+ This notification is posted by a Realm when a write transaction has been
+ committed to a Realm on a different thread for the same file.
+
+ It is not posted if `-[RLMRealm autorefresh]` is enabled, or if the Realm is
+ refreshed before the notification has a chance to run.
+
+ Realms with autorefresh disabled should normally install a handler for this
+ notification which calls `-[RLMRealm refresh]` after doing some work. Refreshing
+ the Realm is optional, but not refreshing the Realm may lead to large Realm
+ files. This is because Realm must keep an extra copy of the data for the stale
+ Realm.
+ */
+extern RLMNotification const RLMRealmDidChangeNotification
+RLM_EXTENSIBLE_STRING_ENUM_CASE_SWIFT_NAME(RLMRealmDidChangeNotification, DidChange);
+
+#pragma mark - Other Constants
+
+/** The schema version used for uninitialized Realms */
+extern const uint64_t RLMNotVersioned;
+
+/** The corresponding value is the name of an exception thrown by Realm. */
+extern NSString * const RLMExceptionName;
+
+/** The corresponding value is a Realm file version. */
+extern NSString * const RLMRealmVersionKey;
+
+/** The corresponding key is the version of the underlying database engine. */
+extern NSString * const RLMRealmCoreVersionKey;
+
+/** The corresponding key is the Realm invalidated property name. */
+extern NSString * const RLMInvalidatedKey;
+
+NS_ASSUME_NONNULL_END

+ 127 - 0
Libraries external/Realm/Realm.framework/Headers/RLMMigration.h

@@ -0,0 +1,127 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMSchema;
+@class RLMArray;
+@class RLMObject;
+
+/**
+ A block type which provides both the old and new versions of an object in the Realm. Object 
+ properties can only be accessed using keyed subscripting.
+ 
+ @see `-[RLMMigration enumerateObjects:block:]`
+ 
+ @param oldObject The object from the original Realm (read-only).
+ @param newObject The object from the migrated Realm (read-write).
+*/
+typedef void (^RLMObjectMigrationBlock)(RLMObject * __nullable oldObject, RLMObject * __nullable newObject);
+
+/**
+ `RLMMigration` instances encapsulate information intended to facilitate a schema migration.
+ 
+ A `RLMMigration` instance is passed into a user-defined `RLMMigrationBlock` block when updating
+ the version of a Realm. This instance provides access to the old and new database schemas, the
+ objects in the Realm, and provides functionality for modifying the Realm during the migration.
+ */
+@interface RLMMigration : NSObject
+
+#pragma mark - Properties
+
+/**
+ Returns the old `RLMSchema`. This is the schema which describes the Realm before the
+ migration is applied.
+ */
+@property (nonatomic, readonly) RLMSchema *oldSchema;
+
+/**
+ Returns the new `RLMSchema`. This is the schema which describes the Realm after the
+ migration is applied.
+ */
+@property (nonatomic, readonly) RLMSchema *newSchema;
+
+
+#pragma mark - Altering Objects during a Migration
+
+/**
+ Enumerates all the objects of a given type in the Realm, providing both the old and new versions
+ of each object. Within the block, object properties can only be accessed using keyed subscripting.
+
+ @param className   The name of the `RLMObject` class to enumerate.
+
+ @warning   All objects returned are of a type specific to the current migration and should not be cast
+            to `className`. Instead, treat them as `RLMObject`s and use keyed subscripting to access
+            properties.
+ */
+- (void)enumerateObjects:(NSString *)className block:(__attribute__((noescape)) RLMObjectMigrationBlock)block;
+
+/**
+ Creates and returns an `RLMObject` instance of type `className` in the Realm being migrated.
+ 
+ The `value` argument is used to populate the object. It can be a key-value coding compliant object, an array or 
+ dictionary returned from the methods in `NSJSONSerialization`, or an array containing one element for each managed
+ property. An exception will be thrown if any required properties are not present and those properties were not defined
+ with default values.
+
+ When passing in an `NSArray` as the `value` argument, all properties must be present, valid and in the same order as
+ the properties defined in the model.
+
+ @param className   The name of the `RLMObject` class to create.
+ @param value       The value used to populate the object.
+ */
+- (RLMObject *)createObject:(NSString *)className withValue:(id)value;
+
+/**
+ Deletes an object from a Realm during a migration.
+
+ It is permitted to call this method from within the block passed to `-[enumerateObjects:block:]`.
+
+ @param object  Object to be deleted from the Realm being migrated.
+ */
+- (void)deleteObject:(RLMObject *)object;
+
+/**
+ Deletes the data for the class with the given name.
+
+ All objects of the given class will be deleted. If the `RLMObject` subclass no longer exists in your program,
+ any remaining metadata for the class will be removed from the Realm file.
+
+ @param  name The name of the `RLMObject` class to delete.
+
+ @return A Boolean value indicating whether there was any data to delete.
+ */
+- (BOOL)deleteDataForClassName:(NSString *)name;
+
+/**
+ Renames a property of the given class from `oldName` to `newName`.
+
+ @param className The name of the class whose property should be renamed. This class must be present
+                  in both the old and new Realm schemas.
+ @param oldName   The old name for the property to be renamed. There must not be a property with this name in the
+                  class as defined by the new Realm schema.
+ @param newName   The new name for the property to be renamed. There must not be a property with this name in the
+                  class as defined by the old Realm schema.
+ */
+- (void)renamePropertyForClass:(NSString *)className oldName:(NSString *)oldName newName:(NSString *)newName;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 535 - 0
Libraries external/Realm/Realm.framework/Headers/RLMObject.h

@@ -0,0 +1,535 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+#import <Realm/RLMObjectBase.h>
+#import <Realm/RLMThreadSafeReference.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMNotificationToken;
+@class RLMObjectSchema;
+@class RLMPropertyChange;
+@class RLMPropertyDescriptor;
+@class RLMRealm;
+@class RLMResults;
+
+/**
+ `RLMObject` is a base class for model objects representing data stored in Realms.
+
+ Define your model classes by subclassing `RLMObject` and adding properties to be managed.
+ Then instantiate and use your custom subclasses instead of using the `RLMObject` class directly.
+
+     // Dog.h
+     @interface Dog : RLMObject
+     @property NSString *name;
+     @property BOOL      adopted;
+     @end
+
+     // Dog.m
+     @implementation Dog
+     @end //none needed
+
+ ### Supported property types
+
+ - `NSString`
+ - `NSInteger`, `int`, `long`, `float`, and `double`
+ - `BOOL` or `bool`
+ - `NSDate`
+ - `NSData`
+ - `NSNumber<X>`, where `X` is one of `RLMInt`, `RLMFloat`, `RLMDouble` or `RLMBool`, for optional number properties
+ - `RLMObject` subclasses, to model many-to-one relationships.
+ - `RLMArray<X>`, where `X` is an `RLMObject` subclass, to model many-to-many relationships.
+
+ ### Querying
+
+ You can initiate queries directly via the class methods: `allObjects`, `objectsWhere:`, and `objectsWithPredicate:`.
+ These methods allow you to easily query a custom subclass for instances of that class in the default Realm.
+
+ To search in a Realm other than the default Realm, use the `allObjectsInRealm:`, `objectsInRealm:where:`,
+ and `objectsInRealm:withPredicate:` class methods.
+
+ @see `RLMRealm`
+
+ ### Relationships
+
+ See our [Cocoa guide](https://realm.io/docs/objc/latest#relationships) for more details.
+
+ ### Key-Value Observing
+
+ All `RLMObject` properties (including properties you create in subclasses) are
+ [Key-Value Observing compliant](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html),
+ except for `realm` and `objectSchema`.
+
+ Keep the following tips in mind when observing Realm objects:
+
+ 1. Unlike `NSMutableArray` properties, `RLMArray` properties do not require
+    using the proxy object returned from `-mutableArrayValueForKey:`, or defining
+    KVC mutation methods on the containing class. You can simply call methods on
+    the `RLMArray` directly; any changes will be automatically observed by the containing
+    object.
+ 2. Unmanaged `RLMObject` instances cannot be added to a Realm while they have any
+    observed properties.
+ 3. Modifying managed `RLMObject`s within `-observeValueForKeyPath:ofObject:change:context:`
+    is not recommended. Properties may change even when the Realm is not in a write
+    transaction (for example, when `-[RLMRealm refresh]` is called after changes
+    are made on a different thread), and notifications sent prior to the change
+    being applied (when `NSKeyValueObservingOptionPrior` is used) may be sent at
+    times when you *cannot* begin a write transaction.
+ */
+
+@interface RLMObject : RLMObjectBase <RLMThreadConfined>
+
+#pragma mark - Creating & Initializing Objects
+
+/**
+ Creates an unmanaged instance of a Realm object.
+
+ Call `addObject:` on an `RLMRealm` instance to add an unmanaged object into that Realm.
+
+ @see `[RLMRealm addObject:]`
+ */
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+
+/**
+ Creates an unmanaged instance of a Realm object.
+
+ Pass in an `NSArray` or `NSDictionary` instance to set the values of the object's properties.
+
+ Call `addObject:` on an `RLMRealm` instance to add an unmanaged object into that Realm.
+
+ @see `[RLMRealm addObject:]`
+ */
+- (instancetype)initWithValue:(id)value NS_DESIGNATED_INITIALIZER;
+
+
+/**
+ Returns the class name for a Realm object subclass.
+
+ @warning Do not override. Realm relies on this method returning the exact class
+          name.
+
+ @return  The class name for the model class.
+ */
++ (NSString *)className;
+
+/**
+ Creates an instance of a Realm object with a given value, and adds it to the default Realm.
+
+ If nested objects are included in the argument, `createInDefaultRealmWithValue:` will be recursively called
+ on them.
+
+ The `value` argument can be a key-value coding compliant object, an array or dictionary returned from the methods in
+ `NSJSONSerialization`, or an array containing one element for each managed property. An exception will be thrown if
+ any required properties are not present and those properties were not defined with default values.
+
+ When passing in an array as the `value` argument, all properties must be present, valid and in the same order as the
+ properties defined in the model.
+
+ @param value    The value used to populate the object.
+
+ @see   `defaultPropertyValues`
+ */
++ (instancetype)createInDefaultRealmWithValue:(id)value;
+
+/**
+ Creates an instance of a Realm object with a given value, and adds it to the specified Realm.
+
+ If nested objects are included in the argument, `createInRealm:withValue:` will be recursively called
+ on them.
+
+ The `value` argument can be a key-value coding compliant object, an array or dictionary returned from the methods in
+ `NSJSONSerialization`, or an array containing one element for each managed property. An exception will be thrown if any
+ required properties are not present and those properties were not defined with default values.
+
+ When passing in an array as the `value` argument, all properties must be present, valid and in the same order as the
+ properties defined in the model.
+
+ @param realm    The Realm which should manage the newly-created object.
+ @param value    The value used to populate the object.
+
+ @see   `defaultPropertyValues`
+ */
++ (instancetype)createInRealm:(RLMRealm *)realm withValue:(id)value;
+
+/**
+ Creates or updates a Realm object within the default Realm.
+
+ This method may only be called on Realm object types with a primary key defined. If there is already
+ an object with the same primary key value in the default Realm, its values are updated and the object
+ is returned. Otherwise, this method creates and populates a new instance of the object in the default Realm.
+
+ If nested objects are included in the argument, `createOrUpdateInDefaultRealmWithValue:` will be
+ recursively called on them if they have primary keys, `createInDefaultRealmWithValue:` if they do not.
+
+ If the argument is a Realm object already managed by the default Realm, the argument's type is the same
+ as the receiver, and the objects have identical values for their managed properties, this method does nothing.
+
+ The `value` argument is used to populate the object. It can be a key-value coding compliant object, an array or
+ dictionary returned from the methods in `NSJSONSerialization`, or an array containing one element for each managed
+ property. An exception will be thrown if any required properties are not present and those properties were not defined
+ with default values.
+
+ When passing in an array as the `value` argument, all properties must be present, valid and in the same order as the
+ properties defined in the model.
+
+ @param value    The value used to populate the object.
+
+ @see   `defaultPropertyValues`, `primaryKey`
+ */
++ (instancetype)createOrUpdateInDefaultRealmWithValue:(id)value;
+
+/**
+ Creates or updates an Realm object within a specified Realm.
+
+ This method may only be called on Realm object types with a primary key defined. If there is already
+ an object with the same primary key value in the given Realm, its values are updated and the object
+ is returned. Otherwise this method creates and populates a new instance of this object in the given Realm.
+
+ If nested objects are included in the argument, `createOrUpdateInRealm:withValue:` will be
+ recursively called on them if they have primary keys, `createInRealm:withValue:` if they do not.
+
+ If the argument is a Realm object already managed by the given Realm, the argument's type is the same
+ as the receiver, and the objects have identical values for their managed properties, this method does nothing.
+
+ The `value` argument is used to populate the object. It can be a key-value coding compliant object, an array or
+ dictionary returned from the methods in `NSJSONSerialization`, or an array containing one element for each managed
+ property. An exception will be thrown if any required properties are not present and those properties were not defined
+ with default values.
+
+ When passing in an array as the `value` argument, all properties must be present, valid and in the same order as the
+ properties defined in the model.
+
+ @param realm    The Realm which should own the object.
+ @param value    The value used to populate the object.
+
+ @see   `defaultPropertyValues`, `primaryKey`
+ */
++ (instancetype)createOrUpdateInRealm:(RLMRealm *)realm withValue:(id)value;
+
+#pragma mark - Properties
+
+/**
+ The Realm which manages the object, or `nil` if the object is unmanaged.
+ */
+@property (nonatomic, readonly, nullable) RLMRealm *realm;
+
+/**
+ The object schema which lists the managed properties for the object.
+ */
+@property (nonatomic, readonly) RLMObjectSchema *objectSchema;
+
+/**
+ Indicates if the object can no longer be accessed because it is now invalid.
+
+ An object can no longer be accessed if the object has been deleted from the Realm that manages it, or
+ if `invalidate` is called on that Realm.
+ */
+@property (nonatomic, readonly, getter = isInvalidated) BOOL invalidated;
+
+
+#pragma mark - Customizing your Objects
+
+/**
+ Returns an array of property names for properties which should be indexed.
+
+ Only string, integer, boolean, and `NSDate` properties are supported.
+
+ @return    An array of property names.
+ */
++ (NSArray<NSString *> *)indexedProperties;
+
+/**
+ Override this method to specify the default values to be used for each property.
+
+ @return    A dictionary mapping property names to their default values.
+ */
++ (nullable NSDictionary *)defaultPropertyValues;
+
+/**
+ Override this method to specify the name of a property to be used as the primary key.
+
+ Only properties of types `RLMPropertyTypeString` and `RLMPropertyTypeInt` can be designated as the primary key.
+ Primary key properties enforce uniqueness for each value whenever the property is set, which incurs minor overhead.
+ Indexes are created automatically for primary key properties.
+
+ @return    The name of the property designated as the primary key.
+ */
++ (nullable NSString *)primaryKey;
+
+/**
+ Override this method to specify the names of properties to ignore. These properties will not be managed by the Realm
+ that manages the object.
+
+ @return    An array of property names to ignore.
+ */
++ (nullable NSArray<NSString *> *)ignoredProperties;
+
+/**
+ Override this method to specify the names of properties that are non-optional (i.e. cannot be assigned a `nil` value).
+
+ By default, all properties of a type whose values can be set to `nil` are considered optional properties.
+ To require that an object in a Realm always store a non-`nil` value for a property,
+ add the name of the property to the array returned from this method.
+
+ Properties of `RLMObject` type cannot be non-optional. Array and `NSNumber` properties
+ can be non-optional, but there is no reason to do so: arrays do not support storing nil, and
+ if you want a non-optional number you should instead use the primitive type.
+
+ @return    An array of property names that are required.
+ */
++ (NSArray<NSString *> *)requiredProperties;
+
+/**
+ Override this method to provide information related to properties containing linking objects.
+
+ Each property of type `RLMLinkingObjects` must have a key in the dictionary returned by this method consisting
+ of the property name. The corresponding value must be an instance of `RLMPropertyDescriptor` that describes the class
+ and property that the property is linked to.
+
+     return @{ @"owners": [RLMPropertyDescriptor descriptorWithClass:Owner.class propertyName:@"dogs"] };
+
+ @return     A dictionary mapping property names to `RLMPropertyDescriptor` instances.
+ */
++ (NSDictionary<NSString *, RLMPropertyDescriptor *> *)linkingObjectsProperties;
+
+
+#pragma mark - Getting & Querying Objects from the Default Realm
+
+/**
+ Returns all objects of this object type from the default Realm.
+
+ @return    An `RLMResults` containing all objects of this type in the default Realm.
+ */
++ (RLMResults *)allObjects;
+
+/**
+ Returns all objects of this object type matching the given predicate from the default Realm.
+
+ @param predicateFormat A predicate format string, optionally followed by a variable number of arguments.
+
+ @return    An `RLMResults` containing all objects of this type in the default Realm that match the given predicate.
+ */
++ (RLMResults *)objectsWhere:(NSString *)predicateFormat, ...;
+
+/// :nodoc:
++ (RLMResults *)objectsWhere:(NSString *)predicateFormat args:(va_list)args;
+
+
+/**
+ Returns all objects of this object type matching the given predicate from the default Realm.
+
+ @param predicate   The predicate with which to filter the objects.
+
+ @return    An `RLMResults` containing all objects of this type in the default Realm that match the given predicate.
+ */
++ (RLMResults *)objectsWithPredicate:(nullable NSPredicate *)predicate;
+
+/**
+ Retrieves the single instance of this object type with the given primary key from the default Realm.
+
+ Returns the object from the default Realm which has the given primary key, or
+ `nil` if the object does not exist. This is slightly faster than the otherwise
+ equivalent `[[SubclassName objectsWhere:@"primaryKeyPropertyName = %@", key] firstObject]`.
+
+ This method requires that `primaryKey` be overridden on the receiving subclass.
+
+ @return    An object of this object type, or `nil` if an object with the given primary key does not exist.
+ @see       `-primaryKey`
+ */
++ (nullable instancetype)objectForPrimaryKey:(nullable id)primaryKey;
+
+
+#pragma mark - Querying Specific Realms
+
+/**
+ Returns all objects of this object type from the specified Realm.
+
+ @param realm   The Realm to query.
+
+ @return        An `RLMResults` containing all objects of this type in the specified Realm.
+ */
++ (RLMResults *)allObjectsInRealm:(RLMRealm *)realm;
+
+/**
+ Returns all objects of this object type matching the given predicate from the specified Realm.
+
+ @param predicateFormat A predicate format string, optionally followed by a variable number of arguments.
+ @param realm           The Realm to query.
+
+ @return    An `RLMResults` containing all objects of this type in the specified Realm that match the given predicate.
+ */
++ (RLMResults *)objectsInRealm:(RLMRealm *)realm where:(NSString *)predicateFormat, ...;
+
+/// :nodoc:
++ (RLMResults *)objectsInRealm:(RLMRealm *)realm where:(NSString *)predicateFormat args:(va_list)args;
+
+/**
+ Returns all objects of this object type matching the given predicate from the specified Realm.
+
+ @param predicate   A predicate to use to filter the elements.
+ @param realm       The Realm to query.
+
+ @return    An `RLMResults` containing all objects of this type in the specified Realm that match the given predicate.
+ */
++ (RLMResults *)objectsInRealm:(RLMRealm *)realm withPredicate:(nullable NSPredicate *)predicate;
+
+/**
+ Retrieves the single instance of this object type with the given primary key from the specified Realm.
+
+ Returns the object from the specified Realm which has the given primary key, or
+ `nil` if the object does not exist. This is slightly faster than the otherwise
+ equivalent `[[SubclassName objectsInRealm:realm where:@"primaryKeyPropertyName = %@", key] firstObject]`.
+
+ This method requires that `primaryKey` be overridden on the receiving subclass.
+
+ @return    An object of this object type, or `nil` if an object with the given primary key does not exist.
+ @see       `-primaryKey`
+ */
++ (nullable instancetype)objectInRealm:(RLMRealm *)realm forPrimaryKey:(nullable id)primaryKey;
+
+#pragma mark - Notifications
+
+/**
+ A callback block for `RLMObject` notifications.
+
+ If the object is deleted from the managing Realm, the block is called with
+ `deleted` set to `YES` and the other two arguments are `nil`. The block will
+ never be called again after this.
+
+ If the object is modified, the block will be called with `deleted` set to
+ `NO`, a `nil` error, and an array of `RLMPropertyChange` objects which
+ indicate which properties of the objects were modified.
+
+ If an error occurs, `deleted` will be `NO`, `changes` will be `nil`, and
+ `error` will include information about the error. The block will never be
+ called again after an error occurs.
+ */
+typedef void (^RLMObjectChangeBlock)(BOOL deleted,
+                                     NSArray<RLMPropertyChange *> *_Nullable changes,
+                                     NSError *_Nullable error);
+
+/**
+ Registers a block to be called each time the object changes.
+
+ The block will be asynchronously called after each write transaction which
+ deletes the object or modifies any of the managed properties of the object,
+ including self-assignments that set a property to its existing value.
+
+ For write transactions performed on different threads or in differen
+ processes, the block will be called when the managing Realm is
+ (auto)refreshed to a version including the changes, while for local write
+ transactions it will be called at some point in the future after the write
+ transaction is committed.
+
+ Notifications are delivered via the standard run loop, and so can't be
+ delivered while the run loop is blocked by other activity. When notifications
+ can't be delivered instantly, multiple notifications may be coalesced into a
+ single notification.
+
+ Unlike with `RLMArray` and `RLMResults`, there is no "initial" callback made
+ after you add a new notification block.
+
+ Only objects which are managed by a Realm can be observed in this way. You
+ must retain the returned token for as long as you want updates to be sent to
+ the block. To stop receiving updates, call `stop` on the token.
+
+ It is safe to capture a strong reference to the observed object within the
+ callback block. There is no retain cycle due to that the callback is retained
+ by the returned token and not by the object itself.
+
+ @warning This method cannot be called during a write transaction, when the
+          containing Realm is read-only, or on an unmanaged object.
+
+ @param block The block to be called whenever a change occurs.
+ @return A token which must be held for as long as you want updates to be delivered.
+ */
+- (RLMNotificationToken *)addNotificationBlock:(RLMObjectChangeBlock)block;
+
+#pragma mark - Other Instance Methods
+
+/**
+ Returns YES if another Realm object instance points to the same object as the receiver in the Realm managing
+ the receiver.
+
+ For object types with a primary, key, `isEqual:` is overridden to use this method (along with a corresponding
+ implementation for `hash`).
+
+ @param object  The object to compare the receiver to.
+
+ @return    Whether the object represents the same object as the receiver.
+ */
+- (BOOL)isEqualToObject:(RLMObject *)object;
+
+#pragma mark - Dynamic Accessors
+
+/// :nodoc:
+- (nullable id)objectForKeyedSubscript:(NSString *)key;
+
+/// :nodoc:
+- (void)setObject:(nullable id)obj forKeyedSubscript:(NSString *)key;
+
+@end
+
+/**
+ Information about a specific property which changed in an `RLMObject` change notification.
+ */
+@interface RLMPropertyChange : NSObject
+
+/**
+ The name of the property which changed.
+ */
+@property (nonatomic, readonly, strong) NSString *name;
+
+/**
+ The value of the property before the change occurred. This will always be `nil`
+ if the change happened on the same thread as the notification and for `RLMArray`
+ properties.
+
+ For object properties this will give the object which was previously linked to,
+ but that object will have its new values and not the values it had before the
+ changes. This means that `previousValue` may be a deleted object, and you will
+ need to check `invalidated` before accessing any of its properties.
+ */
+@property (nonatomic, readonly, strong, nullable) id previousValue;
+
+/**
+ The value of the property after the change occurred. This will always be `nil`
+ for `RLMArray` properties.
+ */
+@property (nonatomic, readonly, strong, nullable) id value;
+@end
+
+#pragma mark - RLMArray Property Declaration
+
+/**
+ Properties on `RLMObject`s of type `RLMArray` must have an associated type. A type is associated
+ with an `RLMArray` property by defining a protocol for the object type that the array should contain.
+ To define the protocol for an object, you can use the macro RLM_ARRAY_TYPE:
+
+     RLM_ARRAY_TYPE(ObjectType)
+     ...
+     @property RLMArray<ObjectType *><ObjectType> *arrayOfObjectTypes;
+  */
+#define RLM_ARRAY_TYPE(RLM_OBJECT_SUBCLASS)\
+@protocol RLM_OBJECT_SUBCLASS <NSObject>   \
+@end
+
+NS_ASSUME_NONNULL_END

+ 43 - 0
Libraries external/Realm/Realm.framework/Headers/RLMObjectBase.h

@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMRealm;
+@class RLMSchema;
+@class RLMObjectSchema;
+
+/// :nodoc:
+@interface RLMObjectBase : NSObject
+
+@property (nonatomic, readonly, getter = isInvalidated) BOOL invalidated;
+
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
++ (NSString *)className;
+
+// Returns whether the class is included in the default set of classes managed by a Realm.
++ (BOOL)shouldIncludeInDefaultSchema;
+
++ (nullable NSString *)_realmObjectName;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 82 - 0
Libraries external/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h

@@ -0,0 +1,82 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMObject.h>
+
+@class RLMObjectSchema, RLMRealm;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ Returns the Realm that manages the object, if one exists.
+ 
+ @warning  This function is useful only in specialized circumstances, for example, when building components
+           that integrate with Realm. If you are simply building an app on Realm, it is
+           recommended to retrieve the Realm that manages the object via `RLMObject`.
+
+ @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
+ 
+ @return The Realm which manages this object. Returns `nil `for unmanaged objects.
+ */
+FOUNDATION_EXTERN RLMRealm * _Nullable RLMObjectBaseRealm(RLMObjectBase * _Nullable object);
+
+/**
+ Returns an `RLMObjectSchema` which describes the managed properties of the object.
+ 
+ @warning  This function is useful only in specialized circumstances, for example, when building components
+           that integrate with Realm. If you are simply building an app on Realm, it is
+           recommended to retrieve `objectSchema` via `RLMObject`.
+
+ @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
+ 
+ @return The object schema which lists the managed properties for the object.
+ */
+FOUNDATION_EXTERN RLMObjectSchema * _Nullable RLMObjectBaseObjectSchema(RLMObjectBase * _Nullable object);
+
+/**
+ Returns the object corresponding to a key value.
+
+ @warning  This function is useful only in specialized circumstances, for example, when building components
+           that integrate with Realm. If you are simply building an app on Realm, it is
+           recommended to retrieve key values via `RLMObject`.
+
+ @warning Will throw an `NSUndefinedKeyException` if `key` is not present on the object.
+ 
+ @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
+ @param key		The name of the property.
+ 
+ @return The object for the property requested.
+ */
+FOUNDATION_EXTERN id _Nullable RLMObjectBaseObjectForKeyedSubscript(RLMObjectBase * _Nullable object, NSString *key);
+
+/**
+ Sets a value for a key on the object.
+ 
+ @warning  This function is useful only in specialized circumstances, for example, when building components
+           that integrate with Realm. If you are simply building an app on Realm, it is
+           recommended to set key values via `RLMObject`.
+
+ @warning Will throw an `NSUndefinedKeyException` if `key` is not present on the object.
+ 
+ @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
+ @param key		The name of the property.
+ @param obj		The object to set as the value of the key.
+ */
+FOUNDATION_EXTERN void RLMObjectBaseSetObjectForKeyedSubscript(RLMObjectBase * _Nullable object, NSString *key, id _Nullable obj);
+
+NS_ASSUME_NONNULL_END

+ 72 - 0
Libraries external/Realm/Realm.framework/Headers/RLMObjectSchema.h

@@ -0,0 +1,72 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMProperty;
+
+/**
+ This class represents Realm model object schemas.
+
+ When using Realm, `RLMObjectSchema` instances allow performing migrations and
+ introspecting the database's schema.
+
+ Object schemas map to tables in the core database.
+ */
+@interface RLMObjectSchema : NSObject<NSCopying>
+
+#pragma mark - Properties
+
+/**
+ An array of `RLMProperty` instances representing the managed properties of a class described by the schema.
+ 
+ @see `RLMProperty`
+ */
+@property (nonatomic, readonly, copy) NSArray<RLMProperty *> *properties;
+
+/**
+ The name of the class the schema describes.
+ */
+@property (nonatomic, readonly) NSString *className;
+
+/**
+ The property which serves as the primary key for the class the schema describes, if any.
+ */
+@property (nonatomic, readonly, nullable) RLMProperty *primaryKeyProperty;
+
+#pragma mark - Methods
+
+/**
+ Retrieves an `RLMProperty` object by the property name.
+ 
+ @param propertyName The property's name.
+ 
+ @return An `RLMProperty` object, or `nil` if there is no property with the given name.
+ */
+- (nullable RLMProperty *)objectForKeyedSubscript:(NSString *)propertyName;
+
+/**
+ Returns whether two `RLMObjectSchema` instances are equal.
+ */
+- (BOOL)isEqualToObjectSchema:(RLMObjectSchema *)objectSchema;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 22 - 0
Libraries external/Realm/Realm.framework/Headers/RLMPlatform.h

@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#if !TARGET_OS_IPHONE
+#error Attempting to use Realm's iOS framework in an OSX project.
+#endif
+

+ 121 - 0
Libraries external/Realm/Realm.framework/Headers/RLMProperty.h

@@ -0,0 +1,121 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+#import <Realm/RLMConstants.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// :nodoc:
+@protocol RLMInt
+@end
+
+/// :nodoc:
+@protocol RLMBool
+@end
+
+/// :nodoc:
+@protocol RLMDouble
+@end
+
+/// :nodoc:
+@protocol RLMFloat
+@end
+
+/// :nodoc:
+@interface NSNumber ()<RLMInt, RLMBool, RLMDouble, RLMFloat>
+@end
+
+/**
+ `RLMProperty` instances represent properties managed by a Realm in the context of an object schema. Such properties may
+ be persisted to a Realm file or computed from other data from the Realm.
+ 
+ When using Realm, `RLMProperty` instances allow performing migrations and introspecting the database's schema.
+ 
+ These property instances map to columns in the core database.
+ */
+@interface RLMProperty : NSObject
+
+#pragma mark - Properties
+
+/**
+ The name of the property.
+ */
+@property (nonatomic, readonly) NSString *name;
+
+/**
+ The type of the property.
+ 
+ @see `RLMPropertyType`
+ */
+@property (nonatomic, readonly) RLMPropertyType type;
+
+/**
+ Indicates whether this property is indexed.
+ 
+ @see `RLMObject`
+ */
+@property (nonatomic, readonly) BOOL indexed;
+
+/**
+ For `RLMObject` and `RLMArray` properties, the name of the class of object stored in the property.
+ */
+@property (nonatomic, readonly, copy, nullable) NSString *objectClassName;
+
+/**
+ For linking objects properties, the property name of the property the linking objects property is linked to.
+ */
+@property (nonatomic, readonly, copy, nullable) NSString *linkOriginPropertyName;
+
+/**
+ Indicates whether this property is optional.
+ */
+@property (nonatomic, readonly) BOOL optional;
+
+#pragma mark - Methods
+
+/**
+ Returns whether a given property object is equal to the receiver.
+ */
+- (BOOL)isEqualToProperty:(RLMProperty *)property;
+
+@end
+
+
+/**
+ An `RLMPropertyDescriptor` instance represents a specific property on a given class.
+ */
+@interface RLMPropertyDescriptor : NSObject
+
+/**
+ Creates and returns a property descriptor.
+
+ @param objectClass  The class of this property descriptor.
+ @param propertyName The name of this property descriptor.
+ */
++ (instancetype)descriptorWithClass:(Class)objectClass propertyName:(NSString *)propertyName;
+
+/// The class of the property.
+@property (nonatomic, readonly) Class objectClass;
+
+/// The name of the property.
+@property (nonatomic, readonly) NSString *propertyName;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 652 - 0
Libraries external/Realm/Realm.framework/Headers/RLMRealm.h

@@ -0,0 +1,652 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+#import "RLMConstants.h"
+
+@class RLMRealmConfiguration, RLMRealm, RLMObject, RLMSchema, RLMMigration, RLMNotificationToken, RLMThreadSafeReference;
+
+/**
+ A callback block for opening Realms asynchronously.
+
+ Returns the Realm if the open was successful, or an error otherwise.
+ */
+typedef void(^RLMAsyncOpenRealmCallback)(RLMRealm * _Nullable realm, NSError * _Nullable error);
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ An `RLMRealm` instance (also referred to as "a Realm") represents a Realm
+ database.
+
+ Realms can either be stored on disk (see `+[RLMRealm realmWithURL:]`) or in
+ memory (see `RLMRealmConfiguration`).
+
+ `RLMRealm` instances are cached internally, and constructing equivalent `RLMRealm`
+ objects (for example, by using the same path or identifier) multiple times on a single thread
+ within a single iteration of the run loop will normally return the same
+ `RLMRealm` object.
+
+ If you specifically want to ensure an `RLMRealm` instance is
+ destroyed (for example, if you wish to open a Realm, check some property, and
+ then possibly delete the Realm file and re-open it), place the code which uses
+ the Realm within an `@autoreleasepool {}` and ensure you have no other
+ strong references to it.
+
+ @warning `RLMRealm` instances are not thread safe and cannot be shared across
+ threads or dispatch queues. Trying to do so will cause an exception to be thrown.
+ You must call this method on each thread you want
+ to interact with the Realm on. For dispatch queues, this means that you must
+ call it in each block which is dispatched, as a queue is not guaranteed to run
+ all of its blocks on the same thread.
+ */
+
+@interface RLMRealm : NSObject
+
+#pragma mark - Creating & Initializing a Realm
+
+/**
+ Obtains an instance of the default Realm.
+
+ The default Realm is used by the `RLMObject` class methods
+ which do not take an `RLMRealm` parameter, but is otherwise not special. The
+ default Realm is persisted as *default.realm* under the *Documents* directory of
+ your Application on iOS, and in your application's *Application Support*
+ directory on OS X.
+
+ The default Realm is created using the default `RLMRealmConfiguration`, which
+ can be changed via `+[RLMRealmConfiguration setDefaultConfiguration:]`.
+
+ @return The default `RLMRealm` instance for the current thread.
+ */
++ (instancetype)defaultRealm;
+
+/**
+ Obtains an `RLMRealm` instance with the given configuration.
+
+ @param configuration A configuration object to use when creating the Realm.
+ @param error         If an error occurs, upon return contains an `NSError` object
+                      that describes the problem. If you are not interested in
+                      possible errors, pass in `NULL`.
+
+ @return An `RLMRealm` instance.
+ */
++ (nullable instancetype)realmWithConfiguration:(RLMRealmConfiguration *)configuration error:(NSError **)error;
+
+/**
+ Obtains an `RLMRealm` instance persisted at a specified file URL.
+
+ @param fileURL The local URL of the file the Realm should be saved at.
+
+ @return An `RLMRealm` instance.
+ */
++ (instancetype)realmWithURL:(NSURL *)fileURL;
+
+/**
+ Asynchronously open a Realm and deliver it to a block on the given queue.
+
+ Opening a Realm asynchronously will perform all work needed to get the Realm to
+ a usable state (such as running potentially time-consuming migrations) on a
+ background thread before dispatching to the given queue. In addition,
+ synchronized Realms wait for all remote content available at the time the
+ operation began to be downloaded and available locally.
+
+ @param configuration A configuration object to use when opening the Realm.
+ @param callbackQueue The dispatch queue on which the callback should be run.
+ @param callback      A callback block. If the Realm was successfully opened,
+                      it will be passed in as an argument.
+                      Otherwise, an `NSError` describing what went wrong will be
+                      passed to the block instead.
+
+ @note The returned Realm is confined to the thread on which it was created.
+       Because GCD does not guarantee that queues will always use the same
+       thread, accessing the returned Realm outside the callback block (even if
+       accessed from `callbackQueue`) is unsafe.
+ */
++ (void)asyncOpenWithConfiguration:(RLMRealmConfiguration *)configuration
+                     callbackQueue:(dispatch_queue_t)callbackQueue
+                          callback:(RLMAsyncOpenRealmCallback)callback;
+
+/**
+ The `RLMSchema` used by the Realm.
+ */
+@property (nonatomic, readonly) RLMSchema *schema;
+
+/**
+ Indicates if the Realm is currently engaged in a write transaction.
+
+ @warning   Do not simply check this property and then start a write transaction whenever an object needs to be
+            created, updated, or removed. Doing so might cause a large number of write transactions to be created,
+            degrading performance. Instead, always prefer performing multiple updates during a single transaction.
+ */
+@property (nonatomic, readonly) BOOL inWriteTransaction;
+
+/**
+ The `RLMRealmConfiguration` object that was used to create this `RLMRealm` instance.
+ */
+@property (nonatomic, readonly) RLMRealmConfiguration *configuration;
+
+/**
+ Indicates if this Realm contains any objects.
+ */
+@property (nonatomic, readonly) BOOL isEmpty;
+
+#pragma mark - Notifications
+
+/**
+ The type of a block to run whenever the data within the Realm is modified.
+
+ @see `-[RLMRealm addNotificationBlock:]`
+ */
+typedef void (^RLMNotificationBlock)(RLMNotification notification, RLMRealm *realm);
+
+#pragma mark - Receiving Notification when a Realm Changes
+
+/**
+ Adds a notification handler for changes in this Realm, and returns a notification token.
+
+ Notification handlers are called after each write transaction is committed,
+ either on the current thread or other threads.
+
+ Handler blocks are called on the same thread that they were added on, and may
+ only be added on threads which are currently within a run loop. Unless you are
+ specifically creating and running a run loop on a background thread, this will
+ normally only be the main thread.
+
+ The block has the following definition:
+
+     typedef void(^RLMNotificationBlock)(RLMNotification notification, RLMRealm *realm);
+
+ It receives the following parameters:
+
+ - `NSString` \***notification**:    The name of the incoming notification. See
+                                     `RLMRealmNotification` for information on what
+                                     notifications are sent.
+ - `RLMRealm` \***realm**:           The Realm for which this notification occurred.
+
+ @param block   A block which is called to process Realm notifications.
+
+ @return A token object which must be retained as long as you wish to continue
+         receiving change notifications.
+ */
+- (RLMNotificationToken *)addNotificationBlock:(RLMNotificationBlock)block __attribute__((warn_unused_result));
+
+#pragma mark - Transactions
+
+
+#pragma mark - Writing to a Realm
+
+/**
+ Begins a write transaction on the Realm.
+
+ Only one write transaction can be open at a time for each Realm file. Write
+ transactions cannot be nested, and trying to begin a write transaction on a
+ Realm which is already in a write transaction will throw an exception. Calls to
+ `beginWriteTransaction` from `RLMRealm` instances for the same Realm file in
+ other threads or other processes will block until the current write transaction
+ completes or is cancelled.
+
+ Before beginning the write transaction, `beginWriteTransaction` updates the
+ `RLMRealm` instance to the latest Realm version, as if `refresh` had been
+ called, and generates notifications if applicable. This has no effect if the
+ Realm was already up to date.
+
+ It is rarely a good idea to have write transactions span multiple cycles of
+ the run loop, but if you do wish to do so you will need to ensure that the
+ Realm participating in the write transaction is kept alive until the write
+ transaction is committed.
+ */
+- (void)beginWriteTransaction;
+
+/**
+ Commits all write operations in the current write transaction, and ends the
+ transaction.
+
+ After saving the changes, all notification blocks registered on this specific
+ `RLMRealm` instance are invoked synchronously. Notification blocks registered
+ on other threads or on collections are invoked asynchronously. If you do not
+ want to receive a specific notification for this write tranaction, see
+ `commitWriteTransactionWithoutNotifying:error:`.
+
+ This method can fail if there is insufficient disk space available to save the
+ writes made, or due to unexpected i/o errors. This version of the method throws
+ an exception when errors occur. Use the version with a `NSError` out parameter
+ instead if you wish to handle errors.
+
+ @warning This method may only be called during a write transaction.
+ */
+- (void)commitWriteTransaction NS_SWIFT_UNAVAILABLE("");
+
+/**
+ Commits all write operations in the current write transaction, and ends the
+ transaction.
+
+ After saving the changes, all notification blocks registered on this specific
+ `RLMRealm` instance are invoked synchronously. Notification blocks registered
+ on other threads or on collections are invoked asynchronously. If you do not
+ want to receive a specific notification for this write tranaction, see
+ `commitWriteTransactionWithoutNotifying:error:`.
+
+ This method can fail if there is insufficient disk space available to save the
+ writes made, or due to unexpected i/o errors.
+
+ @warning This method may only be called during a write transaction.
+
+ @param error If an error occurs, upon return contains an `NSError` object
+              that describes the problem. If you are not interested in
+              possible errors, pass in `NULL`.
+
+ @return Whether the transaction succeeded.
+ */
+- (BOOL)commitWriteTransaction:(NSError **)error;
+
+/**
+ Commits all write operations in the current write transaction, without
+ notifying specific notification blocks of the changes.
+
+ After saving the changes, all notification blocks registered on this specific
+ `RLMRealm` instance are invoked synchronously. Notification blocks registered
+ on other threads or on collections are scheduled to be invoked asynchronously.
+
+ You can skip notifiying specific notification blocks about the changes made
+ in this write transaction by passing in their associated notification tokens.
+ This is primarily useful when the write transaction is saving changes already
+ made in the UI and you do not want to have the notification block attempt to
+ re-apply the same changes.
+
+ The tokens passed to this method must be for notifications for this specific
+ `RLMRealm` instance. Notifications for different threads cannot be skipped
+ using this method.
+
+ This method can fail if there is insufficient disk space available to save the
+ writes made, or due to unexpected i/o errors.
+
+ @warning This method may only be called during a write transaction.
+
+ @param tokens An array of notification tokens which were returned from adding
+               callbacks which you do not want to be notified for the changes
+               made in this write transaction.
+ @param error If an error occurs, upon return contains an `NSError` object
+              that describes the problem. If you are not interested in
+              possible errors, pass in `NULL`.
+
+ @return Whether the transaction succeeded.
+ */
+- (BOOL)commitWriteTransactionWithoutNotifying:(NSArray<RLMNotificationToken *> *)tokens error:(NSError **)error;
+
+/**
+ Reverts all writes made during the current write transaction and ends the transaction.
+
+ This rolls back all objects in the Realm to the state they were in at the
+ beginning of the write transaction, and then ends the transaction.
+
+ This restores the data for deleted objects, but does not revive invalidated
+ object instances. Any `RLMObject`s which were added to the Realm will be
+ invalidated rather than becoming unmanaged.
+ Given the following code:
+
+     ObjectType *oldObject = [[ObjectType objectsWhere:@"..."] firstObject];
+     ObjectType *newObject = [[ObjectType alloc] init];
+
+     [realm beginWriteTransaction];
+     [realm addObject:newObject];
+     [realm deleteObject:oldObject];
+     [realm cancelWriteTransaction];
+
+ Both `oldObject` and `newObject` will return `YES` for `isInvalidated`,
+ but re-running the query which provided `oldObject` will once again return
+ the valid object.
+
+ KVO observers on any objects which were modified during the transaction will
+ be notified about the change back to their initial values, but no other
+ notifcations are produced by a cancelled write transaction.
+
+ @warning This method may only be called during a write transaction.
+ */
+- (void)cancelWriteTransaction;
+
+/**
+ Performs actions contained within the given block inside a write transaction.
+
+ @see `[RLMRealm transactionWithBlock:error:]`
+ */
+- (void)transactionWithBlock:(__attribute__((noescape)) void(^)(void))block NS_SWIFT_UNAVAILABLE("");
+
+/**
+ Performs actions contained within the given block inside a write transaction.
+
+ Write transactions cannot be nested, and trying to execute a write transaction
+ on a Realm which is already participating in a write transaction will throw an
+ exception. Calls to `transactionWithBlock:` from `RLMRealm` instances in other
+ threads will block until the current write transaction completes.
+
+ Before beginning the write transaction, `transactionWithBlock:` updates the
+ `RLMRealm` instance to the latest Realm version, as if `refresh` had been called, and
+ generates notifications if applicable. This has no effect if the Realm
+ was already up to date.
+
+ @param block The block containing actions to perform.
+ @param error If an error occurs, upon return contains an `NSError` object
+              that describes the problem. If you are not interested in
+              possible errors, pass in `NULL`.
+
+ @return Whether the transaction succeeded.
+ */
+- (BOOL)transactionWithBlock:(__attribute__((noescape)) void(^)(void))block error:(NSError **)error;
+
+/**
+ Updates the Realm and outstanding objects managed by the Realm to point to the
+ most recent data.
+
+ If the version of the Realm is actually changed, Realm and collection
+ notifications will be sent to reflect the changes. This may take some time, as
+ collection notifications are prepared on a background thread. As a result,
+ calling this method on the main thread is not advisable.
+
+ @return Whether there were any updates for the Realm. Note that `YES` may be
+         returned even if no data actually changed.
+ */
+- (BOOL)refresh;
+
+/**
+ Set this property to `YES` to automatically update this Realm when changes
+ happen in other threads.
+
+ If set to `YES` (the default), changes made on other threads will be reflected
+ in this Realm on the next cycle of the run loop after the changes are
+ committed.  If set to `NO`, you must manually call `-refresh` on the Realm to
+ update it to get the latest data.
+
+ Note that by default, background threads do not have an active run loop and you
+ will need to manually call `-refresh` in order to update to the latest version,
+ even if `autorefresh` is set to `YES`.
+
+ Even with this property enabled, you can still call `-refresh` at any time to
+ update the Realm before the automatic refresh would occur.
+
+ Write transactions will still always advance a Realm to the latest version and
+ produce local notifications on commit even if autorefresh is disabled.
+
+ Disabling `autorefresh` on a Realm without any strong references to it will not
+ have any effect, and `autorefresh` will revert back to `YES` the next time the
+ Realm is created. This is normally irrelevant as it means that there is nothing
+ to refresh (as managed `RLMObject`s, `RLMArray`s, and `RLMResults` have strong
+ references to the Realm that manages them), but it means that setting
+ `RLMRealm.defaultRealm.autorefresh = NO` in
+ `application:didFinishLaunchingWithOptions:` and only later storing Realm
+ objects will not work.
+
+ Defaults to `YES`.
+ */
+@property (nonatomic) BOOL autorefresh;
+
+/**
+ Writes a compacted and optionally encrypted copy of the Realm to the given local URL.
+
+ The destination file cannot already exist.
+
+ Note that if this method is called from within a write transaction, the
+ *current* data is written, not the data from the point when the previous write
+ transaction was committed.
+
+ @param fileURL Local URL to save the Realm to.
+ @param key     Optional 64-byte encryption key to encrypt the new file with.
+ @param error   If an error occurs, upon return contains an `NSError` object
+                that describes the problem. If you are not interested in
+                possible errors, pass in `NULL`.
+
+ @return `YES` if the Realm was successfully written to disk, `NO` if an error occurred.
+*/
+- (BOOL)writeCopyToURL:(NSURL *)fileURL encryptionKey:(nullable NSData *)key error:(NSError **)error;
+
+/**
+ Invalidates all `RLMObject`s, `RLMResults`, `RLMLinkingObjects`, and `RLMArray`s managed by the Realm.
+
+ A Realm holds a read lock on the version of the data accessed by it, so
+ that changes made to the Realm on different threads do not modify or delete the
+ data seen by this Realm. Calling this method releases the read lock,
+ allowing the space used on disk to be reused by later write transactions rather
+ than growing the file. This method should be called before performing long
+ blocking operations on a background thread on which you previously read data
+ from the Realm which you no longer need.
+
+ All `RLMObject`, `RLMResults` and `RLMArray` instances obtained from this
+ `RLMRealm` instance on the current thread are invalidated. `RLMObject`s and `RLMArray`s
+ cannot be used. `RLMResults` will become empty. The Realm itself remains valid,
+ and a new read transaction is implicitly begun the next time data is read from the Realm.
+
+ Calling this method multiple times in a row without reading any data from the
+ Realm, or before ever reading any data from the Realm, is a no-op. This method
+ may not be called on a read-only Realm.
+ */
+- (void)invalidate;
+
+#pragma mark - Accessing Objects
+
+/**
+ Returns the same object as the one referenced when the `RLMThreadSafeReference` was first created,
+ but resolved for the current Realm for this thread. Returns `nil` if this object was deleted after
+ the reference was created.
+
+ @param reference The thread-safe reference to the thread-confined object to resolve in this Realm.
+
+ @warning A `RLMThreadSafeReference` object must be resolved at most once.
+          Failing to resolve a `RLMThreadSafeReference` will result in the source version of the
+          Realm being pinned until the reference is deallocated.
+          An exception will be thrown if a reference is resolved more than once.
+
+ @warning Cannot call within a write transaction.
+
+ @note Will refresh this Realm if the source Realm was at a later version than this one.
+
+ @see `+[RLMThreadSafeReference referenceWithThreadConfined:]`
+ */
+- (nullable id)resolveThreadSafeReference:(RLMThreadSafeReference *)reference
+NS_REFINED_FOR_SWIFT;
+
+#pragma mark - Adding and Removing Objects from a Realm
+
+/**
+ Adds an object to the Realm.
+
+ Once added, this object is considered to be managed by the Realm. It can be retrieved
+ using the `objectsWhere:` selectors on `RLMRealm` and on subclasses of `RLMObject`.
+
+ When added, all child relationships referenced by this object will also be added to
+ the Realm if they are not already in it.
+
+ If the object or any related objects are already being managed by a different Realm
+ an exception will be thrown. Use `-[RLMObject createInRealm:withObject:]` to insert a copy of a managed object
+ into a different Realm.
+
+ The object to be added must be valid and cannot have been previously deleted
+ from a Realm (i.e. `isInvalidated` must be `NO`).
+
+ @warning This method may only be called during a write transaction.
+
+ @param object  The object to be added to this Realm.
+ */
+- (void)addObject:(RLMObject *)object;
+
+/**
+ Adds all the objects in a collection to the Realm.
+
+ This is the equivalent of calling `addObject:` for every object in a collection.
+
+ @warning This method may only be called during a write transaction.
+
+ @param array   An enumerable object such as `NSArray` or `RLMResults` which contains objects to be added to
+                the Realm.
+
+ @see   `addObject:`
+ */
+- (void)addObjects:(id<NSFastEnumeration>)array;
+
+/**
+ Adds or updates an existing object into the Realm.
+
+ The object provided must have a designated primary key. If no objects exist in the Realm
+ with the same primary key value, the object is inserted. Otherwise, the existing object is
+ updated with any changed values.
+
+ As with `addObject:`, the object cannot already be managed by a different
+ Realm. Use `-[RLMObject createOrUpdateInRealm:withValue:]` to copy values to
+ a different Realm.
+
+ @warning This method may only be called during a write transaction.
+
+ @param object  The object to be added or updated.
+ */
+- (void)addOrUpdateObject:(RLMObject *)object;
+
+/**
+ Adds or updates all the objects in a collection into the Realm.
+
+ This is the equivalent of calling `addOrUpdateObject:` for every object in a collection.
+
+ @warning This method may only be called during a write transaction.
+
+ @param array  An `NSArray`, `RLMArray`, or `RLMResults` of `RLMObject`s (or subclasses) to be added to the Realm.
+
+ @see   `addOrUpdateObject:`
+ */
+- (void)addOrUpdateObjectsFromArray:(id)array;
+
+/**
+ Deletes an object from the Realm. Once the object is deleted it is considered invalidated.
+
+ @warning This method may only be called during a write transaction.
+
+ @param object  The object to be deleted.
+ */
+- (void)deleteObject:(RLMObject *)object;
+
+/**
+ Deletes one or more objects from the Realm.
+
+ This is the equivalent of calling `deleteObject:` for every object in a collection.
+
+ @warning This method may only be called during a write transaction.
+
+ @param array  An `RLMArray`, `NSArray`, or `RLMResults` of `RLMObject`s (or subclasses) to be deleted.
+
+ @see `deleteObject:`
+ */
+- (void)deleteObjects:(id)array;
+
+/**
+ Deletes all objects from the Realm.
+
+ @warning This method may only be called during a write transaction.
+
+ @see `deleteObject:`
+ */
+- (void)deleteAllObjects;
+
+
+#pragma mark - Migrations
+
+/**
+ The type of a migration block used to migrate a Realm.
+
+ @param migration   A `RLMMigration` object used to perform the migration. The
+                    migration object allows you to enumerate and alter any
+                    existing objects which require migration.
+
+ @param oldSchemaVersion    The schema version of the Realm being migrated.
+ */
+typedef void (^RLMMigrationBlock)(RLMMigration *migration, uint64_t oldSchemaVersion);
+
+/**
+ Returns the schema version for a Realm at a given local URL.
+
+ @param fileURL Local URL to a Realm file.
+ @param key     64-byte key used to encrypt the file, or `nil` if it is unencrypted.
+ @param error   If an error occurs, upon return contains an `NSError` object
+                that describes the problem. If you are not interested in
+                possible errors, pass in `NULL`.
+
+ @return The version of the Realm at `fileURL`, or `RLMNotVersioned` if the version cannot be read.
+ */
++ (uint64_t)schemaVersionAtURL:(NSURL *)fileURL encryptionKey:(nullable NSData *)key error:(NSError **)error
+NS_REFINED_FOR_SWIFT;
+
+/**
+ Performs the given Realm configuration's migration block on a Realm at the given path.
+
+ This method is called automatically when opening a Realm for the first time and does
+ not need to be called explicitly. You can choose to call this method to control
+ exactly when and how migrations are performed.
+
+ @param configuration The Realm configuration used to open and migrate the Realm.
+ @return              The error that occurred while applying the migration, if any.
+
+ @see                 RLMMigration
+ */
++ (nullable NSError *)migrateRealm:(RLMRealmConfiguration *)configuration
+__deprecated_msg("Use `performMigrationForConfiguration:error:`") NS_REFINED_FOR_SWIFT;
+
+/**
+ Performs the given Realm configuration's migration block on a Realm at the given path.
+
+ This method is called automatically when opening a Realm for the first time and does
+ not need to be called explicitly. You can choose to call this method to control
+ exactly when and how migrations are performed.
+
+ @param configuration The Realm configuration used to open and migrate the Realm.
+ @return              The error that occurred while applying the migration, if any.
+
+ @see                 RLMMigration
+ */
++ (BOOL)performMigrationForConfiguration:(RLMRealmConfiguration *)configuration error:(NSError **)error;
+
+#pragma mark - Unavailable Methods
+
+/**
+ RLMRealm instances are cached internally by Realm and cannot be created directly.
+
+ Use `+[RLMRealm defaultRealm]`, `+[RLMRealm realmWithConfiguration:error:]` or
+ `+[RLMRealm realmWithURL]` to obtain a reference to an RLMRealm.
+ */
+- (instancetype)init __attribute__((unavailable("Use +defaultRealm, +realmWithConfiguration: or +realmWithURL:.")));
+
+/**
+ RLMRealm instances are cached internally by Realm and cannot be created directly.
+
+ Use `+[RLMRealm defaultRealm]`, `+[RLMRealm realmWithConfiguration:error:]` or
+ `+[RLMRealm realmWithURL]` to obtain a reference to an RLMRealm.
+ */
++ (instancetype)new __attribute__((unavailable("Use +defaultRealm, +realmWithConfiguration: or +realmWithURL:.")));
+
+@end
+
+/**
+ A token which is returned from methods which subscribe to changes to a Realm.
+
+ Change subscriptions in Realm return an `RLMNotificationToken` instance,
+ which can be used to unsubscribe from the changes. You must store a strong
+ reference to the token for as long as you want to continue to receive notifications.
+ When you wish to stop, call the `-stop` method. Notifications are also stopped if
+ the token is deallocated.
+ */
+@interface RLMNotificationToken : NSObject
+/// Stops notifications for the change subscription that returned this token.
+- (void)stop;
+@end
+
+NS_ASSUME_NONNULL_END

+ 43 - 0
Libraries external/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h

@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMRealmConfiguration.h>
+
+#import "RLMSyncUtil.h"
+
+@class RLMSyncConfiguration;
+
+/// :nodoc:
+@interface RLMRealmConfiguration (Sync)
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ A configuration object representing configuration state for Realms intended
+ to sync with a Realm Object Server.
+ 
+ This property is mutually exclusive with both `inMemoryIdentifier` and `fileURL`;
+ setting any one of the three properties will automatically nil out the other two.
+ 
+ @see `RLMSyncConfiguration`
+ */
+@property (nullable, nonatomic) RLMSyncConfiguration *syncConfiguration;
+
+NS_ASSUME_NONNULL_END
+
+@end

+ 121 - 0
Libraries external/Realm/Realm.framework/Headers/RLMRealmConfiguration.h

@@ -0,0 +1,121 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2015 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+#import <Realm/RLMRealm.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ A block called when opening a Realm for the first time during the life
+ of a process to determine if it should be compacted before being returned
+ to the user. It is passed the total file size (data + free space) and the total
+ bytes used by data in the file.
+
+ Return `YES` to indicate that an attempt to compact the file should be made.
+ The compaction will be skipped if another process is accessing it.
+ */
+typedef BOOL (^RLMShouldCompactOnLaunchBlock)(NSUInteger totalBytes, NSUInteger bytesUsed);
+
+/**
+ An `RLMRealmConfiguration` instance describes the different options used to
+ create an instance of a Realm.
+
+ `RLMRealmConfiguration` instances are just plain `NSObject`s. Unlike `RLMRealm`s
+ and `RLMObject`s, they can be freely shared between threads as long as you do not
+ mutate them.
+ 
+ Creating configuration objects for class subsets (by setting the
+ `objectClasses` property) can be expensive. Because of this, you will normally want to
+ cache and reuse a single configuration object for each distinct configuration rather than 
+ creating a new object each time you open a Realm.
+ */
+@interface RLMRealmConfiguration : NSObject<NSCopying>
+
+#pragma mark - Default Configuration
+
+/**
+ Returns the default configuration used to create Realms when no other
+ configuration is explicitly specified (i.e. `+[RLMRealm defaultRealm]`).
+
+ @return The default Realm configuration.
+ */
++ (instancetype)defaultConfiguration;
+
+/**
+ Sets the default configuration to the given `RLMRealmConfiguration`.
+
+ @param configuration The new default Realm configuration.
+ */
++ (void)setDefaultConfiguration:(RLMRealmConfiguration *)configuration;
+
+#pragma mark - Properties
+
+/// The local URL of the Realm file. Mutually exclusive with `inMemoryIdentifier`.
+@property (nonatomic, copy, nullable) NSURL *fileURL;
+
+/// A string used to identify a particular in-memory Realm. Mutually exclusive with `fileURL`.
+@property (nonatomic, copy, nullable) NSString *inMemoryIdentifier;
+
+/// A 64-byte key to use to encrypt the data, or `nil` if encryption is not enabled.
+@property (nonatomic, copy, nullable) NSData *encryptionKey;
+
+/// Whether to open the Realm in read-only mode.
+///
+/// This is required to be able to open Realm files which are not writeable or
+/// are in a directory which is not writeable. This should only be used on files
+/// which will not be modified by anyone while they are open, and not just to
+/// get a read-only view of a file which may be written to by another thread or
+/// process. Opening in read-only mode requires disabling Realm's reader/writer
+/// coordination, so committing a write transaction from another process will
+/// result in crashes.
+@property (nonatomic) BOOL readOnly;
+
+/// The current schema version.
+@property (nonatomic) uint64_t schemaVersion;
+
+/// The block which migrates the Realm to the current version.
+@property (nonatomic, copy, nullable) RLMMigrationBlock migrationBlock;
+
+/**
+ Whether to recreate the Realm file with the provided schema if a migration is required.
+ This is the case when the stored schema differs from the provided schema or
+ the stored schema version differs from the version on this configuration.
+ Setting this property to `YES` deletes the file if a migration would otherwise be required or executed.
+
+ @note Setting this property to `YES` doesn't disable file format migrations.
+ */
+@property (nonatomic) BOOL deleteRealmIfMigrationNeeded;
+
+/**
+ A block called when opening a Realm for the first time during the life
+ of a process to determine if it should be compacted before being returned
+ to the user. It is passed the total file size (data + free space) and the total
+ bytes used by data in the file.
+
+ Return `YES` to indicate that an attempt to compact the file should be made.
+ The compaction will be skipped if another process is accessing it.
+ */
+@property (nonatomic, copy, nullable) RLMShouldCompactOnLaunchBlock shouldCompactOnLaunch;
+
+/// The classes managed by the Realm.
+@property (nonatomic, copy, nullable) NSArray *objectClasses;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 118 - 0
Libraries external/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h

@@ -0,0 +1,118 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMRealm.h>
+
+#import <Realm/RLMObjectSchema.h>
+#import <Realm/RLMProperty.h>
+
+@class RLMResults;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMRealm (Dynamic)
+
+#pragma mark - Getting Objects from a Realm
+
+/**
+ Returns all objects of a given type from the Realm.
+
+ @warning This method is useful only in specialized circumstances, for example, when building components
+          that integrate with Realm. The preferred way to get objects of a single class is to use the class
+          methods on `RLMObject`.
+
+ @param className   The name of the `RLMObject` subclass to retrieve on (e.g. `MyClass.className`).
+
+ @return    An `RLMResults` containing all objects in the Realm of the given type.
+
+ @see       `+[RLMObject allObjects]`
+ */
+- (RLMResults *)allObjects:(NSString *)className;
+
+/**
+ Returns all objects matching the given predicate from the Realm.
+
+ @warning This method is useful only in specialized circumstances, for example, when building components
+          that integrate with Realm. The preferred way to get objects of a single class is to use the class
+          methods on `RLMObject`.
+
+ @param className       The type of objects you are looking for (name of the class).
+ @param predicateFormat A predicate format string, optionally followed by a variable number of arguments.
+
+ @return    An `RLMResults` containing results matching the given predicate.
+
+ @see       `+[RLMObject objectsWhere:]`
+ */
+- (RLMResults *)objects:(NSString *)className where:(NSString *)predicateFormat, ...;
+
+/**
+ Returns all objects matching the given predicate from the Realm.
+
+ @warning This method is useful only in specialized circumstances, for example, when building components
+          that integrate with Realm. The preferred way to get objects of a single class is to use the class
+          methods on `RLMObject`.
+
+ @param className   The type of objects you are looking for (name of the class).
+ @param predicate   The predicate with which to filter the objects.
+
+ @return    An `RLMResults` containing results matching the given predicate.
+
+ @see       `+[RLMObject objectsWhere:]`
+ */
+- (RLMResults *)objects:(NSString *)className withPredicate:(NSPredicate *)predicate;
+
+/**
+ Returns the object of the given type with the given primary key from the Realm.
+
+ @warning This method is useful only in specialized circumstances, for example, when building components 
+          that integrate with Realm. The preferred way to get an object of a single class is to use the class
+          methods on `RLMObject`.
+ 
+ @param className   The class name for the object you are looking for.
+ @param primaryKey  The primary key value for the object you are looking for.
+ 
+ @return    An object, or `nil` if an object with the given primary key does not exist.
+ 
+ @see       `+[RLMObject objectForPrimaryKey:]`
+ */
+- (nullable RLMObject *)objectWithClassName:(NSString *)className forPrimaryKey:(id)primaryKey;
+
+/**
+ Creates an `RLMObject` instance of type `className` in the Realm, and populates it using a given object.
+ 
+ The `value` argument is used to populate the object. It can be a key-value coding compliant object, an array or
+ dictionary returned from the methods in `NSJSONSerialization`, or an array containing one element for each managed
+ property. An exception will be thrown if any required properties are not present and those properties were not defined
+ with default values.
+
+ When passing in an array as the `value` argument, all properties must be present, valid and in the same order as the
+ properties defined in the model.
+
+ @warning This method is useful only in specialized circumstances, for example, when building components
+          that integrate with Realm. If you are simply building an app on Realm, it is recommended to
+          use `[RLMObject createInDefaultRealmWithValue:]`.
+
+ @param value    The value used to populate the object.
+
+ @return    An `RLMObject` instance of type `className`.
+ */
+-(RLMObject *)createObject:(NSString *)className withValue:(id)value;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 342 - 0
Libraries external/Realm/Realm.framework/Headers/RLMResults.h

@@ -0,0 +1,342 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+#import <Realm/RLMCollection.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMObject, RLMRealm, RLMNotificationToken;
+
+/**
+ `RLMResults` is an auto-updating container type in Realm returned from object
+ queries. It represents the results of the query in the form of a collection of objects.
+
+ `RLMResults` can be queried using the same predicates as `RLMObject` and `RLMArray`,
+ and you can chain queries to further filter results.
+
+ `RLMResults` always reflect the current state of the Realm on the current thread,
+ including during write transactions on the current thread. The one exception to
+ this is when using `for...in` fast enumeration, which will always enumerate
+ over the objects which matched the query when the enumeration is begun, even if
+ some of them are deleted or modified to be excluded by the filter during the
+ enumeration.
+
+ `RLMResults` are lazily evaluated the first time they are accessed; they only
+ run queries when the result of the query is requested. This means that 
+ chaining several temporary `RLMResults` to sort and filter your data does not 
+ perform any extra work processing the intermediate state.
+
+ Once the results have been evaluated or a notification block has been added,
+ the results are eagerly kept up-to-date, with the work done to keep them
+ up-to-date done on a background thread whenever possible.
+
+ `RLMResults` cannot be directly instantiated.
+ */
+@interface RLMResults<RLMObjectType: RLMObject *> : NSObject<RLMCollection, NSFastEnumeration>
+
+#pragma mark - Properties
+
+/**
+ The number of objects in the results collection.
+ */
+@property (nonatomic, readonly, assign) NSUInteger count;
+
+/**
+ The class name (i.e. type) of the `RLMObject`s contained in the results collection.
+ */
+@property (nonatomic, readonly, copy) NSString *objectClassName;
+
+/**
+ The Realm which manages this results collection.
+ */
+@property (nonatomic, readonly) RLMRealm *realm;
+
+/**
+ Indicates if the results collection is no longer valid.
+
+ The results collection becomes invalid if `invalidate` is called on the containing `realm`.
+ An invalidated results collection can be accessed, but will always be empty.
+ */
+@property (nonatomic, readonly, getter = isInvalidated) BOOL invalidated;
+
+#pragma mark - Accessing Objects from an RLMResults
+
+/**
+ Returns the object at the index specified.
+
+ @param index   The index to look up.
+
+ @return An `RLMObject` of the type contained in the results collection.
+ */
+- (RLMObjectType)objectAtIndex:(NSUInteger)index;
+
+/**
+ Returns the first object in the results collection.
+
+ Returns `nil` if called on an empty results collection.
+
+ @return An `RLMObject` of the type contained in the results collection.
+ */
+- (nullable RLMObjectType)firstObject;
+
+/**
+ Returns the last object in the results collection.
+
+ Returns `nil` if called on an empty results collection.
+
+ @return An `RLMObject` of the type contained in the results collection.
+ */
+- (nullable RLMObjectType)lastObject;
+
+#pragma mark - Querying Results
+
+/**
+ Returns the index of an object in the results collection.
+
+ Returns `NSNotFound` if the object is not found in the results collection.
+
+ @param object  An object (of the same type as returned from the `objectClassName` selector).
+ */
+- (NSUInteger)indexOfObject:(RLMObjectType)object;
+
+/**
+ Returns the index of the first object in the results collection matching the predicate.
+
+ @param predicateFormat A predicate format string, optionally followed by a variable number of arguments.
+
+ @return    The index of the object, or `NSNotFound` if the object is not found in the results collection.
+ */
+- (NSUInteger)indexOfObjectWhere:(NSString *)predicateFormat, ...;
+
+/// :nodoc:
+- (NSUInteger)indexOfObjectWhere:(NSString *)predicateFormat args:(va_list)args;
+
+/**
+ Returns the index of the first object in the results collection matching the predicate.
+
+ @param predicate   The predicate with which to filter the objects.
+
+ @return    The index of the object, or `NSNotFound` if the object is not found in the results collection.
+ */
+- (NSUInteger)indexOfObjectWithPredicate:(NSPredicate *)predicate;
+
+/**
+ Returns all the objects matching the given predicate in the results collection.
+
+ @param predicateFormat A predicate format string, optionally followed by a variable number of arguments.
+
+ @return                An `RLMResults` of objects that match the given predicate.
+ */
+- (RLMResults<RLMObjectType> *)objectsWhere:(NSString *)predicateFormat, ...;
+
+/// :nodoc:
+- (RLMResults<RLMObjectType> *)objectsWhere:(NSString *)predicateFormat args:(va_list)args;
+
+/**
+ Returns all the objects matching the given predicate in the results collection.
+
+ @param predicate   The predicate with which to filter the objects.
+
+ @return            An `RLMResults` of objects that match the given predicate.
+ */
+- (RLMResults<RLMObjectType> *)objectsWithPredicate:(NSPredicate *)predicate;
+
+/**
+ Returns a sorted `RLMResults` from an existing results collection.
+
+ @param keyPath     The key path to sort by.
+ @param ascending   The direction to sort in.
+
+ @return    An `RLMResults` sorted by the specified key path.
+ */
+- (RLMResults<RLMObjectType> *)sortedResultsUsingKeyPath:(NSString *)keyPath ascending:(BOOL)ascending;
+
+/**
+ Returns a sorted `RLMResults` from an existing results collection.
+
+ @param property    The property name to sort by.
+ @param ascending   The direction to sort in.
+
+ @return    An `RLMResults` sorted by the specified property.
+ */
+- (RLMResults<RLMObjectType> *)sortedResultsUsingProperty:(NSString *)property ascending:(BOOL)ascending
+    __deprecated_msg("Use `-sortedResultsUsingKeyPath:ascending:`");
+
+/**
+ Returns a sorted `RLMResults` from an existing results collection.
+
+ @param properties  An array of `RLMSortDescriptor`s to sort by.
+
+ @return    An `RLMResults` sorted by the specified properties.
+ */
+- (RLMResults<RLMObjectType> *)sortedResultsUsingDescriptors:(NSArray<RLMSortDescriptor *> *)properties;
+
+#pragma mark - Notifications
+
+/**
+ Registers a block to be called each time the results collection changes.
+
+ The block will be asynchronously called with the initial results collection,
+ and then called again after each write transaction which changes either any
+ of the objects in the results, or which objects are in the results.
+
+ The `change` parameter will be `nil` the first time the block is called.
+ For each call after that, it will contain information about
+ which rows in the results collection were added, removed or modified. If a
+ write transaction did not modify any objects in the results collection,
+ the block is not called at all. See the `RLMCollectionChange` documentation for
+ information on how the changes are reported and an example of updating a 
+ `UITableView`.
+
+ If an error occurs the block will be called with `nil` for the results
+ parameter and a non-`nil` error. Currently the only errors that can occur are
+ when opening the Realm on the background worker thread.
+
+ At the time when the block is called, the `RLMResults` object will be fully
+ evaluated and up-to-date, and as long as you do not perform a write transaction
+ on the same thread or explicitly call `-[RLMRealm refresh]`, accessing it will
+ never perform blocking work.
+
+ Notifications are delivered via the standard run loop, and so can't be
+ delivered while the run loop is blocked by other activity. When
+ notifications can't be delivered instantly, multiple notifications may be
+ coalesced into a single notification. This can include the notification
+ with the initial results. For example, the following code performs a write
+ transaction immediately after adding the notification block, so there is no
+ opportunity for the initial notification to be delivered first. As a
+ result, the initial notification will reflect the state of the Realm after
+ the write transaction.
+
+     RLMResults<Dog *> *results = [Dog allObjects];
+     NSLog(@"dogs.count: %zu", dogs.count); // => 0
+     self.token = [results addNotificationBlock:^(RLMResults *dogs,
+                                                  RLMCollectionChange *changes,
+                                                  NSError *error) {
+         // Only fired once for the example
+         NSLog(@"dogs.count: %zu", dogs.count); // => 1
+     }];
+     [realm transactionWithBlock:^{
+         Dog *dog = [[Dog alloc] init];
+         dog.name = @"Rex";
+         [realm addObject:dog];
+     }];
+     // end of run loop execution context
+
+ You must retain the returned token for as long as you want updates to continue
+ to be sent to the block. To stop receiving updates, call `-stop` on the token.
+
+ @warning This method cannot be called during a write transaction, or when the
+          containing Realm is read-only.
+
+ @param block The block to be called whenever a change occurs.
+ @return A token which must be held for as long as you want updates to be delivered.
+ */
+- (RLMNotificationToken *)addNotificationBlock:(void (^)(RLMResults<RLMObjectType> *__nullable results,
+                                                         RLMCollectionChange *__nullable change,
+                                                         NSError *__nullable error))block __attribute__((warn_unused_result));
+
+#pragma mark - Aggregating Property Values
+
+/**
+ Returns the minimum (lowest) value of the given property among all the objects
+ represented by the results collection.
+
+     NSNumber *min = [results minOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose minimum value is desired. Only properties of types `int`, `float`, `double`, and
+                 `NSDate` are supported.
+
+ @return The minimum value of the property, or `nil` if the Results are empty.
+ */
+- (nullable id)minOfProperty:(NSString *)property;
+
+/**
+ Returns the maximum (highest) value of the given property among all the objects represented by the results collection.
+
+     NSNumber *max = [results maxOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose maximum value is desired. Only properties of types `int`, `float`, `double`, and 
+                 `NSDate` are supported.
+
+ @return The maximum value of the property, or `nil` if the Results are empty.
+ */
+- (nullable id)maxOfProperty:(NSString *)property;
+
+/**
+ Returns the sum of the values of a given property over all the objects represented by the results collection.
+
+     NSNumber *sum = [results sumOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose values should be summed. Only properties of types `int`, `float`, and `double` are
+                 supported.
+
+ @return The sum of the given property.
+ */
+- (NSNumber *)sumOfProperty:(NSString *)property;
+
+/**
+ Returns the average value of a given property over the objects represented by the results collection.
+
+     NSNumber *average = [results averageOfProperty:@"age"];
+
+ @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
+
+ @param property The property whose average value should be calculated. Only properties of types `int`, `float`, and
+                 `double` are supported.
+
+ @return    The average value of the given property, or `nil` if the Results are empty.
+ */
+- (nullable NSNumber *)averageOfProperty:(NSString *)property;
+
+/// :nodoc:
+- (RLMObjectType)objectAtIndexedSubscript:(NSUInteger)index;
+
+#pragma mark - Unavailable Methods
+
+/**
+ `-[RLMResults init]` is not available because `RLMResults` cannot be created directly.
+ `RLMResults` can be obtained by querying a Realm.
+ */
+- (instancetype)init __attribute__((unavailable("RLMResults cannot be created directly")));
+
+/**
+ `+[RLMResults new]` is not available because `RLMResults` cannot be created directly.
+ `RLMResults` can be obtained by querying a Realm.
+ */
++ (instancetype)new __attribute__((unavailable("RLMResults cannot be created directly")));
+
+@end
+
+/**
+ `RLMLinkingObjects` is an auto-updating container type. It represents a collection of objects that link to its
+ parent object.
+ 
+ For more information, please see the "Inverse Relationships" section in the
+ [documentation](https://realm.io/docs/objc/latest/#relationships).
+ */
+@interface RLMLinkingObjects<RLMObjectType: RLMObject *> : RLMResults
+@end
+
+NS_ASSUME_NONNULL_END

+ 77 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSchema.h

@@ -0,0 +1,77 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMObjectSchema;
+
+/**
+ `RLMSchema` instances represent collections of model object schemas managed by a Realm.
+
+ When using Realm, `RLMSchema` instances allow performing migrations and
+ introspecting the database's schema.
+
+ Schemas map to collections of tables in the core database.
+ */
+@interface RLMSchema : NSObject<NSCopying>
+
+#pragma mark - Properties
+
+/**
+ An `NSArray` containing `RLMObjectSchema`s for all object types in the Realm.
+ 
+ This property is intended to be used during migrations for dynamic introspection.
+
+ @see `RLMObjectSchema`
+ */
+@property (nonatomic, readonly, copy) NSArray<RLMObjectSchema *> *objectSchema;
+
+#pragma mark - Methods
+
+/**
+ Returns an `RLMObjectSchema` for the given class name in the schema.
+
+ @param className   The object class name.
+ @return            An `RLMObjectSchema` for the given class in the schema.
+
+ @see               `RLMObjectSchema`
+ */
+- (nullable RLMObjectSchema *)schemaForClassName:(NSString *)className;
+
+/**
+ Looks up and returns an `RLMObjectSchema` for the given class name in the Realm.
+ 
+ If there is no object of type `className` in the schema, an exception will be thrown.
+
+ @param className   The object class name.
+ @return            An `RLMObjectSchema` for the given class in this Realm.
+
+ @see               `RLMObjectSchema`
+ */
+- (RLMObjectSchema *)objectForKeyedSubscript:(NSString *)className;
+
+/**
+ Returns whether two `RLMSchema` instances are equivalent.
+ */
+- (BOOL)isEqualToSchema:(RLMSchema *)schema;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 69 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncConfiguration.h

@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+@class RLMSyncUser;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ A configuration object representing configuration state for a Realm which is intended to sync with a Realm Object
+ Server.
+ */
+@interface RLMSyncConfiguration : NSObject
+
+/// The user to which the remote Realm belongs.
+@property (nonatomic, readonly) RLMSyncUser *user;
+
+/**
+ The URL of the remote Realm upon the Realm Object Server.
+ 
+ @warning The URL cannot end with `.realm`, `.realm.lock` or `.realm.management`.
+ */
+@property (nonatomic, readonly) NSURL *realmURL;
+
+
+/**
+ Whether SSL certificate validation is enabled for the connection associated
+ with this configuration value. SSL certificate validation is ON by default.
+
+ @warning NEVER disable certificate validation for clients and servers in production.
+ */
+@property (nonatomic) BOOL enableSSLValidation;
+
+/**
+ Create a sync configuration instance.
+
+ @param user    A `RLMSyncUser` that owns the Realm at the given URL.
+ @param url     The unresolved absolute URL to the Realm on the Realm Object Server, e.g.
+                `realm://example.org/~/path/to/realm`. "Unresolved" means the path should
+                contain the wildcard marker `~`, which will automatically be filled in with
+                the user identity by the Realm Object Server.
+ */
+- (instancetype)initWithUser:(RLMSyncUser *)user realmURL:(NSURL *)url;
+
+/// :nodoc:
+- (instancetype)init __attribute__((unavailable("This type cannot be created directly")));
+
+/// :nodoc:
++ (instancetype)new __attribute__((unavailable("This type cannot be created directly")));
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 106 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncCredentials.h

@@ -0,0 +1,106 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+#import "RLMSyncUtil.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// A token representing an identity provider's credentials.
+typedef NSString *RLMSyncCredentialsToken;
+
+/// A type representing the unique identifier of a Realm Object Server identity provider.
+typedef NSString *RLMIdentityProvider RLM_EXTENSIBLE_STRING_ENUM;
+
+/// The debug identity provider, which accepts any token string and creates a user associated with that token if one
+/// does not yet exist. Not enabled for Realm Object Server configured for production.
+extern RLMIdentityProvider const RLMIdentityProviderDebug;
+
+/// The username/password identity provider. User accounts are handled by the Realm Object Server directly without the
+/// involvement of a third-party identity provider.
+extern RLMIdentityProvider const RLMIdentityProviderUsernamePassword;
+
+/// A Facebook account as an identity provider.
+extern RLMIdentityProvider const RLMIdentityProviderFacebook;
+
+/// A Google account as an identity provider.
+extern RLMIdentityProvider const RLMIdentityProviderGoogle;
+
+/// A CloudKit account as an identity provider.
+extern RLMIdentityProvider const RLMIdentityProviderCloudKit;
+
+/**
+ Opaque credentials representing a specific Realm Object Server user.
+ */
+@interface RLMSyncCredentials : NSObject
+
+/// An opaque credentials token containing information that uniquely identifies a Realm Object Server user.
+@property (nonatomic, readonly) RLMSyncCredentialsToken token;
+
+/// The name of the identity provider which generated the credentials token.
+@property (nonatomic, readonly) RLMIdentityProvider provider;
+
+/// A dictionary containing additional pertinent information. In most cases this is automatically configured.
+@property (nonatomic, readonly) NSDictionary<NSString *, id> *userInfo;
+
+/**
+ Construct and return credentials from a Facebook account token.
+ */
++ (instancetype)credentialsWithFacebookToken:(RLMSyncCredentialsToken)token;
+
+/**
+ Construct and return credentials from a Google account token.
+ */
++ (instancetype)credentialsWithGoogleToken:(RLMSyncCredentialsToken)token;
+
+/**
+ Construct and return credentials from an CloudKit account token.
+ */
++ (instancetype)credentialsWithCloudKitToken:(RLMSyncCredentialsToken)token;
+
+/**
+ Construct and return credentials from a Realm Object Server username and password.
+ */
++ (instancetype)credentialsWithUsername:(NSString *)username
+                               password:(NSString *)password
+                               register:(BOOL)shouldRegister;
+
+/**
+ Construct and return special credentials representing a token that can be directly used to open a Realm. The identity
+ is used to uniquely identify the user across application launches.
+ */
++ (instancetype)credentialsWithAccessToken:(RLMServerToken)accessToken identity:(NSString *)identity;
+
+/**
+ Construct and return credentials with a custom token string, identity provider string, and optional user info. In most
+ cases, the convenience initializers should be used instead.
+ */
+- (instancetype)initWithCustomToken:(RLMSyncCredentialsToken)token
+                           provider:(RLMIdentityProvider)provider
+                           userInfo:(nullable NSDictionary *)userInfo NS_DESIGNATED_INITIALIZER;
+
+/// :nodoc:
+- (instancetype)init __attribute__((unavailable("RLMSyncCredentials cannot be created directly")));
+
+/// :nodoc:
++ (instancetype)new __attribute__((unavailable("RLMSyncCredentials cannot be created directly")));
+
+NS_ASSUME_NONNULL_END
+
+@end

+ 118 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncManager.h

@@ -0,0 +1,118 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+#import "RLMSyncUtil.h"
+
+@class RLMSyncSession;
+
+/// An enum representing different levels of sync-related logging that can be configured.
+typedef NS_ENUM(NSUInteger, RLMSyncLogLevel) {
+    /// Nothing will ever be logged.
+    RLMSyncLogLevelOff,
+    /// Only fatal errors will be logged.
+    RLMSyncLogLevelFatal,
+    /// Only errors will be logged.
+    RLMSyncLogLevelError,
+    /// Warnings and errors will be logged.
+    RLMSyncLogLevelWarn,
+    /// Information about sync events will be logged. Fewer events will be logged in order to avoid overhead.
+    RLMSyncLogLevelInfo,
+    /// Information about sync events will be logged. More events will be logged than with `RLMSyncLogLevelInfo`.
+    RLMSyncLogLevelDetail,
+    /// Log information that can aid in debugging.
+    ///
+    /// - warning: Will incur a measurable performance impact.
+    RLMSyncLogLevelDebug,
+    /// Log information that can aid in debugging. More events will be logged than with `RLMSyncLogLevelDebug`.
+    ///
+    /// - warning: Will incur a measurable performance impact.
+    RLMSyncLogLevelTrace,
+    /// Log information that can aid in debugging. More events will be logged than with `RLMSyncLogLevelTrace`.
+    ///
+    /// - warning: Will incur a measurable performance impact.
+    RLMSyncLogLevelAll
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// A block type representing a block which can be used to report a sync-related error to the application. If the error
+/// pertains to a specific session, that session will also be passed into the block.
+typedef void(^RLMSyncErrorReportingBlock)(NSError *, RLMSyncSession * _Nullable);
+
+/**
+ A singleton manager which serves as a central point for sync-related configuration.
+ */
+@interface RLMSyncManager : NSObject
+
+/**
+ A block which can optionally be set to report sync-related errors to your application.
+
+ Any error reported through this block will be of the `RLMSyncError` type, and marked
+ with the `RLMSyncErrorDomain` domain.
+
+ Errors reported through this mechanism are fatal, with several exceptions. Please consult
+ `RLMSyncError` for information about the types of errors that can be reported through
+ the block, and for for suggestions on handling recoverable error codes.
+
+ @see `RLMSyncError`
+ */
+@property (nullable, nonatomic, copy) RLMSyncErrorReportingBlock errorHandler;
+
+/**
+ A reverse-DNS string uniquely identifying this application. In most cases this is automatically set by the SDK, and
+ does not have to be explicitly configured.
+ */
+@property (nonatomic, copy) NSString *appID;
+
+/**
+ Whether SSL certificate validation should be disabled.
+ 
+ Once this value is set (either way), it will be used as the default value for SSL
+ validation when initializing new sync configuration values. A given configuration's
+ SSL validation setting can still be overriden from the global default by setting it
+ explicitly.
+
+ @warning NEVER disable certificate validation for clients and servers in production.
+ */
+@property (nonatomic) BOOL disableSSLValidation __deprecated_msg("Set `enableSSLValidation` on individual configurations instead.");
+
+/**
+ The logging threshold which newly opened synced Realms will use. Defaults to
+ `RLMSyncLogLevelInfo`.
+
+ Logging strings are output to Apple System Logger.
+
+ @warning This property must be set before any synced Realms are opened. Setting it after
+          opening any synced Realm will do nothing.
+ */
+@property (nonatomic) RLMSyncLogLevel logLevel;
+
+/// The sole instance of the singleton.
++ (instancetype)sharedManager NS_REFINED_FOR_SWIFT;
+
+/// :nodoc:
+- (instancetype)init __attribute__((unavailable("RLMSyncManager cannot be created directly")));
+
+/// :nodoc:
++ (instancetype)new __attribute__((unavailable("RLMSyncManager cannot be created directly")));
+
+NS_ASSUME_NONNULL_END
+
+@end

+ 55 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncPermission.h

@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+#import <Realm/RLMObject.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ This model is used to reflect permissions.
+
+ It should be used in conjunction with a `RLMSyncUser`'s Permission Realm.
+ You can only read this Realm. Use the objects in Management Realm to
+ make request for modifications of permissions.
+
+ See https://realm.io/docs/realm-object-server/#permissions for general
+ documentation.
+ */
+__deprecated_msg("Use `RLMSyncPermissionValue`")
+@interface RLMSyncPermission : RLMObject
+
+/// The date this object was last modified.
+@property (readonly) NSDate *updatedAt;
+
+/// The identity of a user affected by this permission.
+@property (readonly) NSString *userId;
+
+/// The path to the realm.
+@property (readonly) NSString *path;
+
+/// Whether the affected user is allowed to read from the Realm.
+@property (readonly) BOOL mayRead;
+/// Whether the affected user is allowed to write to the Realm.
+@property (readonly) BOOL mayWrite;
+/// Whether the affected user is allowed to manage the access rights for others.
+@property (readonly) BOOL mayManage;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 90 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionChange.h

@@ -0,0 +1,90 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+#import <Realm/RLMObject.h>
+#import <Realm/RLMProperty.h>
+#import <Realm/RLMSyncUtil.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ This model is used for requesting changes to a Realm's permissions.
+
+ It should be used in conjunction with an `RLMSyncUser`'s Management Realm.
+
+ See https://realm.io/docs/realm-object-server/#permissions for general
+ documentation.
+ */
+__deprecated_msg("Use `-[RLMSyncUser applyPermission:callback:]` and `-[RLMSyncUser revokePermission:callback:]`")
+@interface RLMSyncPermissionChange : RLMObject
+
+/// The globally unique ID string of this permission change object.
+@property (readonly) NSString *id;
+
+/// The date this object was initially created.
+@property (readonly) NSDate *createdAt;
+
+/// The date this object was last modified.
+@property (readonly) NSDate *updatedAt;
+
+/// The status code of the object that was processed by Realm Object Server.
+@property (nullable, readonly) NSNumber<RLMInt> *statusCode;
+
+/// An error or informational message, typically written to by the Realm Object Server.
+@property (nullable, readonly) NSString *statusMessage;
+
+/// Sync management object status.
+@property (readonly) RLMSyncManagementObjectStatus status;
+
+/// The remote URL to the realm.
+@property (readonly) NSString *realmUrl;
+
+/// The identity of a user affected by this permission change.
+@property (readonly) NSString *userId;
+
+/// Define read access. Set to `YES` or `NO` to update this value. Leave unset to preserve the existing setting.
+@property (nullable, readonly) NSNumber<RLMBool> *mayRead;
+/// Define write access. Set to `YES` or `NO` to update this value. Leave unset to preserve the existing setting.
+@property (nullable, readonly) NSNumber<RLMBool> *mayWrite;
+/// Define management access. Set to `YES` or `NO` to update this value. Leave unset to preserve the existing setting.
+@property (nullable, readonly) NSNumber<RLMBool> *mayManage;
+
+/**
+ Construct a permission change object used to change the access permissions for a user on a Realm.
+
+ @param realmURL  The Realm URL whose permissions settings should be changed.
+                  Use `*` to change the permissions of all Realms managed by the Management Realm's `RLMSyncUser`.
+ @param userID    The user or users who should be granted these permission changes.
+                  Use `*` to change the permissions for all users.
+ @param mayRead   Define read access. Set to `YES` or `NO` to update this value.
+                  Leave unset to preserve the existing setting.
+ @param mayWrite  Define write access. Set to `YES` or `NO` to update this value.
+                  Leave unset to preserve the existing setting.
+ @param mayManage Define management access. Set to `YES` or `NO` to update this value.
+                  Leave unset to preserve the existing setting.
+ */
++ (instancetype)permissionChangeWithRealmURL:(NSString *)realmURL
+                                      userID:(NSString *)userID
+                                        read:(nullable NSNumber<RLMBool> *)mayRead
+                                       write:(nullable NSNumber<RLMBool> *)mayWrite
+                                      manage:(nullable NSNumber<RLMBool> *)mayManage;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 91 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionOffer.h

@@ -0,0 +1,91 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+#import <Realm/RLMObject.h>
+#import <Realm/RLMProperty.h>
+#import <Realm/RLMSyncUtil.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ This model is used for offering permission changes to other users.
+
+ It should be used in conjunction with an `RLMSyncUser`'s Management Realm.
+
+ See https://realm.io/docs/realm-object-server/#permissions for general
+ documentation.
+ */
+@interface RLMSyncPermissionOffer : RLMObject
+
+/// The globally unique ID string of this permission offer object.
+@property (readonly) NSString *id;
+
+/// The date this object was initially created.
+@property (readonly) NSDate *createdAt;
+
+/// The date this object was last modified.
+@property (readonly) NSDate *updatedAt;
+
+/// The status code of the object that was processed by Realm Object Server.
+@property (nullable, readonly) NSNumber<RLMInt> *statusCode;
+
+/// An error or informational message, typically written to by the Realm Object Server.
+@property (nullable, readonly) NSString *statusMessage;
+
+/// Sync management object status.
+@property (readonly) RLMSyncManagementObjectStatus status;
+
+/// A token which uniquely identifies this offer. Generated by the server.
+@property (nullable, readonly) NSString *token;
+
+/// The remote URL to the realm.
+@property (readonly) NSString *realmUrl;
+
+/// Whether this offer allows the receiver to read from the Realm.
+@property (readonly) BOOL mayRead;
+
+/// Whether this offer allows the receiver to write to the Realm.
+@property (readonly) BOOL mayWrite;
+
+/// Whether this offer allows the receiver to manage the access rights for others.
+@property (readonly) BOOL mayManage;
+
+/// When this token will expire and become invalid.
+@property (nullable, readonly) NSDate *expiresAt;
+
+/**
+ Construct a permission offer object used to offer permission changes to other users.
+
+ @param realmURL  The URL to the Realm on which to apply these permission changes
+                  to, once the offer is accepted.
+ @param expiresAt When this token will expire and become invalid.
+                  Pass `nil` if this offer should not expire.
+ @param mayRead   Grant or revoke read access.
+ @param mayWrite  Grant or revoked read-write access.
+ @param mayManage Grant or revoke administrative access.
+ */
++ (instancetype)permissionOfferWithRealmURL:(NSString *)realmURL
+                                  expiresAt:(nullable NSDate *)expiresAt
+                                       read:(BOOL)mayRead
+                                      write:(BOOL)mayWrite
+                                     manage:(BOOL)mayManage;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 73 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionOfferResponse.h

@@ -0,0 +1,73 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/Realm.h>
+#import <Realm/RLMSyncUtil.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ This model is used to apply permission changes defined in the permission offer
+ object represented by the specified token, which was created by another user's
+ `RLMSyncPermissionOffer` object.
+
+ It should be used in conjunction with an `RLMSyncUser`'s Management Realm.
+
+ See https://realm.io/docs/realm-object-server/#permissions for general
+ documentation.
+ */
+@interface RLMSyncPermissionOfferResponse : RLMObject
+
+/// The globally unique ID string of this permission offer response object.
+@property (readonly) NSString *id;
+
+/// The date this object was initially created.
+@property (readonly) NSDate *createdAt;
+
+/// The date this object was last modified.
+@property (readonly) NSDate *updatedAt;
+
+/// The status code of the object that was processed by Realm Object Server.
+@property (nullable, readonly) NSNumber<RLMInt> *statusCode;
+
+/// An error or informational message, typically written to by the Realm Object Server.
+@property (nullable, readonly) NSString *statusMessage;
+
+/// Sync management object status.
+@property (readonly) RLMSyncManagementObjectStatus status;
+
+/// The received token which uniquely identifies another user's `RLMSyncPermissionOffer`.
+@property (readonly) NSString *token;
+
+/// The remote URL to the realm on which these permission changes were applied.
+/// Generated by the server.
+@property (nullable, readonly) NSString *realmUrl;
+
+/**
+ Construct a permission offer response object used to apply permission changes
+ defined in the permission offer object represented by the specified token,
+ which was created by another user's `RLMSyncPermissionOffer` object.
+
+ @param token The received token which uniquely identifies another user's
+              `RLMSyncPermissionOffer`.
+ */
++ (instancetype)permissionOfferResponseWithToken:(NSString *)token;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 112 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionResults.h

@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2017 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+#import "RLMSyncUser.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// Properties which a sync permission results collection can be sorted by.
+typedef NS_ENUM(NSUInteger, RLMSyncPermissionResultsSortProperty) {
+    /// Sort by the Realm Object Server path to the Realm to which the permission applies.
+    RLMSyncPermissionResultsSortPropertyPath,
+    /// Sort by the identity of the user to whom the permission applies.
+    RLMSyncPermissionResultsSortPropertyUserID,
+    /// Sort by the date the permissions were last updated.
+    RLMSyncPermissionResultsSortDateUpdated,
+};
+
+@class RLMSyncPermissionValue, RLMNotificationToken;
+
+/**
+ A collection object representing the results of a permissions query.
+
+ This collection will automatically update its contents at the start of each runloop
+ iteration, but the objects it vends are immutable.
+
+ Permission results objects are thread-confined, and should not be shared across
+ threads.
+
+ @warning Permission results must only be fetched on threads that have an active
+          run loop. In most cases this will be the main thread.
+ */
+@interface RLMSyncPermissionResults : NSObject<NSFastEnumeration>
+
+/// The number of results contained within the object.
+@property (nonatomic, readonly) NSInteger count;
+
+/**
+ Return the first permission, or nil if the collection is empty.
+ */
+- (nullable RLMSyncPermissionValue *)firstObject NS_SWIFT_UNAVAILABLE("Use the `first` property.");
+
+/**
+ Return the last permission, or nil if the collection is empty.
+ */
+- (nullable RLMSyncPermissionValue *)lastObject NS_SWIFT_UNAVAILABLE("Use the `last` property.");
+
+/**
+ Retrieve the permission value at the given index. Throws an exception if the index
+ is out of bounds.
+ */
+- (RLMSyncPermissionValue *)objectAtIndex:(NSInteger)index;
+
+/**
+ Returns the index of the permission in the collection, or `NSNotFound` if the permission
+ is not found in the collection.
+ */
+- (NSInteger)indexOfObject:(RLMSyncPermissionValue *)object;
+
+/**
+ Register to be notified when the contents of the results object change.
+
+ This method returns a token. Hold on to the token for as long as notifications
+ are desired. Call `-stop` on the token to stop notifications, and before
+ deallocating the token.
+ */
+- (RLMNotificationToken *)addNotificationBlock:(RLMPermissionStatusBlock)block;
+
+#pragma mark - Queries
+
+/**
+ Return all permissions matching the given predicate in the collection.
+
+ @note Valid properties to filter on are `path` and `userId`, as well as
+       the boolean properties `mayRead`, `mayWrite`, and `mayManage`.
+ */
+- (RLMSyncPermissionResults *)objectsWithPredicate:(NSPredicate *)predicate;
+
+/**
+ Return a sorted `RLMSyncPermissionResults` from the collection, sorted based on
+ the given property.
+ */
+- (RLMSyncPermissionResults *)sortedResultsUsingProperty:(RLMSyncPermissionResultsSortProperty)property
+                                               ascending:(BOOL)ascending;
+
+#pragma mark - Misc
+
+/// :nodoc:
+- (instancetype)init __attribute__((unavailable("RLMSyncPermissionResults cannot be created directly")));
+
+/// :nodoc:
++ (instancetype)new __attribute__((unavailable("RLMSyncPermissionResults cannot be created directly")));
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 113 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionValue.h

@@ -0,0 +1,113 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2017 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+/**
+ Access levels which can be granted to Realm Mobile Platform users
+ for specific synchronized Realms, using the permissions APIs.
+
+ Note that each access level guarantees all allowed actions provided
+ by less permissive access levels. Specifically, users with write
+ access to a Realm can always read from that Realm, and users with
+ administrative access can always read or write from the Realm.
+ */
+typedef NS_ENUM(NSUInteger, RLMSyncAccessLevel) {
+    /// No access whatsoever.
+    RLMSyncAccessLevelNone          = 0,
+    /**
+     User can only read the contents of the Realm.
+     
+     @warning Users who have read-only access to a Realm should open the
+              Realm using `+[RLMRealm asyncOpenWithConfiguration:callbackQueue:callback:]`.
+              Attempting to directly open the Realm is an error; in this
+              case the Realm must be deleted and re-opened.
+     */
+    RLMSyncAccessLevelRead          = 1,
+    /// User can read and write the contents of the Realm.
+    RLMSyncAccessLevelWrite         = 2,
+    /// User can read, write, and administer the Realm, including
+    /// granting permissions to other users.
+    RLMSyncAccessLevelAdmin         = 3,
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ A value representing a permission granted to the specified user(s) to access the specified Realm(s).
+
+ `RLMSyncPermissionValue` is immutable and can be accessed from any thread.
+ 
+ See https://realm.io/docs/realm-object-server/#permissions for general documentation.
+ */
+@interface RLMSyncPermissionValue : NSObject
+
+/**
+ The Realm Object Server path to the Realm to which this permission applies (e.g. "/path/to/realm").
+
+ Specify "*" if this permission applies to all Realms managed by the server.
+ */
+@property (nonatomic, readonly) NSString *path;
+
+/**
+ The access level described by this permission.
+ */
+@property (nonatomic, readonly) RLMSyncAccessLevel accessLevel;
+
+/// Whether the access level allows the user to read from the Realm.
+@property (nonatomic, readonly) BOOL mayRead;
+
+/// Whether the access level allows the user to write to the Realm.
+@property (nonatomic, readonly) BOOL mayWrite;
+
+/// Whether the access level allows the user to administer the Realm.
+@property (nonatomic, readonly) BOOL mayManage;
+
+/**
+ Create a new sync permission value, for use with permission APIs.
+
+ @param path        The Realm Object Server path to the Realm whose permission should be modified
+                    (e.g. "/path/to/realm"). Pass "*" to apply to all Realms managed by the server.
+ @param userID      The identity of the user who should be granted access to the Realm at `path`.
+                    Pass "*" to apply to all users managed by the server.
+ @param accessLevel The access level to grant.
+ */
+- (instancetype)initWithRealmPath:(NSString *)path
+                           userID:(NSString *)userID
+                      accessLevel:(RLMSyncAccessLevel)accessLevel;
+
+/**
+ The identity of the user to whom this permission is granted, or "*"
+ if all users are granted this permission.
+ */
+@property (nullable, nonatomic, readonly) NSString *userId;
+
+/**
+ When this permission object was last updated.
+ */
+@property (nonatomic, readonly) NSDate *updatedAt;
+
+/// :nodoc:
+- (instancetype)init __attribute__((unavailable("Use the designated initializer")));
+
+/// :nodoc:
++ (instancetype)new __attribute__((unavailable("Use the designated initializer")));
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 159 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncSession.h

@@ -0,0 +1,159 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+#import "RLMRealm.h"
+
+/**
+ The current state of the session represented by a session object.
+ */
+typedef NS_ENUM(NSUInteger, RLMSyncSessionState) {
+    /// The sync session is bound to the Realm Object Server and communicating with it.
+    RLMSyncSessionStateActive,
+    /// The sync session is not currently communicating with the Realm Object Server.
+    RLMSyncSessionStateInactive,
+    /// The sync session encountered a fatal error and is permanently invalid; it should be discarded.
+    RLMSyncSessionStateInvalid
+};
+
+/**
+ The transfer direction (upload or download) tracked by a given progress notification block.
+
+ Progress notification blocks can be registered on sessions if your app wishes to be informed
+ how many bytes have been uploaded or downloaded, for example to show progress indicator UIs.
+ */
+typedef NS_ENUM(NSUInteger, RLMSyncProgressDirection) {
+    /// For monitoring upload progress.
+    RLMSyncProgressDirectionUpload,
+    /// For monitoring download progress.
+    RLMSyncProgressDirectionDownload,
+};
+
+/**
+ The desired behavior of a progress notification block.
+
+ Progress notification blocks can be registered on sessions if your app wishes to be informed
+ how many bytes have been uploaded or downloaded, for example to show progress indicator UIs.
+ */
+typedef NS_ENUM(NSUInteger, RLMSyncProgress) {
+    /**
+     The block will be called indefinitely, or until it is unregistered by calling
+     `-[RLMProgressNotificationToken stop]`.
+
+     Notifications will always report the latest number of transferred bytes, and the
+     most up-to-date number of total transferrable bytes.
+     */
+    RLMSyncProgressReportIndefinitely,
+    /**
+     The block will, upon registration, store the total number of bytes
+     to be transferred. When invoked, it will always report the most up-to-date number
+     of transferrable bytes out of that original number of transferrable bytes.
+
+     When the number of transferred bytes reaches or exceeds the
+     number of transferrable bytes, the block will be unregistered.
+     */
+    RLMSyncProgressForCurrentlyOutstandingWork,
+};
+
+@class RLMSyncUser, RLMSyncConfiguration;
+
+/**
+ The type of a progress notification block intended for reporting a session's network
+ activity to the user.
+
+ `transferredBytes` refers to the number of bytes that have been uploaded or downloaded.
+ `transferrableBytes` refers to the total number of bytes transferred, and pending transfer.
+ */
+typedef void(^RLMProgressNotificationBlock)(NSUInteger transferredBytes, NSUInteger transferrableBytes);
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ A token object corresponding to a progress notification block on a session object.
+
+ To stop notifications manually, call `-stop` on it. Notifications should be stopped before
+ the token goes out of scope or is destroyed.
+ */
+@interface RLMProgressNotificationToken : RLMNotificationToken
+@end
+
+/**
+ An object encapsulating a Realm Object Server "session". Sessions represent the
+ communication between the client (and a local Realm file on disk), and the server
+ (and a remote Realm at a given URL stored on a Realm Object Server).
+
+ Sessions are always created by the SDK and vended out through various APIs. The
+ lifespans of sessions associated with Realms are managed automatically. Session
+ objects can be accessed from any thread.
+ */
+@interface RLMSyncSession : NSObject
+
+/// The session's current state.
+@property (nonatomic, readonly) RLMSyncSessionState state;
+
+/// The Realm Object Server URL of the remote Realm this session corresponds to.
+@property (nullable, nonatomic, readonly) NSURL *realmURL;
+
+/// The user that owns this session.
+- (nullable RLMSyncUser *)parentUser;
+
+/**
+ If the session is valid, return a sync configuration that can be used to open the Realm
+ associated with this session.
+ */
+- (nullable RLMSyncConfiguration *)configuration;
+
+/**
+ Register a progress notification block.
+
+ Multiple blocks can be registered with the same session at once. Each block
+ will be invoked on a side queue devoted to progress notifications.
+ 
+ If the session has already received progress information from the
+ synchronization subsystem, the block will be called immediately. Otherwise, it
+ will be called as soon as progress information becomes available.
+
+ The token returned by this method must be retained as long as progress
+ notifications are desired, and the `-stop` method should be called on it
+ when notifications are no longer needed and before the token is destroyed.
+
+ If no token is returned, the notification block will never be called again.
+ There are a number of reasons this might be true. If the session has previously
+ experienced a fatal error it will not accept progress notification blocks. If
+ the block was configured in the `RLMSyncProgressForCurrentlyOutstandingWork`
+ mode but there is no additional progress to report (for example, the number
+ of transferrable bytes and transferred bytes are equal), the block will not be
+ called again.
+
+ @param direction The transfer direction (upload or download) to track in this progress notification block.
+ @param mode      The desired behavior of this progress notification block.
+ @param block     The block to invoke when notifications are available.
+
+ @return A token which must be held for as long as you want notifications to be delivered.
+
+ @see `RLMSyncProgressDirection`, `RLMSyncProgress`, `RLMProgressNotificationBlock`, `RLMProgressNotificationToken`
+ */
+- (nullable RLMProgressNotificationToken *)addProgressNotificationForDirection:(RLMSyncProgressDirection)direction
+                                                                          mode:(RLMSyncProgress)mode
+                                                                         block:(RLMProgressNotificationBlock)block
+NS_REFINED_FOR_SWIFT;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 233 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncUser.h

@@ -0,0 +1,233 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+@class RLMSyncUser, RLMSyncCredentials, RLMSyncPermissionValue, RLMSyncPermissionResults, RLMSyncSession, RLMRealm;
+
+/**
+ The state of the user object.
+ */
+typedef NS_ENUM(NSUInteger, RLMSyncUserState) {
+    /// The user is logged out. Call `logInWithCredentials:...` with valid credentials to log the user back in.
+    RLMSyncUserStateLoggedOut,
+    /// The user is logged in, and any Realms associated with it are syncing with the Realm Object Server.
+    RLMSyncUserStateActive,
+    /// The user has encountered a fatal error state, and cannot be used.
+    RLMSyncUserStateError,
+};
+
+/// A block type used for APIs which asynchronously vend an `RLMSyncUser`.
+typedef void(^RLMUserCompletionBlock)(RLMSyncUser * _Nullable, NSError * _Nullable);
+
+/// A block type used to report the status of a password change operation.
+/// If the `NSError` argument is nil, the operation succeeded.
+typedef void(^RLMPasswordChangeStatusBlock)(NSError * _Nullable);
+
+/// A block type used to report the status of a permission apply or revoke operation.
+/// If the `NSError` argument is nil, the operation succeeded.
+typedef void(^RLMPermissionStatusBlock)(NSError * _Nullable);
+
+/// A block type used to asynchronously report results of a permissions get operation.
+/// Exactly one of the two arguments will be populated.
+typedef void(^RLMPermissionResultsBlock)(RLMSyncPermissionResults * _Nullable, NSError * _Nullable);
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ A `RLMSyncUser` instance represents a single Realm Object Server user account.
+
+ A user may have one or more credentials associated with it. These credentials
+ uniquely identify the user to the authentication provider, and are used to sign
+ into a Realm Object Server user account.
+
+ Note that user objects are only vended out via SDK APIs, and cannot be directly
+ initialized. User objects can be accessed from any thread.
+ */
+@interface RLMSyncUser : NSObject
+
+/**
+ A dictionary of all valid, logged-in user identities corresponding to their user objects.
+ */
++ (NSDictionary<NSString *, RLMSyncUser *> *)allUsers NS_REFINED_FOR_SWIFT;
+
+/**
+ The logged-in user. `nil` if none exists.
+
+ @warning Throws an exception if more than one logged-in user exists.
+ */
++ (nullable RLMSyncUser *)currentUser NS_REFINED_FOR_SWIFT;
+
+/**
+ The unique Realm Object Server user ID string identifying this user.
+ */
+@property (nullable, nonatomic, readonly) NSString *identity;
+
+/**
+ The URL of the authentication server this user will communicate with.
+ */
+@property (nullable, nonatomic, readonly) NSURL *authenticationServer;
+
+/**
+ Whether the user is a Realm Object Server administrator. Value reflects the
+ state at the time of the last successful login of this user.
+ */
+@property (nonatomic, readonly) BOOL isAdmin;
+
+/**
+ The current state of the user.
+ */
+@property (nonatomic, readonly) RLMSyncUserState state;
+
+#pragma mark - Lifecycle
+
+/**
+ Create, log in, and asynchronously return a new user object, specifying a custom timeout for the network request.
+ Credentials identifying the user must be passed in. The user becomes available in the completion block, at which point
+ it is ready for use.
+ */
++ (void)logInWithCredentials:(RLMSyncCredentials *)credentials
+               authServerURL:(NSURL *)authServerURL
+                     timeout:(NSTimeInterval)timeout
+                onCompletion:(RLMUserCompletionBlock)completion NS_REFINED_FOR_SWIFT;
+
+/**
+ Create, log in, and asynchronously return a new user object. Credentials identifying the user must be passed in. The
+ user becomes available in the completion block, at which point it is ready for use.
+ */
++ (void)logInWithCredentials:(RLMSyncCredentials *)credentials
+               authServerURL:(NSURL *)authServerURL
+                onCompletion:(RLMUserCompletionBlock)completion
+NS_SWIFT_UNAVAILABLE("Use the full version of this API.");
+
+/**
+ Log a user out, destroying their server state, unregistering them from the SDK,
+ and removing any synced Realms associated with them from on-disk storage on
+ next app launch. If the user is already logged out or in an error state, this
+ method does nothing.
+
+ This method should be called whenever the application is committed to not using
+ a user again unless they are recreated.
+ Failing to call this method may result in unused files and metadata needlessly
+ taking up space.
+ */
+- (void)logOut;
+
+#pragma mark - Sessions
+
+/**
+ Retrieve a valid session object belonging to this user for a given URL, or `nil` if no such object exists.
+ */
+- (nullable RLMSyncSession *)sessionForURL:(NSURL *)url;
+
+/**
+ Retrieve all the valid sessions belonging to this user.
+ */
+- (NSArray<RLMSyncSession *> *)allSessions;
+
+#pragma mark - Passwords
+
+/**
+ Change this user's password asynchronously.
+
+ @warning Changing a user's password using an authentication server that doesn't
+          use HTTPS is a major security flaw, and should only be done while
+          testing.
+
+ @param newPassword The user's new password.
+ @param completion  Completion block invoked when login has completed or failed.
+                    The callback will be invoked on a background queue provided
+                    by `NSURLSession`.
+ */
+- (void)changePassword:(NSString *)newPassword completion:(RLMPasswordChangeStatusBlock)completion;
+
+// This set of permissions APIs uses immutable `RLMSyncPermissionValue` objects to
+// retrieve and apply permissions. It is intended to replace the set of APIs which
+// directly access Realms and Realm model objects to work with permissions.
+#pragma mark - Value-based Permissions API
+
+/**
+ Asynchronously retrieve all permissions associated with the user calling this method.
+
+ The results will be returned through the callback block, or an error if the operation failed.
+ The callback block will be run on the same thread the method was called on.
+
+ @warning This method must be called from a thread with a currently active run loop. Unless
+          you have manually configured a run loop on a side thread, this will usually be the
+          main thread.
+
+ @see `RLMSyncPermissionResults`
+ */
+- (void)retrievePermissionsWithCallback:(RLMPermissionResultsBlock)callback;
+
+/**
+ Apply a given permission.
+
+ The operation will take place asynchronously, and the callback will be used to report whether
+ the permission change succeeded or failed. The user calling this method must have the right
+ to grant the given permission, or else the operation will fail.
+
+ @see `RLMSyncPermissionValue`
+ */
+- (void)applyPermission:(RLMSyncPermissionValue *)permission callback:(RLMPermissionStatusBlock)callback;
+
+/**
+ Revoke a given permission.
+
+ The operation will take place asynchronously, and the callback will be used to report whether
+ the permission change succeeded or failed. The user calling this method must have the right
+ to grant the given permission, or else the operation will fail.
+
+ @see `RLMSyncPermissionValue`
+ */
+- (void)revokePermission:(RLMSyncPermissionValue *)permission callback:(RLMPermissionStatusBlock)callback;
+
+// These permission APIs access Realms and Realm model objects representing
+// various permission states and actions, as well as standard Realm
+// affordances, to work with permissions. It is being deprecated in favor of
+// the `retrievePermissionsWithCallback:`, `applyPermission:callback:`, and
+// `revokePermission:callback:` APIs.
+#pragma mark - Realm Object-based Permissions API
+
+/**
+ Returns an instance of the Management Realm owned by the user.
+
+ This Realm can be used to control access permissions for Realms managed by the user.
+ This includes granting other users access to Realms.
+ */
+- (RLMRealm *)managementRealmWithError:(NSError **)error NS_REFINED_FOR_SWIFT;
+
+/**
+ Returns an instance of the Permission Realm owned by the user.
+
+ This read-only Realm contains `RLMSyncPermission` objects reflecting the
+ synchronized Realms and permission details this user has access to.
+ */
+- (RLMRealm *)permissionRealmWithError:(NSError **)error __deprecated_msg("Use `-retrievePermissionsWithCallback:`") NS_REFINED_FOR_SWIFT;
+
+#pragma mark - Miscellaneous
+
+/// :nodoc:
+- (instancetype)init __attribute__((unavailable("RLMSyncUser cannot be created directly")));
+
+/// :nodoc:
++ (instancetype)new __attribute__((unavailable("RLMSyncUser cannot be created directly")));
+
+NS_ASSUME_NONNULL_END
+
+@end

+ 181 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncUtil.h

@@ -0,0 +1,181 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMConstants.h>
+
+/// A token originating from the Realm Object Server.
+typedef NSString* RLMServerToken;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/// A user info key for use with `RLMSyncErrorClientResetError`.
+extern NSString *const kRLMSyncPathOfRealmBackupCopyKey;
+
+/// A user info key for use with `RLMSyncErrorClientResetError`.
+extern NSString *const kRLMSyncInitiateClientResetBlockKey;
+
+/**
+ The error domain string for all SDK errors related to errors reported
+ by the synchronization manager error handler, as well as general sync
+ errors that don't fall into any of the other categories.
+ */
+extern NSString *const RLMSyncErrorDomain;
+
+/**
+ The error domain string for all SDK errors related to the authentication
+ endpoint.
+ */
+extern NSString *const RLMSyncAuthErrorDomain;
+
+/**
+ The error domain string for all SDK errors related to the permissions
+ system and APIs.
+ */
+extern NSString *const RLMSyncPermissionErrorDomain;
+
+/**
+ An error related to a problem that might be reported by the synchronization manager
+ error handler, or a callback on a sync-related API that performs asynchronous work.
+ */
+typedef RLM_ERROR_ENUM(NSInteger, RLMSyncError, RLMSyncErrorDomain) {
+    /**
+     An error that indicates that the response received from the
+     authentication server was malformed.
+     
+     @warning This error is deprecated, and has been replaced by
+              `RLMSyncAuthErrorBadResponse`.
+     */
+    RLMSyncErrorBadResponse __deprecated_msg("This error has been replaced by 'RLMSyncAuthErrorBadResponse'") = 1,
+
+    /// An error that indicates a problem with the session (a specific Realm opened for sync).
+    RLMSyncErrorClientSessionError      = 4,
+
+    /// An error that indicates a problem with a specific user.
+    RLMSyncErrorClientUserError         = 5,
+
+    /** 
+     An error that indicates an internal, unrecoverable problem
+     with the underlying synchronization engine.
+     */
+    RLMSyncErrorClientInternalError     = 6,
+
+    /**
+     An error that indicates the Realm needs to be reset.
+
+     A synced Realm may need to be reset because the Realm Object Server encountered an
+     error and had to be restored from a backup. If the backup copy of the remote Realm
+     is of an earlier version than the local copy of the Realm, the server will ask the
+     client to reset the Realm.
+
+     The reset process is as follows: the local copy of the Realm is copied into a recovery
+     directory for safekeeping, and then deleted from the original location. The next time
+     the Realm for that URL is opened, the Realm will automatically be re-downloaded from the
+     Realm Object Server, and can be used as normal.
+
+     Data written to the Realm after the local copy of the Realm diverged from the backup
+     remote copy will be present in the local recovery copy of the Realm file. The
+     re-downloaded Realm will initially contain only the data present at the time the Realm
+     was backed up on the server.
+
+     The client reset process can be initiated in one of two ways. The block provided in the
+     `userInfo` dictionary under `kRLMSyncInitiateClientResetBlockKey` can be called to
+     initiate the reset process. This block can be called any time after the error is
+     received, but should only be called if and when your app closes and invalidates every
+     instance of the offending Realm on all threads (note that autorelease pools may make this
+     difficult to guarantee).
+
+     If the block is not called, the client reset process will be automatically carried out
+     the next time the app is launched and the `RLMSyncManager` singleton is accessed.
+
+     The value for the `kRLMSyncPathOfRealmBackupCopyKey` key in the `userInfo` dictionary
+     describes the path of the recovered copy of the Realm. This copy will not actually be
+     created until the client reset process is initiated.
+
+     @see `-[NSError rlmSync_clientResetBlock]`, `-[NSError rlmSync_clientResetBackedUpRealmPath]`
+     */
+    RLMSyncErrorClientResetError        = 7,
+
+    /**
+     An error that indicates an authentication error occurred.
+
+     The `kRLMSyncUnderlyingErrorKey` key in the user info dictionary will contain the
+     underlying error, which is guaranteed to be under the `RLMSyncAuthErrorDomain`
+     error domain.
+     */
+    RLMSyncErrorUnderlyingAuthError     = 8,
+};
+
+/// An error which is related to authentication to a Realm Object Server.
+typedef RLM_ERROR_ENUM(NSInteger, RLMSyncAuthError, RLMSyncAuthErrorDomain) {
+    /// An error that indicates that the response received from the authentication server was malformed.
+    RLMSyncAuthErrorBadResponse         = 1,
+
+    /// An error that indicates that the supplied Realm path was invalid, or could not be resolved by the authentication
+    /// server.
+    RLMSyncAuthErrorBadRemoteRealmPath  = 2,
+
+    /// An error that indicates that the response received from the authentication server was an HTTP error code. The
+    /// `userInfo` dictionary contains the actual error code value.
+    RLMSyncAuthErrorHTTPStatusCodeError = 3,
+
+    /// An error that indicates a problem with the session (a specific Realm opened for sync).
+    RLMSyncAuthErrorClientSessionError  = 4,
+
+    /// An error that indicates that the provided credentials are invalid.
+    RLMSyncAuthErrorInvalidCredential   = 611,
+
+    /// An error that indicates that the user with provided credentials does not exist.
+    RLMSyncAuthErrorUserDoesNotExist    = 612,
+
+    /// An error that indicates that the user cannot be registered as it exists already.
+    RLMSyncAuthErrorUserAlreadyExists   = 613,
+};
+
+/**
+ An error related to the permissions subsystem.
+ */
+typedef RLM_ERROR_ENUM(NSInteger, RLMSyncPermissionError, RLMSyncPermissionErrorDomain) {
+    /**
+     An error that indicates a permission change operation failed. The `userInfo`
+     dictionary contains the underlying error code and a message (if any).
+     */
+    RLMSyncPermissionErrorChangeFailed  = 1,
+
+    /**
+     An error that indicates that attempting to retrieve permissions failed.
+     */
+    RLMSyncPermissionErrorGetFailed     = 2,
+};
+
+/// An enum representing the different states a sync management object can take.
+typedef NS_ENUM(NSUInteger, RLMSyncManagementObjectStatus) {
+    /// The management object has not yet been processed by the object server.
+    RLMSyncManagementObjectStatusNotProcessed,
+    /// The operations encoded in the management object have been successfully
+    /// performed by the object server.
+    RLMSyncManagementObjectStatusSuccess,
+    /**
+     The operations encoded in the management object were not successfully
+     performed by the object server.
+     Refer to the `statusCode` and `statusMessage` properties for more details
+     about the error.
+     */
+    RLMSyncManagementObjectStatusError,
+};
+
+NS_ASSUME_NONNULL_END

+ 106 - 0
Libraries external/Realm/Realm.framework/Headers/RLMThreadSafeReference.h

@@ -0,0 +1,106 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+@class RLMRealm;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ Objects of types which conform to `RLMThreadConfined` can be managed by a Realm, which will make
+ them bound to a thread-specific `RLMRealm` instance. Managed objects must be explicitly exported
+ and imported to be passed between threads.
+
+ Managed instances of objects conforming to this protocol can be converted to a thread-safe
+ reference for transport between threads by passing to the
+ `+[RLMThreadSafeReference referenceWithThreadConfined:]` constructor.
+
+ Note that only types defined by Realm can meaningfully conform to this protocol, and defining new
+ classes which attempt to conform to it will not make them work with `RLMThreadSafeReference`.
+ */
+@protocol RLMThreadConfined <NSObject>
+// Conformance to the `RLMThreadConfined_Private` protocol will be enforced at runtime.
+
+/**
+ The Realm which manages the object, or `nil` if the object is unmanaged.
+
+ Unmanaged objects are not confined to a thread and cannot be passed to methods expecting a
+ `RLMThreadConfined` object.
+ */
+@property (nonatomic, readonly, nullable) RLMRealm *realm;
+
+/// Indicates if the object can no longer be accessed because it is now invalid.
+@property (nonatomic, readonly, getter = isInvalidated) BOOL invalidated;
+
+@end
+
+/**
+ An object intended to be passed between threads containing a thread-safe reference to its
+ thread-confined object.
+
+ To resolve a thread-safe reference on a target Realm on a different thread, pass to
+ `-[RLMRealm resolveThreadSafeReference:]`.
+
+ @warning A `RLMThreadSafeReference` object must be resolved at most once.
+          Failing to resolve a `RLMThreadSafeReference` will result in the source version of the
+          Realm being pinned until the reference is deallocated.
+
+ @note Prefer short-lived `RLMThreadSafeReference`s as the data for the version of the source Realm
+       will be retained until all references have been resolved or deallocated.
+
+ @see `RLMThreadConfined`
+ @see `-[RLMRealm resolveThreadSafeReference:]`
+ */
+@interface RLMThreadSafeReference<__covariant Confined : id<RLMThreadConfined>> : NSObject
+
+/**
+ Create a thread-safe reference to the thread-confined object.
+
+ @param threadConfined The thread-confined object to create a thread-safe reference to.
+
+ @note You may continue to use and access the thread-confined object after passing it to this
+       constructor.
+ */
++ (instancetype)referenceWithThreadConfined:(Confined)threadConfined;
+
+/**
+ Indicates if the reference can no longer be resolved because an attempt to resolve it has already
+ occurred. References can only be resolved once.
+ */
+@property (nonatomic, readonly, getter = isInvalidated) BOOL invalidated;
+
+#pragma mark - Unavailable Methods
+
+/**
+ `-[RLMThreadSafeReference init]` is not available because `RLMThreadSafeReference` cannot be
+ created directly. `RLMThreadSafeReference` instances must be obtained by calling
+ `-[RLMRealm resolveThreadSafeReference:]`.
+ */
+- (instancetype)init __attribute__((unavailable("RLMThreadSafeReference cannot be created directly")));
+
+/**
+ `-[RLMThreadSafeReference new]` is not available because `RLMThreadSafeReference` cannot be
+ created directly. `RLMThreadSafeReference` instances must be obtained by calling
+ `-[RLMRealm resolveThreadSafeReference:]`.
+ */
++ (instancetype)new __attribute__((unavailable("RLMThreadSafeReference cannot be created directly")));
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 44 - 0
Libraries external/Realm/Realm.framework/Headers/Realm.h

@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+#import <Realm/RLMArray.h>
+#import <Realm/RLMMigration.h>
+#import <Realm/RLMObject.h>
+#import <Realm/RLMObjectSchema.h>
+#import <Realm/RLMPlatform.h>
+#import <Realm/RLMProperty.h>
+#import <Realm/RLMRealm.h>
+#import <Realm/RLMRealmConfiguration.h>
+#import <Realm/RLMRealmConfiguration+Sync.h>
+#import <Realm/RLMResults.h>
+#import <Realm/RLMSchema.h>
+#import <Realm/RLMSyncConfiguration.h>
+#import <Realm/RLMSyncCredentials.h>
+#import <Realm/RLMSyncManager.h>
+#import <Realm/RLMSyncPermission.h>
+#import <Realm/RLMSyncPermissionChange.h>
+#import <Realm/RLMSyncPermissionOffer.h>
+#import <Realm/RLMSyncPermissionOfferResponse.h>
+#import <Realm/RLMSyncPermissionResults.h>
+#import <Realm/RLMSyncPermissionValue.h>
+#import <Realm/RLMSyncSession.h>
+#import <Realm/RLMSyncUser.h>
+#import <Realm/RLMSyncUtil.h>
+#import <Realm/NSError+RLMSync.h>

BIN
Libraries external/Realm/Realm.framework/Info.plist


+ 244 - 0
Libraries external/Realm/Realm.framework/LICENSE

@@ -0,0 +1,244 @@
+TABLE OF CONTENTS
+
+1. Apache License version 2.0
+2. Realm Components
+3. Export Compliance
+
+-------------------------------------------------------------------------------
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+REALM COMPONENTS
+
+This software contains components with separate copyright and license terms.
+Your use of these components is subject to the terms and conditions of the
+following licenses.
+
+For the Realm Core component
+
+  Realm Core Binary License
+
+  Copyright (c) 2011-2016 Realm Inc All rights reserved
+
+  Redistribution and use in binary form, with or without modification, is
+  permitted provided that the following conditions are met:
+
+  1. You agree not to attempt to decompile, disassemble, reverse engineer or
+  otherwise discover the source code from which the binary code was derived.
+  You may, however, access and obtain a separate license for most of the
+  source code from which this Software was created, at
+  http://realm.io/pricing/.
+
+  2. Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+  3. Neither the name of the copyright holder nor the names of its
+  contributors may be used to endorse or promote products derived from this
+  software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+EXPORT COMPLIANCE
+
+You understand that the Software may contain cryptographic functions that may be
+subject to export restrictions, and you represent and warrant that you are not
+(i) located in a jurisdiction that is subject to United States economic
+sanctions (“Prohibited Jurisdiction”), including Cuba, Iran, North Korea,
+Sudan, Syria or the Crimea region, (ii) a person listed on any U.S. government
+blacklist (to include the List of Specially Designated Nationals and Blocked
+Persons or the Consolidated Sanctions List administered by the U.S. Department
+of the Treasury’s Office of Foreign Assets Control, or the Denied Persons List
+or Entity List administered by the U.S. Department of Commerce)
+(“Sanctioned Person”), or (iii) controlled or 50% or more owned by a Sanctioned
+Person.
+
+You agree to comply with all export, re-export and import restrictions and
+regulations of the U.S. Department of Commerce or other agency or authority of
+the United States or other applicable countries. You also agree not to transfer,
+or authorize the transfer of, directly or indirectly, of the Software to any
+Prohibited Jurisdiction, or otherwise in violation of any such restrictions or
+regulations.

+ 29 - 0
Libraries external/Realm/Realm.framework/Modules/module.modulemap

@@ -0,0 +1,29 @@
+framework module Realm {
+    umbrella header "Realm.h"
+
+    export *
+    module * { export * }
+
+    explicit module Private {
+        header "RLMAccessor.h"
+        header "RLMArray_Private.h"
+        header "RLMListBase.h"
+        header "RLMObjectBase_Dynamic.h"
+        header "RLMObjectSchema_Private.h"
+        header "RLMObjectStore.h"
+        header "RLMObject_Private.h"
+        header "RLMOptionalBase.h"
+        header "RLMProperty_Private.h"
+        header "RLMRealmConfiguration_Private.h"
+        header "RLMRealm_Private.h"
+        header "RLMResults_Private.h"
+        header "RLMSchema_Private.h"
+        header "RLMSyncConfiguration_Private.h"
+        header "RLMSyncUtil_Private.h"
+    }
+
+    explicit module Dynamic {
+        header "RLMRealm_Dynamic.h"
+        header "RLMObjectBase_Dynamic.h"
+    }
+}

+ 60 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMAccessor.h

@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+
+@class RLMObjectSchema, RLMProperty, RLMObjectBase, RLMProperty;
+
+#ifdef __cplusplus
+typedef NSUInteger RLMCreationOptions;
+#else
+typedef NS_OPTIONS(NSUInteger, RLMCreationOptions);
+#endif
+
+NS_ASSUME_NONNULL_BEGIN
+
+//
+// Accessors Class Creation/Caching
+//
+
+// get accessor classes for an object class - generates classes if not cached
+Class RLMManagedAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema, const char *name);
+Class RLMUnmanagedAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema);
+
+//
+// Dynamic getters/setters
+//
+FOUNDATION_EXTERN void RLMDynamicValidatedSet(RLMObjectBase *obj, NSString *propName, id __nullable val);
+FOUNDATION_EXTERN id __nullable RLMDynamicGet(RLMObjectBase *obj, RLMProperty *prop);
+FOUNDATION_EXTERN id __nullable RLMDynamicGetByName(RLMObjectBase *obj, NSString *propName, bool asList);
+
+// by property/column
+void RLMDynamicSet(RLMObjectBase *obj, RLMProperty *prop, id val, RLMCreationOptions options);
+
+//
+// Class modification
+//
+
+// Replace className method for the given class
+void RLMReplaceClassNameMethod(Class accessorClass, NSString *className);
+
+// Replace sharedSchema method for the given class
+void RLMReplaceSharedSchemaMethod(Class accessorClass, RLMObjectSchema * __nullable schema);
+
+NS_ASSUME_NONNULL_END

+ 28 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMArray_Private.h

@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMArray.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMArray ()
+- (instancetype)initWithObjectClassName:(NSString *)objectClassName;
+- (NSString *)descriptionWithMaxDepth:(NSUInteger)depth;
+@end
+
+NS_ASSUME_NONNULL_END

+ 33 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMListBase.h

@@ -0,0 +1,33 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+@class RLMArray;
+
+NS_ASSUME_NONNULL_BEGIN
+
+// A base class for Swift generic Lists to make it possible to interact with
+// them from obj-c
+@interface RLMListBase : NSObject <NSFastEnumeration>
+@property (nonatomic, strong) RLMArray *_rlmArray;
+
+- (instancetype)initWithArray:(RLMArray *)array;
+@end
+
+NS_ASSUME_NONNULL_END

+ 40 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMMigration_Private.h

@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMMigration.h>
+#import <Realm/RLMObjectBase.h>
+#import <Realm/RLMRealm.h>
+
+namespace realm {
+    class Schema;
+}
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMMigration ()
+
+@property (nonatomic, strong) RLMRealm *oldRealm;
+@property (nonatomic, strong) RLMRealm *realm;
+
+- (instancetype)initWithRealm:(RLMRealm *)realm oldRealm:(RLMRealm *)oldRealm schema:(realm::Schema &)schema;
+
+- (void)execute:(RLMMigrationBlock)block;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 71 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h

@@ -0,0 +1,71 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMObjectSchema.h>
+
+#import <objc/runtime.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+// RLMObjectSchema private
+@interface RLMObjectSchema () {
+@public
+    bool _isSwiftClass;
+}
+
+/// The object type name reported to the object store and core.
+@property (nonatomic, readonly) NSString *objectName;
+
+// writable redeclaration
+@property (nonatomic, readwrite, copy) NSArray<RLMProperty *> *properties;
+@property (nonatomic, readwrite, assign) bool isSwiftClass;
+
+// class used for this object schema
+@property (nonatomic, readwrite, assign) Class objectClass;
+@property (nonatomic, readwrite, assign) Class accessorClass;
+@property (nonatomic, readwrite, assign) Class unmanagedClass;
+
+@property (nonatomic, readwrite, nullable) RLMProperty *primaryKeyProperty;
+
+@property (nonatomic, copy) NSArray<RLMProperty *> *computedProperties;
+@property (nonatomic, readonly) NSArray<RLMProperty *> *swiftGenericProperties;
+
+// returns a cached or new schema for a given object class
++ (instancetype)schemaForObjectClass:(Class)objectClass;
+@end
+
+@interface RLMObjectSchema (Dynamic)
+/**
+ This method is useful only in specialized circumstances, for example, when accessing objects
+ in a Realm produced externally. If you are simply building an app on Realm, it is not recommended
+ to use this method as an [RLMObjectSchema](RLMObjectSchema) is generated automatically for every [RLMObject](RLMObject) subclass.
+ 
+ Initialize an RLMObjectSchema with classname, objectClass, and an array of properties
+ 
+ @warning This method is useful only in specialized circumstances.
+ 
+ @param objectClassName     The name of the class used to refer to objects of this type.
+ @param objectClass         The Objective-C class used when creating instances of this type.
+ @param properties          An array of RLMProperty instances describing the managed properties for this type.
+ 
+ @return    An initialized instance of RLMObjectSchema.
+ */
+- (instancetype)initWithClassName:(NSString *)objectClassName objectClass:(Class)objectClass properties:(NSArray *)properties;
+@end
+
+NS_ASSUME_NONNULL_END

+ 104 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h

@@ -0,0 +1,104 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+@class RLMRealm, RLMSchema, RLMObjectBase, RLMResults, RLMProperty;
+
+NS_ASSUME_NONNULL_BEGIN
+
+//
+// Accessor Creation
+//
+
+// create or get cached accessors for the given schema
+void RLMRealmCreateAccessors(RLMSchema *schema);
+
+
+//
+// Options for object creation
+//
+typedef NS_OPTIONS(NSUInteger, RLMCreationOptions) {
+    // Normal object creation
+    RLMCreationOptionsNone = 0,
+    // If the property is a link or array property, upsert the linked objects
+    // if they have a primary key, and insert them otherwise.
+    RLMCreationOptionsCreateOrUpdate = 1 << 0,
+    // Allow unmanaged objects to be promoted to managed objects
+    // if false objects are copied during object creation
+    RLMCreationOptionsPromoteUnmanaged = 1 << 1,
+    // Use the SetDefault instruction.
+    RLMCreationOptionsSetDefault = 1 << 2,
+};
+
+
+//
+// Adding, Removing, Getting Objects
+//
+
+// add an object to the given realm
+void RLMAddObjectToRealm(RLMObjectBase *object, RLMRealm *realm, bool createOrUpdate);
+
+// delete an object from its realm
+void RLMDeleteObjectFromRealm(RLMObjectBase *object, RLMRealm *realm);
+
+// deletes all objects from a realm
+void RLMDeleteAllObjectsFromRealm(RLMRealm *realm);
+
+// get objects of a given class
+RLMResults *RLMGetObjects(RLMRealm *realm, NSString *objectClassName, NSPredicate * _Nullable predicate)
+NS_RETURNS_RETAINED;
+
+// get an object with the given primary key
+id _Nullable RLMGetObject(RLMRealm *realm, NSString *objectClassName, id _Nullable key) NS_RETURNS_RETAINED;
+
+// create object from array or dictionary
+RLMObjectBase *RLMCreateObjectInRealmWithValue(RLMRealm *realm, NSString *className, id _Nullable value, bool createOrUpdate)
+NS_RETURNS_RETAINED;
+    
+
+//
+// Accessor Creation
+//
+
+
+// switch List<> properties from being backed by unmanaged RLMArrays to RLMArrayLinkView
+void RLMInitializeSwiftAccessorGenerics(RLMObjectBase *object);
+
+#ifdef __cplusplus
+}
+
+namespace realm {
+    class Table;
+    template<typename T> class BasicRowExpr;
+    using RowExpr = BasicRowExpr<Table>;
+}
+class RLMClassInfo;
+
+// Create accessors
+RLMObjectBase *RLMCreateObjectAccessor(RLMRealm *realm, RLMClassInfo& info,
+                                       NSUInteger index) NS_RETURNS_RETAINED;
+RLMObjectBase *RLMCreateObjectAccessor(RLMRealm *realm, RLMClassInfo& info,
+                                       realm::RowExpr row) NS_RETURNS_RETAINED;
+#endif
+
+NS_ASSUME_NONNULL_END

+ 104 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h

@@ -0,0 +1,104 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMObjectBase_Dynamic.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+// RLMObject accessor and read/write realm
+@interface RLMObjectBase () {
+@public
+    RLMRealm *_realm;
+    __unsafe_unretained RLMObjectSchema *_objectSchema;
+}
+
+// unmanaged initializer
+- (instancetype)initWithValue:(id)value schema:(RLMSchema *)schema NS_DESIGNATED_INITIALIZER;
+
+// live accessor initializer
+- (instancetype)initWithRealm:(__unsafe_unretained RLMRealm *const)realm
+                       schema:(RLMObjectSchema *)schema NS_DESIGNATED_INITIALIZER;
+
+// shared schema for this class
++ (nullable RLMObjectSchema *)sharedSchema;
+
+// provide injection point for alternative Swift object util class
++ (Class)objectUtilClass:(BOOL)isSwift;
+
+@end
+
+@interface RLMObject ()
+
+// unmanaged initializer
+- (instancetype)initWithValue:(id)value schema:(RLMSchema *)schema NS_DESIGNATED_INITIALIZER;
+
+// live accessor initializer
+- (instancetype)initWithRealm:(__unsafe_unretained RLMRealm *const)realm
+                       schema:(RLMObjectSchema *)schema NS_DESIGNATED_INITIALIZER;
+
+@end
+
+@interface RLMDynamicObject : RLMObject
+
+@end
+
+// A reference to an object's row that doesn't keep the object accessor alive.
+// Used by some Swift property types, such as LinkingObjects, to avoid retain cycles
+// with their containing object.
+@interface RLMWeakObjectHandle : NSObject<NSCopying>
+
+- (instancetype)initWithObject:(RLMObjectBase *)object;
+
+// Consumes the row, so can only usefully be called once.
+@property (nonatomic, readonly) RLMObjectBase *object;
+
+@end
+
+// Calls valueForKey: and re-raises NSUndefinedKeyExceptions
+FOUNDATION_EXTERN id _Nullable RLMValidatedValueForProperty(id object, NSString *key, NSString *className);
+
+// Compare two RLObjectBases
+FOUNDATION_EXTERN BOOL RLMObjectBaseAreEqual(RLMObjectBase * _Nullable o1, RLMObjectBase * _Nullable o2);
+
+typedef void (^RLMObjectNotificationCallback)(NSArray<NSString *> *_Nullable propertyNames,
+                                              NSArray *_Nullable oldValues,
+                                              NSArray *_Nullable newValues,
+                                              NSError *_Nullable error);
+FOUNDATION_EXTERN RLMNotificationToken *RLMObjectAddNotificationBlock(RLMObjectBase *obj, RLMObjectNotificationCallback block);
+
+// Get ObjectUil class for objc or swift
+FOUNDATION_EXTERN Class RLMObjectUtilClass(BOOL isSwift);
+
+FOUNDATION_EXTERN const NSUInteger RLMDescriptionMaxDepth;
+
+@class RLMProperty, RLMArray;
+@interface RLMObjectUtil : NSObject
+
++ (nullable NSArray<NSString *> *)ignoredPropertiesForClass:(Class)cls;
++ (nullable NSArray<NSString *> *)indexedPropertiesForClass:(Class)cls;
++ (nullable NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *)linkingObjectsPropertiesForClass:(Class)cls;
+
++ (nullable NSArray<NSString *> *)getGenericListPropertyNames:(id)obj;
++ (nullable NSDictionary<NSString *, NSString *> *)getLinkingObjectsProperties:(id)object;
+
++ (nullable NSDictionary<NSString *, NSNumber *> *)getOptionalProperties:(id)obj;
++ (nullable NSArray<NSString *> *)requiredPropertiesForClass:(Class)cls;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 38 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMOptionalBase.h

@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2015 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Foundation/Foundation.h>
+#import <Realm/RLMConstants.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMObjectBase, RLMProperty;
+
+@interface RLMOptionalBase : NSProxy
+
+- (instancetype)init;
+
+@property (nonatomic, weak) RLMObjectBase *object;
+
+@property (nonatomic, unsafe_unretained) RLMProperty *property;
+
+@property (nonatomic, strong, nullable) id underlyingValue;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 139 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h

@@ -0,0 +1,139 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMProperty.h>
+
+#import <objc/runtime.h>
+
+@class RLMObjectBase;
+
+NS_ASSUME_NONNULL_BEGIN
+
+BOOL RLMPropertyTypeIsNullable(RLMPropertyType propertyType);
+BOOL RLMPropertyTypeIsComputed(RLMPropertyType propertyType);
+FOUNDATION_EXTERN void RLMValidateSwiftPropertyName(NSString *name);
+
+// Translate an rlmtype to a string representation
+static inline NSString *RLMTypeToString(RLMPropertyType type) {
+    switch (type) {
+        case RLMPropertyTypeString:
+            return @"string";
+        case RLMPropertyTypeInt:
+            return @"int";
+        case RLMPropertyTypeBool:
+            return @"bool";
+        case RLMPropertyTypeDate:
+            return @"date";
+        case RLMPropertyTypeData:
+            return @"data";
+        case RLMPropertyTypeDouble:
+            return @"double";
+        case RLMPropertyTypeFloat:
+            return @"float";
+        case RLMPropertyTypeAny:
+            return @"any";
+        case RLMPropertyTypeObject:
+            return @"object";
+        case RLMPropertyTypeArray:
+            return @"array";
+        case RLMPropertyTypeLinkingObjects:
+            return @"linking objects";
+    }
+    return @"Unknown";
+}
+
+// private property interface
+@interface RLMProperty () {
+@public
+    RLMPropertyType _type;
+    Ivar _swiftIvar;
+}
+
+- (instancetype)initWithName:(NSString *)name
+                     indexed:(BOOL)indexed
+      linkPropertyDescriptor:(nullable RLMPropertyDescriptor *)linkPropertyDescriptor
+                    property:(objc_property_t)property;
+
+- (instancetype)initSwiftPropertyWithName:(NSString *)name
+                                  indexed:(BOOL)indexed
+                   linkPropertyDescriptor:(nullable RLMPropertyDescriptor *)linkPropertyDescriptor
+                                 property:(objc_property_t)property
+                                 instance:(RLMObjectBase *)objectInstance;
+
+- (instancetype)initSwiftListPropertyWithName:(NSString *)name
+                                         ivar:(Ivar)ivar
+                              objectClassName:(nullable NSString *)objectClassName;
+
+- (instancetype)initSwiftOptionalPropertyWithName:(NSString *)name
+                                          indexed:(BOOL)indexed
+                                             ivar:(Ivar)ivar
+                                     propertyType:(RLMPropertyType)propertyType;
+
+- (instancetype)initSwiftLinkingObjectsPropertyWithName:(NSString *)name
+                                                   ivar:(Ivar)ivar
+                                        objectClassName:(nullable NSString *)objectClassName
+                                 linkOriginPropertyName:(nullable NSString *)linkOriginPropertyName;
+
+// private setters
+@property (nonatomic, readwrite) NSString *name;
+@property (nonatomic, readwrite, assign) RLMPropertyType type;
+@property (nonatomic, readwrite) BOOL indexed;
+@property (nonatomic, readwrite) BOOL optional;
+@property (nonatomic, copy, nullable) NSString *objectClassName;
+
+// private properties
+@property (nonatomic, assign) NSUInteger index;
+@property (nonatomic, assign) BOOL isPrimary;
+@property (nonatomic, assign) Ivar swiftIvar;
+
+// getter and setter names
+@property (nonatomic, copy) NSString *getterName;
+@property (nonatomic, copy) NSString *setterName;
+@property (nonatomic) SEL getterSel;
+@property (nonatomic) SEL setterSel;
+
+- (RLMProperty *)copyWithNewName:(NSString *)name;
+
+@end
+
+@interface RLMProperty (Dynamic)
+/**
+ This method is useful only in specialized circumstances, for example, in conjunction with
+ +[RLMObjectSchema initWithClassName:objectClass:properties:]. If you are simply building an
+ app on Realm, it is not recommened to use this method.
+ 
+ Initialize an RLMProperty
+ 
+ @warning This method is useful only in specialized circumstances.
+ 
+ @param name            The property name.
+ @param type            The property type.
+ @param objectClassName The object type used for Object and Array types.
+ @param linkOriginPropertyName The property name of the origin of a link. Used for linking objects properties.
+
+ @return    An initialized instance of RLMProperty.
+ */
+- (instancetype)initWithName:(NSString *)name
+                        type:(RLMPropertyType)type
+             objectClassName:(nullable NSString *)objectClassName
+      linkOriginPropertyName:(nullable NSString *)linkOriginPropertyName
+                     indexed:(BOOL)indexed
+                    optional:(BOOL)optional;
+@end
+
+NS_ASSUME_NONNULL_END

+ 43 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMRealmConfiguration_Private.h

@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2015 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMRealmConfiguration.h>
+
+@class RLMSchema;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMRealmConfiguration ()
+
+@property (nonatomic, readwrite) bool cache;
+@property (nonatomic, readwrite) bool dynamic;
+@property (nonatomic, readwrite) bool disableFormatUpgrade;
+@property (nonatomic, copy, nullable) RLMSchema *customSchema;
+@property (nonatomic, copy) NSString *pathOnDisk;
+
+// Get the default confiugration without copying it
++ (RLMRealmConfiguration *)rawDefaultConfiguration;
+
++ (void)resetRealmConfigurationState;
+@end
+
+// Get a path in the platform-appropriate documents directory with the given filename
+FOUNDATION_EXTERN NSString *RLMRealmPathForFile(NSString *fileName);
+FOUNDATION_EXTERN NSString *RLMRealmPathForFileAndBundleIdentifier(NSString *fileName, NSString *mainBundleIdentifier);
+
+NS_ASSUME_NONNULL_END

+ 52 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMRealm_Private.h

@@ -0,0 +1,52 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMRealm.h>
+
+@class RLMFastEnumerator;
+
+NS_ASSUME_NONNULL_BEGIN
+
+// Disable syncing files to disk. Cannot be re-enabled. Use only for tests.
+FOUNDATION_EXTERN void RLMDisableSyncToDisk();
+
+FOUNDATION_EXTERN NSData * _Nullable RLMRealmValidatedEncryptionKey(NSData *key);
+
+// Translate an in-flight exception resulting from opening a SharedGroup to
+// an NSError or NSException (if error is nil)
+void RLMRealmTranslateException(NSError **error);
+
+// RLMRealm private members
+@interface RLMRealm ()
+
+@property (nonatomic, readonly) BOOL dynamic;
+@property (nonatomic, readwrite) RLMSchema *schema;
+
++ (void)resetRealmState;
+
+- (void)registerEnumerator:(RLMFastEnumerator *)enumerator;
+- (void)unregisterEnumerator:(RLMFastEnumerator *)enumerator;
+- (void)detachAllEnumerators;
+
+- (void)sendNotifications:(RLMNotification)notification;
+- (void)verifyThread;
+- (void)verifyNotificationsAreSupported;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 32 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMResults_Private.h

@@ -0,0 +1,32 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMResults.h>
+
+@class RLMObjectSchema;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMResults ()
+@property (nonatomic, readonly, getter=isAttached) BOOL attached;
+
++ (instancetype)emptyDetachedResults;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 54 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h

@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2014 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMSchema.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RLMRealm;
+
+//
+// RLMSchema private interface
+//
+@interface RLMSchema ()
+
+/**
+ Returns an `RLMSchema` containing only the given `RLMObject` subclasses.
+
+ @param classes The classes to be included in the schema.
+
+ @return An `RLMSchema` containing only the given classes.
+ */
++ (instancetype)schemaWithObjectClasses:(NSArray<Class> *)classes;
+
+@property (nonatomic, readwrite, copy) NSArray<RLMObjectSchema *> *objectSchema;
+
+// schema based on runtime objects
++ (instancetype)sharedSchema;
+
+// schema based upon all currently registered object classes
++ (instancetype)partialSharedSchema;
+
+// class for string
++ (nullable Class)classForString:(NSString *)className;
+
++ (nullable RLMObjectSchema *)sharedSchemaForClass:(Class)cls;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 38 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h

@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMSyncConfiguration.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef NS_ENUM(NSUInteger, RLMSyncStopPolicy) {
+    RLMSyncStopPolicyImmediately,
+    RLMSyncStopPolicyLiveIndefinitely,
+    RLMSyncStopPolicyAfterChangesUploaded,
+};
+
+@interface RLMSyncConfiguration ()
+
+@property (nonatomic, readwrite) RLMSyncStopPolicy stopPolicy;
+
+// Internal-only APIs
+@property (nullable, nonatomic) NSURL *customFileURL;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 39 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncPermissionChange_Private.h

@@ -0,0 +1,39 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import "RLMSyncPermissionChange.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMSyncPermissionChange()
+
+@property (readwrite) NSString *id;
+@property (readwrite) NSDate *createdAt;
+@property (readwrite) NSDate *updatedAt;
+@property (nullable, readwrite) NSNumber<RLMInt> *statusCode;
+@property (nullable, readwrite) NSString *statusMessage;
+@property (readwrite) NSString *realmUrl;
+@property (readwrite) NSString *userId;
+
+@property (nullable, readwrite) NSNumber<RLMBool> *mayRead;
+@property (nullable, readwrite) NSNumber<RLMBool> *mayWrite;
+@property (nullable, readwrite) NSNumber<RLMBool> *mayManage;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 36 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncPermissionOfferResponse_Private.h

@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import "RLMSyncPermissionOfferResponse.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMSyncPermissionOfferResponse()
+
+@property (readwrite) NSString *id;
+@property (readwrite) NSDate *createdAt;
+@property (readwrite) NSDate *updatedAt;
+@property (nullable, readwrite) NSNumber<RLMInt> *statusCode;
+@property (nullable, readwrite) NSString *statusMessage;
+
+@property (readwrite) NSString *token;
+@property (nullable, readwrite) NSString *realmUrl;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 42 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncPermissionOffer_Private.h

@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import "RLMSyncPermissionOffer.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMSyncPermissionOffer()
+
+@property (readwrite) NSString *id;
+@property (readwrite) NSDate *createdAt;
+@property (readwrite) NSDate *updatedAt;
+@property (nullable, readwrite) NSNumber<RLMInt> *statusCode;
+@property (nullable, readwrite) NSString *statusMessage;
+
+@property (nullable, readwrite) NSString *token;
+@property (readwrite) NSString *realmUrl;
+
+@property (readwrite) BOOL mayRead;
+@property (readwrite) BOOL mayWrite;
+@property (readwrite) BOOL mayManage;
+
+@property (nullable, readwrite) NSDate *expiresAt;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 35 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncPermission_Private.h

@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import "RLMSyncPermission.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMSyncPermission()
+
+@property (readwrite) NSDate *updatedAt;
+@property (readwrite) NSString *userId;
+@property (readwrite) NSString *path;
+
+@property (readwrite) BOOL mayRead;
+@property (readwrite) BOOL mayWrite;
+@property (readwrite) BOOL mayManage;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 121 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h

@@ -0,0 +1,121 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMSyncUtil.h>
+
+#import <Realm/RLMProperty.h>
+#import <Realm/RLMRealmConfiguration.h>
+#import <Realm/RLMSyncCredentials.h>
+
+typedef NS_ENUM(NSUInteger, RLMSyncSystemErrorKind) {
+    // Specific
+    RLMSyncSystemErrorKindClientReset,
+    // General
+    RLMSyncSystemErrorKindClient,
+    RLMSyncSystemErrorKindConnection,
+    RLMSyncSystemErrorKindSession,
+    RLMSyncSystemErrorKindUser,
+    RLMSyncSystemErrorKindUnknown,
+};
+
+@class RLMSyncUser;
+
+typedef void(^RLMSyncCompletionBlock)(NSError * _Nullable, NSDictionary * _Nullable);
+typedef void(^RLMSyncBasicErrorReportingBlock)(NSError * _Nullable);
+
+typedef NSString* RLMServerPath;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RLMRealmConfiguration (RealmSync)
++ (instancetype)managementConfigurationForUser:(RLMSyncUser *)user;
++ (instancetype)permissionConfigurationForUser:(RLMSyncUser *)user;
+@end
+
+extern RLMIdentityProvider const RLMIdentityProviderAccessToken;
+extern RLMIdentityProvider const RLMIdentityProviderRealm;
+
+extern NSString *const kRLMSyncAppIDKey;
+extern NSString *const kRLMSyncDataKey;
+extern NSString *const kRLMSyncErrorJSONKey;
+extern NSString *const kRLMSyncErrorStatusCodeKey;
+extern NSString *const kRLMSyncIdentityKey;
+extern NSString *const kRLMSyncPasswordKey;
+extern NSString *const kRLMSyncPathKey;
+extern NSString *const kRLMSyncProviderKey;
+extern NSString *const kRLMSyncRegisterKey;
+extern NSString *const kRLMSyncUnderlyingErrorKey;
+
+/// Convert sync management object status code (nil, 0 and others) to
+/// RLMSyncManagementObjectStatus enum
+FOUNDATION_EXTERN RLMSyncManagementObjectStatus RLMMakeSyncManagementObjectStatus(NSNumber<RLMInt> * _Nullable statusCode);
+
+#define RLM_SYNC_UNINITIALIZABLE \
+- (instancetype)init __attribute__((unavailable("This type cannot be created directly"))); \
++ (instancetype)new __attribute__((unavailable("This type cannot be created directly")));
+
+NS_ASSUME_NONNULL_END
+
+/// A macro to parse a string out of a JSON dictionary, or return nil.
+#define RLM_SYNC_PARSE_STRING_OR_ABORT(json_macro_val, key_macro_val, prop_macro_val) \
+{ \
+id data = json_macro_val[key_macro_val]; \
+if (![data isKindOfClass:[NSString class]]) { return nil; } \
+self.prop_macro_val = data; \
+} \
+
+#define RLM_SYNC_PARSE_OPTIONAL_STRING(json_macro_val, key_macro_val, prop_macro_val) \
+{ \
+id data = json_macro_val[key_macro_val]; \
+if (![data isKindOfClass:[NSString class]]) { data = nil; } \
+self.prop_macro_val = data; \
+} \
+
+#define RLM_SYNC_PARSE_OPTIONAL_BOOL(json_macro_val, key_macro_val, prop_macro_val) \
+{ \
+id data = json_macro_val[key_macro_val]; \
+if (![data isKindOfClass:[NSNumber class]]) { data = @NO; } \
+self.prop_macro_val = [data boolValue]; \
+} \
+
+/// A macro to parse a double out of a JSON dictionary, or return nil.
+#define RLM_SYNC_PARSE_DOUBLE_OR_ABORT(json_macro_val, key_macro_val, prop_macro_val) \
+{ \
+id data = json_macro_val[key_macro_val]; \
+if (![data isKindOfClass:[NSNumber class]]) { return nil; } \
+self.prop_macro_val = [data doubleValue]; \
+} \
+
+/// A macro to build a sub-model out of a JSON dictionary, or return nil.
+#define RLM_SYNC_PARSE_MODEL_OR_ABORT(json_macro_val, key_macro_val, class_macro_val, prop_macro_val) \
+{ \
+id raw = json_macro_val[key_macro_val]; \
+if (![raw isKindOfClass:[NSDictionary class]]) { return nil; } \
+id model = [[class_macro_val alloc] initWithDictionary:raw]; \
+if (!model) { return nil; } \
+self.prop_macro_val = model; \
+} \
+
+#define RLM_SYNC_PARSE_OPTIONAL_MODEL(json_macro_val, key_macro_val, class_macro_val, prop_macro_val) \
+{ \
+id model; \
+id raw = json_macro_val[key_macro_val]; \
+if (![raw isKindOfClass:[NSDictionary class]]) { model = nil; } \
+else { model = [[class_macro_val alloc] initWithDictionary:raw]; } \
+self.prop_macro_val = model; \
+} \

BIN
Libraries external/Realm/Realm.framework/Realm


+ 72 - 0
Libraries external/Realm/Realm.framework/strip-frameworks.sh

@@ -0,0 +1,72 @@
+################################################################################
+#
+# Copyright 2015 Realm Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+# This script strips all non-valid architectures from dynamic libraries in
+# the application's `Frameworks` directory.
+#
+# The following environment variables are required:
+#
+# BUILT_PRODUCTS_DIR
+# FRAMEWORKS_FOLDER_PATH
+# VALID_ARCHS
+# EXPANDED_CODE_SIGN_IDENTITY
+
+
+# Signs a framework with the provided identity
+code_sign() {
+  # Use the current code_sign_identitiy
+  echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
+  echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1"
+  /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
+}
+
+# Set working directory to product’s embedded frameworks 
+cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+
+if [ "$ACTION" = "install" ]; then
+  echo "Copy .bcsymbolmap files to .xcarchive"
+  find . -name '*.bcsymbolmap' -type f -exec mv {} "${CONFIGURATION_BUILD_DIR}" \;
+else
+  # Delete *.bcsymbolmap files from framework bundle unless archiving
+  find . -name '*.bcsymbolmap' -type f -exec rm -rf "{}" +\;
+fi
+
+echo "Stripping frameworks"
+
+for file in $(find . -type f -perm +111); do
+  # Skip non-dynamic libraries
+  if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then
+    continue
+  fi
+  # Get architectures for current file
+  archs="$(lipo -info "${file}" | rev | cut -d ':' -f1 | rev)"
+  stripped=""
+  for arch in $archs; do
+    if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
+      # Strip non-valid architectures in-place
+      lipo -remove "$arch" -output "$file" "$file" || exit 1
+      stripped="$stripped $arch"
+    fi
+  done
+  if [[ "$stripped" != "" ]]; then
+    echo "Stripped $file of architectures:$stripped"
+    if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
+      code_sign "${file}"
+    fi
+  fi
+done

+ 61 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -191,6 +191,10 @@
 		F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F75037461DBFA91A008FB480 /* NSArray+PureLayout.m */; };
 		F75037511DBFA91A008FB480 /* NSLayoutConstraint+PureLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F75037481DBFA91A008FB480 /* NSLayoutConstraint+PureLayout.m */; };
 		F75797AE1E81356C00187A1B /* CTAssetsPicker.strings in Resources */ = {isa = PBXBuildFile; fileRef = F75797AC1E81356C00187A1B /* CTAssetsPicker.strings */; };
+		F75A3FF21EBCB4AA00B213E8 /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F75A3FF11EBCB4AA00B213E8 /* Realm.framework */; };
+		F75A3FFE1EBCB55A00B213E8 /* Realm.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = F75A3FF11EBCB4AA00B213E8 /* Realm.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+		F75A40011EBCB92300B213E8 /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F75A3FF11EBCB4AA00B213E8 /* Realm.framework */; };
+		F75A40021EBCB95C00B213E8 /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F75A3FF11EBCB4AA00B213E8 /* Realm.framework */; };
 		F75ADF451DC75FFE008A7347 /* CCLogin.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F75ADF441DC75FFE008A7347 /* CCLogin.storyboard */; };
 		F75AE3C71E9D12900088BB09 /* SwiftyAvatar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75AE3C61E9D12900088BB09 /* SwiftyAvatar.swift */; };
 		F75EDFAC1E8C106900E6F369 /* FirebaseAnalytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F75EDFA61E8C106900E6F369 /* FirebaseAnalytics.framework */; };
@@ -735,6 +739,17 @@
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXCopyFilesBuildPhase section */
+		F75A3FFF1EBCB55B00B213E8 /* Embed Frameworks */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 2147483647;
+			dstPath = "";
+			dstSubfolderSpec = 10;
+			files = (
+				F75A3FFE1EBCB55A00B213E8 /* Realm.framework in Embed Frameworks */,
+			);
+			name = "Embed Frameworks";
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		F77B0F981D118A16002130FE /* Embed App Extensions */ = {
 			isa = PBXCopyFilesBuildPhase;
 			buildActionMask = 2147483647;
@@ -1138,6 +1153,7 @@
 		F7540F2B1D5B238600C3FFA8 /* x509_vfy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x509_vfy.h; sourceTree = "<group>"; };
 		F7540F2C1D5B238600C3FFA8 /* x509v3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x509v3.h; sourceTree = "<group>"; };
 		F75797AD1E81356C00187A1B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/CTAssetsPicker.strings; sourceTree = "<group>"; };
+		F75A3FF11EBCB4AA00B213E8 /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Realm.framework; sourceTree = "<group>"; };
 		F75ADF441DC75FFE008A7347 /* CCLogin.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = CCLogin.storyboard; sourceTree = "<group>"; };
 		F75AE3C61E9D12900088BB09 /* SwiftyAvatar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftyAvatar.swift; sourceTree = "<group>"; };
 		F75CDBF51DF063AD00116AD0 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; name = .gitignore; path = ../.gitignore; sourceTree = "<group>"; };
@@ -1657,6 +1673,7 @@
 				F72C63891DC14B0400FA5ED5 /* libMagicalRecord.a in Frameworks */,
 				F70A630F1D5B3467004E2AA5 /* libssl.a in Frameworks */,
 				F70A630B1D5B3467004E2AA5 /* libcrypto.a in Frameworks */,
+				F75A40011EBCB92300B213E8 /* Realm.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1668,6 +1685,7 @@
 				F74344551E1277E2001CC831 /* libMagicalRecord.a in Frameworks */,
 				F74344591E12786C001CC831 /* libssl.a in Frameworks */,
 				F74344561E12784A001CC831 /* libcrypto.a in Frameworks */,
+				F75A40021EBCB95C00B213E8 /* Realm.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1694,6 +1712,7 @@
 				F75EDFAD1E8C106900E6F369 /* FirebaseCore.framework in Frameworks */,
 				F75EDFAF1E8C106900E6F369 /* FirebaseMessaging.framework in Frameworks */,
 				F7A3771A1EB2364A002856D3 /* Fabric.framework in Frameworks */,
+				F75A3FF21EBCB4AA00B213E8 /* Realm.framework in Frameworks */,
 				F7BB14961D5B62C000ECEE68 /* libcrypto.a in Frameworks */,
 				F7BB14971D5B62C000ECEE68 /* libssl.a in Frameworks */,
 				F75EDFB01E8C106900E6F369 /* GoogleToolboxForMac.framework in Frameworks */,
@@ -1755,6 +1774,7 @@
 				F75037421DBFA91A008FB480 /* PureLayout */,
 				F70F05241C889184008DAB36 /* Reachability */,
 				F7659A3A1DC0B760004860C4 /* PSTCollectionView */,
+				F75A3FF01EBCB4AA00B213E8 /* Realm */,
 				F70F05321C889184008DAB36 /* RNCryptor */,
 				F70F0F921C889487008DAB36 /* SSZipArchive */,
 				F75AE3C51E9D12900088BB09 /* SwiftyAvatar */,
@@ -2336,6 +2356,14 @@
 			path = openssl;
 			sourceTree = "<group>";
 		};
+		F75A3FF01EBCB4AA00B213E8 /* Realm */ = {
+			isa = PBXGroup;
+			children = (
+				F75A3FF11EBCB4AA00B213E8 /* Realm.framework */,
+			);
+			path = Realm;
+			sourceTree = "<group>";
+		};
 		F75AE3C51E9D12900088BB09 /* SwiftyAvatar */ = {
 			isa = PBXGroup;
 			children = (
@@ -3492,6 +3520,8 @@
 				F77B0F981D118A16002130FE /* Embed App Extensions */,
 				F73B02C01DC0F1C900EC2C33 /* ShellScript */,
 				F7A377371EB24469002856D3 /* ShellScript */,
+				F75A3FFF1EBCB55B00B213E8 /* Embed Frameworks */,
+				F75A40001EBCB82B00B213E8 /* ShellScript */,
 			);
 			buildRules = (
 			);
@@ -3890,6 +3920,19 @@
 			shellPath = /bin/sh;
 			shellScript = "#!/bin/bash\n# buildNumber=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"$INFOPLIST_FILE\")\n# buildNumber=$(echo $buildNumber | sed 's/0*//')\n# buildNumber=$(($buildNumber + 1))\n# buildNumber=$(printf \"%04d\" $buildNumber)\n# /usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"$INFOPLIST_FILE\"";
 		};
+		F75A40001EBCB82B00B213E8 /* ShellScript */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "bash \"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework/strip-frameworks.sh\"";
+		};
 		F7A377371EB24469002856D3 /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -4478,7 +4521,10 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
-				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(PROJECT_DIR)\"/Libraries external/Realm\"",
+				);
 				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;
 				GCC_PREPROCESSOR_DEFINITIONS = (
@@ -4519,7 +4565,10 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
-				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(PROJECT_DIR)\"/Libraries external/Realm\"",
+				);
 				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;
 				GCC_PREPROCESSOR_DEFINITIONS = (
@@ -4558,7 +4607,10 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
-				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(PROJECT_DIR)\"/Libraries external/Realm\"",
+				);
 				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					DEBUG,
@@ -4593,7 +4645,10 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
-				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(PROJECT_DIR)\"/Libraries external/Realm\"",
+				);
 				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					EXTENSION,
@@ -4696,6 +4751,7 @@
 					"$(inherited)",
 					"$(PROJECT_DIR)\"/Libraries external/Analytics\"",
 					"$(PROJECT_DIR)\"/Libraries external/Fabric\"",
+					"$(PROJECT_DIR)\"/Libraries external/Realm\"",
 				);
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;
@@ -4743,6 +4799,7 @@
 					"$(inherited)",
 					"$(PROJECT_DIR)\"/Libraries external/Analytics\"",
 					"$(PROJECT_DIR)\"/Libraries external/Fabric\"",
+					"$(PROJECT_DIR)\"/Libraries external/Realm\"",
 				);
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;