├── .gitignore
├── Example
├── AppDelegate.swift
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── Model
│ └── Realm
│ │ ├── Cat.swift
│ │ └── Dog.swift
├── Resources
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── Contents.json
│ └── Info.plist
└── ViewController.swift
├── LICENSE
├── Podfile
├── Podfile.lock
├── Pods
├── Manifest.lock
├── Pods.xcodeproj
│ └── project.pbxproj
├── Realm
│ ├── LICENSE
│ ├── README.md
│ ├── Realm
│ │ ├── NSError+RLMSync.m
│ │ ├── ObjectStore
│ │ │ └── src
│ │ │ │ ├── binding_callback_thread_observer.cpp
│ │ │ │ ├── collection_notifications.cpp
│ │ │ │ ├── impl
│ │ │ │ ├── apple
│ │ │ │ │ ├── external_commit_helper.cpp
│ │ │ │ │ └── keychain_helper.cpp
│ │ │ │ ├── collection_change_builder.cpp
│ │ │ │ ├── collection_notifier.cpp
│ │ │ │ ├── list_notifier.cpp
│ │ │ │ ├── object_notifier.cpp
│ │ │ │ ├── primitive_list_notifier.cpp
│ │ │ │ ├── realm_coordinator.cpp
│ │ │ │ ├── results_notifier.cpp
│ │ │ │ ├── transact_log_handler.cpp
│ │ │ │ └── weak_realm_notifier.cpp
│ │ │ │ ├── index_set.cpp
│ │ │ │ ├── list.cpp
│ │ │ │ ├── object.cpp
│ │ │ │ ├── object_schema.cpp
│ │ │ │ ├── object_store.cpp
│ │ │ │ ├── placeholder.cpp
│ │ │ │ ├── results.cpp
│ │ │ │ ├── schema.cpp
│ │ │ │ ├── shared_realm.cpp
│ │ │ │ ├── sync
│ │ │ │ ├── impl
│ │ │ │ │ ├── apple
│ │ │ │ │ │ ├── network_reachability_observer.cpp
│ │ │ │ │ │ └── system_configuration.cpp
│ │ │ │ │ ├── sync_file.cpp
│ │ │ │ │ ├── sync_metadata.cpp
│ │ │ │ │ └── work_queue.cpp
│ │ │ │ ├── partial_sync.cpp
│ │ │ │ ├── sync_config.cpp
│ │ │ │ ├── sync_manager.cpp
│ │ │ │ ├── sync_permission.cpp
│ │ │ │ ├── sync_session.cpp
│ │ │ │ └── sync_user.cpp
│ │ │ │ ├── thread_safe_reference.cpp
│ │ │ │ └── util
│ │ │ │ └── uuid.cpp
│ │ ├── RLMAccessor.mm
│ │ ├── RLMAnalytics.mm
│ │ ├── RLMArray.mm
│ │ ├── RLMClassInfo.mm
│ │ ├── RLMCollection.mm
│ │ ├── RLMConstants.m
│ │ ├── RLMJSONModels.m
│ │ ├── RLMListBase.mm
│ │ ├── RLMManagedArray.mm
│ │ ├── RLMMigration.mm
│ │ ├── RLMNetworkClient.mm
│ │ ├── RLMObject.mm
│ │ ├── RLMObjectBase.mm
│ │ ├── RLMObjectSchema.mm
│ │ ├── RLMObjectStore.mm
│ │ ├── RLMObservation.mm
│ │ ├── RLMOptionalBase.mm
│ │ ├── RLMPredicateUtil.mm
│ │ ├── RLMProperty.mm
│ │ ├── RLMQueryUtil.mm
│ │ ├── RLMRealm+Sync.mm
│ │ ├── RLMRealm.mm
│ │ ├── RLMRealmConfiguration+Sync.mm
│ │ ├── RLMRealmConfiguration.mm
│ │ ├── RLMRealmUtil.mm
│ │ ├── RLMResults.mm
│ │ ├── RLMSchema.mm
│ │ ├── RLMSwiftSupport.m
│ │ ├── RLMSyncConfiguration.mm
│ │ ├── RLMSyncCredentials.m
│ │ ├── RLMSyncManager.mm
│ │ ├── RLMSyncPermission.mm
│ │ ├── RLMSyncPermissionResults.mm
│ │ ├── RLMSyncSession.mm
│ │ ├── RLMSyncSessionRefreshHandle.mm
│ │ ├── RLMSyncSubscription.mm
│ │ ├── RLMSyncUser.mm
│ │ ├── RLMSyncUtil.mm
│ │ ├── RLMThreadSafeReference.mm
│ │ ├── RLMUpdateChecker.mm
│ │ ├── RLMUtil.mm
│ │ └── Realm.modulemap
│ ├── build.sh
│ ├── core
│ │ └── librealmcore-ios.a
│ └── include
│ │ ├── NSError+RLMSync.h
│ │ ├── RLMAccessor.h
│ │ ├── RLMAccessor.hpp
│ │ ├── RLMAnalytics.hpp
│ │ ├── RLMArray.h
│ │ ├── RLMArray_Private.h
│ │ ├── RLMArray_Private.hpp
│ │ ├── RLMClassInfo.hpp
│ │ ├── RLMCollection.h
│ │ ├── RLMCollection_Private.h
│ │ ├── RLMCollection_Private.hpp
│ │ ├── RLMConstants.h
│ │ ├── RLMJSONModels.h
│ │ ├── RLMListBase.h
│ │ ├── RLMMigration.h
│ │ ├── RLMMigration_Private.h
│ │ ├── RLMNetworkClient.h
│ │ ├── RLMObject.h
│ │ ├── RLMObjectBase.h
│ │ ├── RLMObjectBase_Dynamic.h
│ │ ├── RLMObjectBase_Private.h
│ │ ├── RLMObjectSchema.h
│ │ ├── RLMObjectSchema_Private.h
│ │ ├── RLMObjectSchema_Private.hpp
│ │ ├── RLMObjectStore.h
│ │ ├── RLMObject_Private.h
│ │ ├── RLMObject_Private.hpp
│ │ ├── RLMObservation.hpp
│ │ ├── RLMOptionalBase.h
│ │ ├── RLMPlatform.h
│ │ ├── RLMPredicateUtil.hpp
│ │ ├── RLMPrefix.h
│ │ ├── RLMProperty.h
│ │ ├── RLMProperty_Private.h
│ │ ├── RLMProperty_Private.hpp
│ │ ├── RLMQueryUtil.hpp
│ │ ├── RLMRealm+Sync.h
│ │ ├── RLMRealm.h
│ │ ├── RLMRealmConfiguration+Sync.h
│ │ ├── RLMRealmConfiguration.h
│ │ ├── RLMRealmConfiguration_Private.h
│ │ ├── RLMRealmConfiguration_Private.hpp
│ │ ├── RLMRealmUtil.hpp
│ │ ├── RLMRealm_Dynamic.h
│ │ ├── RLMRealm_Private.h
│ │ ├── RLMRealm_Private.hpp
│ │ ├── RLMResults.h
│ │ ├── RLMResults_Private.h
│ │ ├── RLMResults_Private.hpp
│ │ ├── RLMSchema.h
│ │ ├── RLMSchema_Private.h
│ │ ├── RLMSchema_Private.hpp
│ │ ├── RLMSwiftBridgingHeader.h
│ │ ├── RLMSwiftSupport.h
│ │ ├── RLMSyncConfiguration.h
│ │ ├── RLMSyncConfiguration_Private.h
│ │ ├── RLMSyncConfiguration_Private.hpp
│ │ ├── RLMSyncCredentials.h
│ │ ├── RLMSyncManager.h
│ │ ├── RLMSyncManager_Private.h
│ │ ├── RLMSyncPermission.h
│ │ ├── RLMSyncPermissionResults.h
│ │ ├── RLMSyncPermission_Private.hpp
│ │ ├── RLMSyncSession.h
│ │ ├── RLMSyncSessionRefreshHandle.h
│ │ ├── RLMSyncSessionRefreshHandle.hpp
│ │ ├── RLMSyncSession_Private.hpp
│ │ ├── RLMSyncSubscription.h
│ │ ├── RLMSyncUser.h
│ │ ├── RLMSyncUser_Private.hpp
│ │ ├── RLMSyncUtil.h
│ │ ├── RLMSyncUtil_Private.h
│ │ ├── RLMSyncUtil_Private.hpp
│ │ ├── RLMThreadSafeReference.h
│ │ ├── RLMThreadSafeReference_Private.hpp
│ │ ├── RLMUpdateChecker.hpp
│ │ ├── RLMUtil.hpp
│ │ ├── Realm.h
│ │ ├── binding_callback_thread_observer.hpp
│ │ ├── binding_context.hpp
│ │ ├── collection_notifications.hpp
│ │ ├── core
│ │ ├── realm.hpp
│ │ └── realm
│ │ │ ├── alloc.hpp
│ │ │ ├── alloc_slab.hpp
│ │ │ ├── array.hpp
│ │ │ ├── array_basic.hpp
│ │ │ ├── array_basic_tpl.hpp
│ │ │ ├── array_binary.hpp
│ │ │ ├── array_blob.hpp
│ │ │ ├── array_blobs_big.hpp
│ │ │ ├── array_direct.hpp
│ │ │ ├── array_integer.hpp
│ │ │ ├── array_string.hpp
│ │ │ ├── array_string_long.hpp
│ │ │ ├── binary_data.hpp
│ │ │ ├── bptree.hpp
│ │ │ ├── chunked_binary.hpp
│ │ │ ├── column.hpp
│ │ │ ├── column_backlink.hpp
│ │ │ ├── column_binary.hpp
│ │ │ ├── column_fwd.hpp
│ │ │ ├── column_link.hpp
│ │ │ ├── column_linkbase.hpp
│ │ │ ├── column_linklist.hpp
│ │ │ ├── column_mixed.hpp
│ │ │ ├── column_mixed_tpl.hpp
│ │ │ ├── column_string.hpp
│ │ │ ├── column_string_enum.hpp
│ │ │ ├── column_table.hpp
│ │ │ ├── column_timestamp.hpp
│ │ │ ├── column_tpl.hpp
│ │ │ ├── column_type.hpp
│ │ │ ├── column_type_traits.hpp
│ │ │ ├── data_type.hpp
│ │ │ ├── descriptor.hpp
│ │ │ ├── descriptor_fwd.hpp
│ │ │ ├── disable_sync_to_disk.hpp
│ │ │ ├── exceptions.hpp
│ │ │ ├── group.hpp
│ │ │ ├── group_shared.hpp
│ │ │ ├── group_shared_options.hpp
│ │ │ ├── group_writer.hpp
│ │ │ ├── handover_defs.hpp
│ │ │ ├── history.hpp
│ │ │ ├── impl
│ │ │ ├── array_writer.hpp
│ │ │ ├── clamped_hex_dump.hpp
│ │ │ ├── clock.hpp
│ │ │ ├── cont_transact_hist.hpp
│ │ │ ├── destroy_guard.hpp
│ │ │ ├── input_stream.hpp
│ │ │ ├── output_stream.hpp
│ │ │ ├── sequential_getter.hpp
│ │ │ ├── simulated_failure.hpp
│ │ │ └── transact_log.hpp
│ │ │ ├── index_string.hpp
│ │ │ ├── lang_bind_helper.hpp
│ │ │ ├── link_view.hpp
│ │ │ ├── link_view_fwd.hpp
│ │ │ ├── metrics
│ │ │ ├── metric_timer.hpp
│ │ │ ├── metrics.hpp
│ │ │ ├── query_info.hpp
│ │ │ └── transaction_info.hpp
│ │ │ ├── mixed.hpp
│ │ │ ├── null.hpp
│ │ │ ├── olddatetime.hpp
│ │ │ ├── owned_data.hpp
│ │ │ ├── parser
│ │ │ ├── collection_operator_expression.hpp
│ │ │ ├── expression_container.hpp
│ │ │ ├── keypath_mapping.hpp
│ │ │ ├── parser.hpp
│ │ │ ├── parser_utils.hpp
│ │ │ ├── property_expression.hpp
│ │ │ ├── query_builder.hpp
│ │ │ ├── subquery_expression.hpp
│ │ │ └── value_expression.hpp
│ │ │ ├── query.hpp
│ │ │ ├── query_conditions.hpp
│ │ │ ├── query_engine.hpp
│ │ │ ├── query_expression.hpp
│ │ │ ├── query_operators.hpp
│ │ │ ├── realm_nmmintrin.h
│ │ │ ├── replication.hpp
│ │ │ ├── row.hpp
│ │ │ ├── spec.hpp
│ │ │ ├── string_data.hpp
│ │ │ ├── sync
│ │ │ ├── changeset.hpp
│ │ │ ├── changeset_cooker.hpp
│ │ │ ├── changeset_encoder.hpp
│ │ │ ├── changeset_parser.hpp
│ │ │ ├── client.hpp
│ │ │ ├── crypto.hpp
│ │ │ ├── crypto_server.hpp
│ │ │ ├── feature_token.hpp
│ │ │ ├── history.hpp
│ │ │ ├── instruction_applier.hpp
│ │ │ ├── instruction_replication.hpp
│ │ │ ├── instructions.hpp
│ │ │ ├── object.hpp
│ │ │ ├── object_id.hpp
│ │ │ ├── permissions.hpp
│ │ │ ├── protocol.hpp
│ │ │ ├── transform.hpp
│ │ │ └── version.hpp
│ │ │ ├── table.hpp
│ │ │ ├── table_ref.hpp
│ │ │ ├── table_view.hpp
│ │ │ ├── timestamp.hpp
│ │ │ ├── unicode.hpp
│ │ │ ├── util
│ │ │ ├── aes_cryptor.hpp
│ │ │ ├── any.hpp
│ │ │ ├── assert.hpp
│ │ │ ├── backtrace.hpp
│ │ │ ├── base64.hpp
│ │ │ ├── basic_system_errors.hpp
│ │ │ ├── bind_ptr.hpp
│ │ │ ├── buffer.hpp
│ │ │ ├── buffer_stream.hpp
│ │ │ ├── call_with_tuple.hpp
│ │ │ ├── cf_ptr.hpp
│ │ │ ├── circular_buffer.hpp
│ │ │ ├── compression.hpp
│ │ │ ├── config.h
│ │ │ ├── demangle.hpp
│ │ │ ├── encrypted_file_mapping.hpp
│ │ │ ├── enum.hpp
│ │ │ ├── errno.hpp
│ │ │ ├── features.h
│ │ │ ├── file.hpp
│ │ │ ├── file_mapper.hpp
│ │ │ ├── flat_map.hpp
│ │ │ ├── hex_dump.hpp
│ │ │ ├── http.hpp
│ │ │ ├── inspect.hpp
│ │ │ ├── interprocess_condvar.hpp
│ │ │ ├── interprocess_mutex.hpp
│ │ │ ├── json_parser.hpp
│ │ │ ├── load_file.hpp
│ │ │ ├── logger.hpp
│ │ │ ├── memory_stream.hpp
│ │ │ ├── misc_errors.hpp
│ │ │ ├── misc_ext_errors.hpp
│ │ │ ├── miscellaneous.hpp
│ │ │ ├── network.hpp
│ │ │ ├── network_ssl.hpp
│ │ │ ├── optional.hpp
│ │ │ ├── overload.hpp
│ │ │ ├── parent_dir.hpp
│ │ │ ├── priority_queue.hpp
│ │ │ ├── random.hpp
│ │ │ ├── resource_limits.hpp
│ │ │ ├── safe_int_ops.hpp
│ │ │ ├── scope_exit.hpp
│ │ │ ├── serializer.hpp
│ │ │ ├── shared_ptr.hpp
│ │ │ ├── signal_blocker.hpp
│ │ │ ├── string_buffer.hpp
│ │ │ ├── system_process.hpp
│ │ │ ├── terminate.hpp
│ │ │ ├── thread.hpp
│ │ │ ├── thread_exec_guard.hpp
│ │ │ ├── time.hpp
│ │ │ ├── to_string.hpp
│ │ │ ├── type_list.hpp
│ │ │ ├── type_traits.hpp
│ │ │ ├── uri.hpp
│ │ │ ├── utf8.hpp
│ │ │ ├── value_reset_guard.hpp
│ │ │ └── websocket.hpp
│ │ │ ├── utilities.hpp
│ │ │ ├── version.hpp
│ │ │ ├── version_id.hpp
│ │ │ └── views.hpp
│ │ ├── execution_context_id.hpp
│ │ ├── feature_checks.hpp
│ │ ├── impl
│ │ ├── apple
│ │ │ ├── external_commit_helper.hpp
│ │ │ └── keychain_helper.hpp
│ │ ├── collection_change_builder.hpp
│ │ ├── collection_notifier.hpp
│ │ ├── external_commit_helper.hpp
│ │ ├── list_notifier.hpp
│ │ ├── notification_wrapper.hpp
│ │ ├── object_accessor_impl.hpp
│ │ ├── object_notifier.hpp
│ │ ├── primitive_list_notifier.hpp
│ │ ├── realm_coordinator.hpp
│ │ ├── results_notifier.hpp
│ │ ├── transact_log_handler.hpp
│ │ └── weak_realm_notifier.hpp
│ │ ├── index_set.hpp
│ │ ├── list.hpp
│ │ ├── object.hpp
│ │ ├── object_accessor.hpp
│ │ ├── object_schema.hpp
│ │ ├── object_store.hpp
│ │ ├── property.hpp
│ │ ├── results.hpp
│ │ ├── schema.hpp
│ │ ├── shared_realm.hpp
│ │ ├── sync
│ │ ├── impl
│ │ │ ├── apple
│ │ │ │ ├── network_reachability_observer.hpp
│ │ │ │ └── system_configuration.hpp
│ │ │ ├── network_reachability.hpp
│ │ │ ├── sync_client.hpp
│ │ │ ├── sync_file.hpp
│ │ │ ├── sync_metadata.hpp
│ │ │ └── work_queue.hpp
│ │ ├── partial_sync.hpp
│ │ ├── subscription_state.hpp
│ │ ├── sync_config.hpp
│ │ ├── sync_manager.hpp
│ │ ├── sync_permission.hpp
│ │ ├── sync_session.hpp
│ │ └── sync_user.hpp
│ │ ├── thread_safe_reference.hpp
│ │ └── util
│ │ ├── aligned_union.hpp
│ │ ├── apple
│ │ └── event_loop_signal.hpp
│ │ ├── atomic_shared_ptr.hpp
│ │ ├── event_loop_signal.hpp
│ │ ├── tagged_bool.hpp
│ │ └── uuid.hpp
├── RealmSwift
│ ├── LICENSE
│ ├── README.md
│ ├── RealmSwift
│ │ ├── Aliases.swift
│ │ ├── Error.swift
│ │ ├── LinkingObjects.swift
│ │ ├── List.swift
│ │ ├── Migration.swift
│ │ ├── Object.swift
│ │ ├── ObjectSchema.swift
│ │ ├── ObjectiveCSupport.swift
│ │ ├── Optional.swift
│ │ ├── Property.swift
│ │ ├── Realm.swift
│ │ ├── RealmCollection.swift
│ │ ├── RealmConfiguration.swift
│ │ ├── Results.swift
│ │ ├── Schema.swift
│ │ ├── SortDescriptor.swift
│ │ ├── SwiftVersion.swift
│ │ ├── Sync.swift
│ │ ├── ThreadSafeReference.swift
│ │ └── Util.swift
│ └── build.sh
└── Target Support Files
│ ├── Pods-Example
│ ├── Pods-Example-Info.plist
│ ├── Pods-Example-acknowledgements.markdown
│ ├── Pods-Example-acknowledgements.plist
│ ├── Pods-Example-dummy.m
│ ├── Pods-Example-frameworks.sh
│ ├── Pods-Example-umbrella.h
│ ├── Pods-Example.debug.xcconfig
│ ├── Pods-Example.modulemap
│ └── Pods-Example.release.xcconfig
│ ├── Pods-RealmSwiftService
│ ├── Pods-RealmSwiftService-Info.plist
│ ├── Pods-RealmSwiftService-acknowledgements.markdown
│ ├── Pods-RealmSwiftService-acknowledgements.plist
│ ├── Pods-RealmSwiftService-dummy.m
│ ├── Pods-RealmSwiftService-umbrella.h
│ ├── Pods-RealmSwiftService.debug.xcconfig
│ ├── Pods-RealmSwiftService.modulemap
│ └── Pods-RealmSwiftService.release.xcconfig
│ ├── Pods-RealmSwiftServiceTests
│ ├── Pods-RealmSwiftServiceTests-Info.plist
│ ├── Pods-RealmSwiftServiceTests-acknowledgements.markdown
│ ├── Pods-RealmSwiftServiceTests-acknowledgements.plist
│ ├── Pods-RealmSwiftServiceTests-dummy.m
│ ├── Pods-RealmSwiftServiceTests-umbrella.h
│ ├── Pods-RealmSwiftServiceTests.debug.xcconfig
│ ├── Pods-RealmSwiftServiceTests.modulemap
│ └── Pods-RealmSwiftServiceTests.release.xcconfig
│ ├── Realm
│ ├── Realm-Info.plist
│ ├── Realm-dummy.m
│ ├── Realm-prefix.pch
│ ├── Realm.modulemap
│ └── Realm.xcconfig
│ └── RealmSwift
│ ├── RealmSwift-Info.plist
│ ├── RealmSwift-dummy.m
│ ├── RealmSwift-prefix.pch
│ ├── RealmSwift-umbrella.h
│ ├── RealmSwift.modulemap
│ └── RealmSwift.xcconfig
├── README.md
├── RealmSwiftService.podspec
├── RealmSwiftService.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcuserdata
│ └── hayashi.xcuserdatad
│ └── xcschemes
│ └── xcschememanagement.plist
├── RealmSwiftService.xcworkspace
├── contents.xcworkspacedata
└── xcshareddata
│ └── IDEWorkspaceChecks.plist
├── RealmSwiftService
├── Info.plist
├── RealmAccessible.swift
├── RealmDao.swift
└── RealmSwiftService.h
└── RealmSwiftServiceTests
├── Info.plist
└── RealmSwiftServiceTests.swift
/Example/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Example
4 | //
5 | // Created by Tsubasa Hayashi on 2018/11/05.
6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17 | return true
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Example/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Example/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/Model/Realm/Cat.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Cat.swift
3 | // Example
4 | //
5 | // Created by Tsubasa Hayashi on 2018/11/05.
6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import RealmSwift
11 | import RealmSwiftService
12 |
13 | @objcMembers
14 | class Cat: Object, RealmAccessible {
15 |
16 | dynamic var id = UUID().uuidString
17 | dynamic var name = ""
18 |
19 | override static func primaryKey() -> String? { return "id" }
20 |
21 | convenience init(name: String) {
22 | self.init()
23 | self.name = name
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Example/Model/Realm/Dog.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Dog.swift
3 | // Example
4 | //
5 | // Created by Tsubasa Hayashi on 2018/11/05.
6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import RealmSwift
11 |
12 | @objcMembers
13 | class Dog: Object {
14 |
15 | dynamic var id = UUID().uuidString
16 | dynamic var name = ""
17 |
18 | override static func primaryKey() -> String? { return "id" }
19 |
20 | convenience init(name: String) {
21 | self.init()
22 | self.name = name
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/Example/Resources/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Example/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // Example
4 | //
5 | // Created by Tsubasa Hayashi on 2018/11/05.
6 | // Copyright © 2018 Tsubasa Hayashi. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import RealmSwiftService
11 |
12 | class ViewController: UIViewController {
13 |
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | //--- RealmAccessible Example ---
18 | let cat = Cat(name: "tama") // Create Realm Object
19 | _ = Cat.all() // Get All Object of Cat
20 | _ = Cat.find(by: "id") // Find Cat by id property
21 | _ = Cat.first() // Get Last Object of Cat
22 | _ = Cat.last() // Get First Object of Cat
23 | try! cat.save() // Save Object of Cat
24 | try! cat.delete() // Delete Object of Cat
25 | try! Cat.deleteAll() // Delete All Object of Cat
26 |
27 |
28 | // --- Dao Example ---
29 | let dao = RealmDao() // Create Dao of Dog
30 | let dog = Dog(name: "pochi") // Create Realm Object
31 | _ = dao.all() // Get All Object of Dog
32 | _ = dao.find(by: "id") // Find Dog by id property
33 | _ = dao.first() // Get First Object of Dog
34 | _ = dao.last() // Get Last Object of Dog
35 | try! dao.save(dog) // Save Object of Dog
36 | try! dao.delete(dog) // Delete Object of Dog
37 | try! dao.deleteAll() // Delete All Object of Dog
38 |
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2018 yokurin
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'Example' do
5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
6 | use_frameworks!
7 |
8 | # Pods for Example
9 | pod 'RealmSwift'
10 | end
11 |
12 | target 'RealmSwiftService' do
13 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
14 | use_frameworks!
15 |
16 | # Pods for RealmSwiftService
17 | pod 'RealmSwift'
18 |
19 | target 'RealmSwiftServiceTests' do
20 | inherit! :search_paths
21 | # Pods for testing
22 | end
23 |
24 | end
25 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Realm (3.11.1):
3 | - Realm/Headers (= 3.11.1)
4 | - Realm/Headers (3.11.1)
5 | - RealmSwift (3.11.1):
6 | - Realm (= 3.11.1)
7 |
8 | DEPENDENCIES:
9 | - RealmSwift
10 |
11 | SPEC REPOS:
12 | https://github.com/cocoapods/specs.git:
13 | - Realm
14 | - RealmSwift
15 |
16 | SPEC CHECKSUMS:
17 | Realm: 037c5919b9ceb59d6beed5d3b031096856b119b3
18 | RealmSwift: c9580133e73ef40ed340401af2dbc9a5790dfea7
19 |
20 | PODFILE CHECKSUM: 0a4c3ff5168c6c2157328eed71e475ded47adec5
21 |
22 | COCOAPODS: 1.6.0.beta.1
23 |
--------------------------------------------------------------------------------
/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Realm (3.11.1):
3 | - Realm/Headers (= 3.11.1)
4 | - Realm/Headers (3.11.1)
5 | - RealmSwift (3.11.1):
6 | - Realm (= 3.11.1)
7 |
8 | DEPENDENCIES:
9 | - RealmSwift
10 |
11 | SPEC REPOS:
12 | https://github.com/cocoapods/specs.git:
13 | - Realm
14 | - RealmSwift
15 |
16 | SPEC CHECKSUMS:
17 | Realm: 037c5919b9ceb59d6beed5d3b031096856b119b3
18 | RealmSwift: c9580133e73ef40ed340401af2dbc9a5790dfea7
19 |
20 | PODFILE CHECKSUM: 0a4c3ff5168c6c2157328eed71e475ded47adec5
21 |
22 | COCOAPODS: 1.6.0.beta.1
23 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/NSError+RLMSync.m:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2017 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import "NSError+RLMSync.h"
20 |
21 | #import "RLMSyncUtil.h"
22 |
23 | @implementation NSError (RLMSync)
24 |
25 | - (RLMSyncErrorActionToken *)rlmSync_errorActionToken {
26 | if (self.domain != RLMSyncErrorDomain) {
27 | return nil;
28 | }
29 | if (self.code == RLMSyncErrorClientResetError
30 | || self.code == RLMSyncErrorPermissionDeniedError) {
31 | return (RLMSyncErrorActionToken *)self.userInfo[kRLMSyncErrorActionTokenKey];
32 | }
33 | return nil;
34 | }
35 |
36 | - (NSString *)rlmSync_clientResetBackedUpRealmPath {
37 | if (self.domain == RLMSyncErrorDomain && self.code == RLMSyncErrorClientResetError) {
38 | return self.userInfo[kRLMSyncPathOfRealmBackupCopyKey];
39 | }
40 | return nil;
41 | }
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/ObjectStore/src/binding_callback_thread_observer.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2017 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #include "binding_callback_thread_observer.hpp"
20 |
21 | namespace realm {
22 | BindingCallbackThreadObserver* g_binding_callback_thread_observer = nullptr;
23 | }
24 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/ObjectStore/src/collection_notifications.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2016 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #include "collection_notifications.hpp"
20 |
21 | #include "impl/collection_notifier.hpp"
22 |
23 | using namespace realm;
24 | using namespace realm::_impl;
25 |
26 | NotificationToken::NotificationToken(std::shared_ptr<_impl::CollectionNotifier> notifier, uint64_t token)
27 | : m_notifier(std::move(notifier)), m_token(token)
28 | {
29 | }
30 |
31 | NotificationToken::~NotificationToken()
32 | {
33 | // m_notifier itself (and not just the pointed-to thing) needs to be accessed
34 | // atomically to ensure that there are no data races when the token is
35 | // destroyed after being modified on a different thread.
36 | // This is needed despite the token not being thread-safe in general as
37 | // users find it very surprising for obj-c objects to care about what
38 | // thread they are deallocated on.
39 | if (auto notifier = m_notifier.exchange({})) {
40 | notifier->remove_callback(m_token);
41 | }
42 | }
43 |
44 | NotificationToken::NotificationToken(NotificationToken&&) = default;
45 |
46 | NotificationToken& NotificationToken::operator=(realm::NotificationToken&& rgt)
47 | {
48 | if (this != &rgt) {
49 | if (auto notifier = m_notifier.exchange({})) {
50 | notifier->remove_callback(m_token);
51 | }
52 | m_notifier = std::move(rgt.m_notifier);
53 | m_token = rgt.m_token;
54 | }
55 | return *this;
56 | }
57 |
58 | void NotificationToken::suppress_next()
59 | {
60 | m_notifier.load()->suppress_next_notification(m_token);
61 | }
62 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/ObjectStore/src/impl/weak_realm_notifier.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2015 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #include "impl/weak_realm_notifier.hpp"
20 |
21 | #include "shared_realm.hpp"
22 | #include "util/event_loop_signal.hpp"
23 |
24 | using namespace realm;
25 | using namespace realm::_impl;
26 |
27 |
28 | WeakRealmNotifier::WeakRealmNotifier(const std::shared_ptr& realm, bool cache)
29 | : m_realm(realm)
30 | , m_execution_context(realm->config().execution_context)
31 | , m_realm_key(realm.get())
32 | , m_cache(cache)
33 | , m_signal(std::make_shared>(Callback{realm}))
34 | {
35 | }
36 |
37 | WeakRealmNotifier::~WeakRealmNotifier() = default;
38 |
39 | void WeakRealmNotifier::Callback::operator()() const
40 | {
41 | if (auto realm = weak_realm.lock()) {
42 | realm->notify();
43 | }
44 | }
45 |
46 | void WeakRealmNotifier::notify()
47 | {
48 | m_signal->notify();
49 | }
50 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/ObjectStore/src/placeholder.cpp:
--------------------------------------------------------------------------------
1 | // This file is intentionally left blank.
2 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/ObjectStore/src/sync/impl/work_queue.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2018 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #include "sync/impl/work_queue.hpp"
20 |
21 | #include
22 |
23 | namespace realm {
24 | namespace _impl {
25 | namespace partial_sync {
26 |
27 | WorkQueue::~WorkQueue()
28 | {
29 | {
30 | std::unique_lock lock(m_mutex);
31 | m_stopping = true;
32 | }
33 | m_cv.notify_one();
34 |
35 | if (m_thread.joinable())
36 | m_thread.join();
37 | }
38 |
39 | void WorkQueue::enqueue(std::function function)
40 | {
41 | {
42 | std::unique_lock lock(m_mutex);
43 | m_queue.push_back(std::move(function));
44 |
45 | if (m_stopped)
46 | create_thread();
47 | }
48 | m_cv.notify_one();
49 | }
50 |
51 | void WorkQueue::create_thread()
52 | {
53 | if (m_thread.joinable())
54 | m_thread.join();
55 |
56 | m_thread = std::thread([this] {
57 | std::vector> queue;
58 |
59 | std::unique_lock lock(m_mutex);
60 | while (!m_stopping &&
61 | m_cv.wait_for(lock, std::chrono::milliseconds(500),
62 | [&] { return !m_queue.empty() || m_stopping; })) {
63 |
64 | swap(queue, m_queue);
65 |
66 | lock.unlock();
67 | for (auto& f : queue)
68 | f();
69 | queue.clear();
70 | lock.lock();
71 | }
72 |
73 | m_stopped = true;
74 | });
75 | m_stopped = false;
76 | }
77 |
78 | } // namespace partial_sync
79 | } // namespace _impl
80 | } // namespace realm
81 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/ObjectStore/src/sync/sync_config.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2017 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #include "sync/sync_config.hpp"
20 |
21 | #include "sync/sync_manager.hpp"
22 |
23 | #include
24 |
25 | namespace realm {
26 |
27 | std::string SyncConfig::partial_sync_identifier(const SyncUser& user)
28 | {
29 | std::string raw_identifier = SyncManager::shared().client_uuid() + "/" + user.local_identity();
30 |
31 | // The type of the argument to sha1() changed in sync 3.11.1. Implicitly
32 | // convert to either char or unsigned char so that both signatures work.
33 | struct cast {
34 | uint8_t* value;
35 | operator uint8_t*() { return value; }
36 | operator char*() { return reinterpret_cast(value); }
37 | };
38 | uint8_t identifier[20];
39 | sync::crypto::sha1(raw_identifier.data(), raw_identifier.size(), cast{&identifier[0]});
40 |
41 | std::stringstream ss;
42 | ss << std::hex << std::setfill('0');
43 | for (uint8_t c : identifier)
44 | ss << std::setw(2) << (unsigned)c;
45 | return ss.str();
46 | }
47 |
48 | std::string SyncConfig::realm_url() const
49 | {
50 | REALM_ASSERT(reference_realm_url.length() > 0);
51 | REALM_ASSERT(user);
52 |
53 | if (!is_partial)
54 | return reference_realm_url;
55 |
56 | std::string base_url = reference_realm_url;
57 | if (base_url.back() == '/')
58 | base_url.pop_back();
59 |
60 | if (custom_partial_sync_identifier)
61 | return util::format("%1/__partial/%2", base_url, *custom_partial_sync_identifier);
62 | return util::format("%1/__partial/%2/%3", base_url, user->identity(), partial_sync_identifier(*user));
63 | }
64 |
65 | } // namespace realm
66 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/RLMConstants.m:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 |
21 | RLMNotification const RLMRealmRefreshRequiredNotification = @"RLMRealmRefreshRequiredNotification";
22 | RLMNotification const RLMRealmDidChangeNotification = @"RLMRealmDidChangeNotification";
23 |
24 | NSString * const RLMErrorDomain = @"io.realm";
25 |
26 | NSString * const RLMUnknownSystemErrorDomain = @"io.realm.unknown";
27 |
28 | NSString * const RLMExceptionName = @"RLMException";
29 |
30 | NSString * const RLMRealmVersionKey = @"RLMRealmVersion";
31 |
32 | NSString * const RLMRealmCoreVersionKey = @"RLMRealmCoreVersion";
33 |
34 | NSString * const RLMInvalidatedKey = @"invalidated";
35 |
36 | NSString * const RLMBackupRealmConfigurationErrorKey = @"RLMBackupRealmConfiguration";
37 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/RLMListBase.mm:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2015 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import "RLMListBase.h"
20 |
21 | #import "RLMArray_Private.hpp"
22 | #import "RLMObservation.hpp"
23 |
24 | @interface RLMArray (KVO)
25 | - (NSArray *)objectsAtIndexes:(__unused NSIndexSet *)indexes;
26 | @end
27 |
28 | @implementation RLMListBase {
29 | std::unique_ptr _observationInfo;
30 | }
31 |
32 | - (instancetype)initWithArray:(RLMArray *)array {
33 | self = [super init];
34 | if (self) {
35 | __rlmArray = array;
36 | }
37 | return self;
38 | }
39 |
40 | - (id)valueForKey:(NSString *)key {
41 | return [__rlmArray valueForKey:key];
42 | }
43 |
44 | - (id)valueForKeyPath:(NSString *)keyPath {
45 | return [__rlmArray valueForKeyPath:keyPath];
46 | }
47 |
48 | - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained [])buffer count:(NSUInteger)len {
49 | return [__rlmArray countByEnumeratingWithState:state objects:buffer count:len];
50 | }
51 |
52 | - (NSArray *)objectsAtIndexes:(NSIndexSet *)indexes {
53 | return [__rlmArray objectsAtIndexes:indexes];
54 | }
55 |
56 | - (void)addObserver:(id)observer
57 | forKeyPath:(NSString *)keyPath
58 | options:(NSKeyValueObservingOptions)options
59 | context:(void *)context {
60 | RLMEnsureArrayObservationInfo(_observationInfo, keyPath, __rlmArray, self);
61 | [super addObserver:observer forKeyPath:keyPath options:options context:context];
62 | }
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/RLMRealm+Sync.mm:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2017 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import "RLMRealm+Sync.h"
20 |
21 | #import "RLMObjectBase.h"
22 | #import "RLMObjectSchema.h"
23 | #import "RLMRealm_Private.hpp"
24 | #import "RLMResults_Private.hpp"
25 | #import "RLMSchema.h"
26 | #import "RLMSyncSession.h"
27 |
28 | #import "results.hpp"
29 | #import "sync/partial_sync.hpp"
30 | #import "shared_realm.hpp"
31 |
32 | using namespace realm;
33 |
34 | @implementation RLMRealm (Sync)
35 |
36 | - (void)subscribeToObjects:(Class)type where:(NSString *)query callback:(RLMPartialSyncFetchCallback)callback {
37 | NSString *className = [type className];
38 | auto cb = [=](Results results, std::exception_ptr err) {
39 | if (err) {
40 | try {
41 | rethrow_exception(err);
42 | }
43 | catch (...) {
44 | NSError *error = nil;
45 | RLMRealmTranslateException(&error);
46 | callback(nil, error);
47 | }
48 | return;
49 | }
50 | callback([RLMResults resultsWithObjectInfo:_info[className] results:std::move(results)], nil);
51 | };
52 | partial_sync::register_query(_realm, className.UTF8String, query.UTF8String, std::move(cb));
53 | }
54 |
55 | - (RLMSyncSession *)syncSession {
56 | return [RLMSyncSession sessionForRealm:self];
57 | }
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/RLMSwiftSupport.m:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import "RLMSwiftSupport.h"
20 |
21 | @implementation RLMSwiftSupport
22 |
23 | + (BOOL)isSwiftClassName:(NSString *)className {
24 | return [className rangeOfString:@"."].location != NSNotFound;
25 | }
26 |
27 | + (NSString *)demangleClassName:(NSString *)className {
28 | return [className substringFromIndex:[className rangeOfString:@"."].location + 1];
29 | }
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/Realm.modulemap:
--------------------------------------------------------------------------------
1 | framework module Realm {
2 | umbrella header "Realm.h"
3 |
4 | export *
5 | module * { export * }
6 |
7 | explicit module Private {
8 | header "RLMAccessor.h"
9 | header "RLMArray_Private.h"
10 | header "RLMCollection_Private.h"
11 | header "RLMListBase.h"
12 | header "RLMObject_Private.h"
13 | header "RLMObjectBase_Dynamic.h"
14 | header "RLMObjectBase_Private.h"
15 | header "RLMObjectSchema_Private.h"
16 | header "RLMObjectStore.h"
17 | header "RLMOptionalBase.h"
18 | header "RLMProperty_Private.h"
19 | header "RLMRealm_Private.h"
20 | header "RLMRealmConfiguration_Private.h"
21 | header "RLMResults_Private.h"
22 | header "RLMSchema_Private.h"
23 | header "RLMSyncConfiguration_Private.h"
24 | header "RLMSyncUtil_Private.h"
25 | }
26 |
27 | explicit module Dynamic {
28 | header "RLMRealm_Dynamic.h"
29 | header "RLMObjectBase_Dynamic.h"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Pods/Realm/core/librealmcore-ios.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yokurin/RealmSwiftService/c4f886ec10952f8fba8f35b5bf5824f44c434ff6/Pods/Realm/core/librealmcore-ios.a
--------------------------------------------------------------------------------
/Pods/Realm/include/NSError+RLMSync.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2017 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 |
21 | NS_ASSUME_NONNULL_BEGIN
22 |
23 | @class RLMSyncErrorActionToken;
24 |
25 | /// NSError category extension providing methods to get data out of Realm's
26 | /// "client reset" error.
27 | @interface NSError (RLMSync)
28 |
29 | /**
30 | Given an appropriate Realm Object Server error, return the token that
31 | can be passed into `+[RLMSyncSession immediatelyHandleError:]` to
32 | immediately perform error clean-up work, or nil if the error isn't of
33 | a type that provides a token.
34 | */
35 | - (nullable RLMSyncErrorActionToken *)rlmSync_errorActionToken NS_REFINED_FOR_SWIFT;
36 |
37 | /**
38 | Given a Realm Object Server client reset error, return the path where the
39 | backup copy of the Realm will be placed once the client reset process is
40 | complete.
41 | */
42 | - (nullable NSString *)rlmSync_clientResetBackedUpRealmPath NS_SWIFT_UNAVAILABLE("");
43 |
44 | @end
45 |
46 | NS_ASSUME_NONNULL_END
47 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMAccessor.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 |
21 | @class RLMObjectSchema, RLMProperty, RLMObjectBase;
22 |
23 | NS_ASSUME_NONNULL_BEGIN
24 |
25 | //
26 | // Accessors Class Creation/Caching
27 | //
28 |
29 | // get accessor classes for an object class - generates classes if not cached
30 | Class RLMManagedAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema, const char *name);
31 | Class RLMUnmanagedAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema);
32 |
33 | //
34 | // Dynamic getters/setters
35 | //
36 | FOUNDATION_EXTERN void RLMDynamicValidatedSet(RLMObjectBase *obj, NSString *propName, id __nullable val);
37 | FOUNDATION_EXTERN id __nullable RLMDynamicGet(RLMObjectBase *obj, RLMProperty *prop);
38 | FOUNDATION_EXTERN id __nullable RLMDynamicGetByName(RLMObjectBase *obj, NSString *propName, bool asList);
39 |
40 | // by property/column
41 | void RLMDynamicSet(RLMObjectBase *obj, RLMProperty *prop, id val);
42 |
43 | //
44 | // Class modification
45 | //
46 |
47 | // Replace className method for the given class
48 | void RLMReplaceClassNameMethod(Class accessorClass, NSString *className);
49 |
50 | // Replace sharedSchema method for the given class
51 | void RLMReplaceSharedSchemaMethod(Class accessorClass, RLMObjectSchema * __nullable schema);
52 |
53 | NS_ASSUME_NONNULL_END
54 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMArray_Private.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 | #import
21 |
22 | NS_ASSUME_NONNULL_BEGIN
23 |
24 | @interface RLMArray ()
25 | - (instancetype)initWithObjectClassName:(NSString *)objectClassName;
26 | - (instancetype)initWithObjectType:(RLMPropertyType)type optional:(BOOL)optional;
27 | - (NSString *)descriptionWithMaxDepth:(NSUInteger)depth;
28 | @end
29 |
30 | void RLMArrayValidateMatchingObjectType(RLMArray *array, id value);
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMCollection_Private.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2016 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 |
21 | #import
22 |
23 | @protocol RLMFastEnumerable;
24 |
25 | void RLMCollectionSetValueForKey(id collection, NSString *key, id value);
26 | FOUNDATION_EXTERN NSString *RLMDescriptionWithMaxDepth(NSString *name, id collection, NSUInteger depth);
27 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMListBase.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 |
21 | @class RLMArray;
22 |
23 | NS_ASSUME_NONNULL_BEGIN
24 |
25 | // A base class for Swift generic Lists to make it possible to interact with
26 | // them from obj-c
27 | @interface RLMListBase : NSObject
28 | @property (nonatomic, strong) RLMArray *_rlmArray;
29 |
30 | - (instancetype)initWithArray:(RLMArray *)array;
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMMigration_Private.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 | #import
21 | #import
22 |
23 | namespace realm {
24 | class Schema;
25 | }
26 |
27 | NS_ASSUME_NONNULL_BEGIN
28 |
29 | @interface RLMMigration ()
30 |
31 | @property (nonatomic, strong) RLMRealm *oldRealm;
32 | @property (nonatomic, strong) RLMRealm *realm;
33 |
34 | - (instancetype)initWithRealm:(RLMRealm *)realm oldRealm:(RLMRealm *)oldRealm schema:(realm::Schema &)schema;
35 |
36 | - (void)execute:(RLMMigrationBlock)block;
37 |
38 | @end
39 |
40 | NS_ASSUME_NONNULL_END
41 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMObjectBase.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 |
21 | NS_ASSUME_NONNULL_BEGIN
22 |
23 | @class RLMRealm;
24 | @class RLMSchema;
25 | @class RLMObjectSchema;
26 |
27 | /// :nodoc:
28 | @interface RLMObjectBase : NSObject
29 |
30 | @property (nonatomic, readonly, getter = isInvalidated) BOOL invalidated;
31 |
32 | - (instancetype)init NS_DESIGNATED_INITIALIZER;
33 |
34 | + (NSString *)className;
35 |
36 | // Returns whether the class is included in the default set of classes managed by a Realm.
37 | + (BOOL)shouldIncludeInDefaultSchema;
38 |
39 | + (nullable NSString *)_realmObjectName;
40 | + (nullable NSDictionary *)_realmColumnNames;
41 |
42 | @end
43 |
44 | NS_ASSUME_NONNULL_END
45 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMObjectBase_Private.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2017 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 |
21 | NS_ASSUME_NONNULL_BEGIN
22 |
23 | // RLMObjectBase private
24 | @interface RLMObjectBase ()
25 | + (void)initializeLinkedObjectSchemas;
26 | @end
27 |
28 | NS_ASSUME_NONNULL_END
29 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMObjectSchema.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 |
21 | NS_ASSUME_NONNULL_BEGIN
22 |
23 | @class RLMProperty;
24 |
25 | /**
26 | This class represents Realm model object schemas.
27 |
28 | When using Realm, `RLMObjectSchema` instances allow performing migrations and
29 | introspecting the database's schema.
30 |
31 | Object schemas map to tables in the core database.
32 | */
33 | @interface RLMObjectSchema : NSObject
34 |
35 | #pragma mark - Properties
36 |
37 | /**
38 | An array of `RLMProperty` instances representing the managed properties of a class described by the schema.
39 |
40 | @see `RLMProperty`
41 | */
42 | @property (nonatomic, readonly, copy) NSArray *properties;
43 |
44 | /**
45 | The name of the class the schema describes.
46 | */
47 | @property (nonatomic, readonly) NSString *className;
48 |
49 | /**
50 | The property which serves as the primary key for the class the schema describes, if any.
51 | */
52 | @property (nonatomic, readonly, nullable) RLMProperty *primaryKeyProperty;
53 |
54 | #pragma mark - Methods
55 |
56 | /**
57 | Retrieves an `RLMProperty` object by the property name.
58 |
59 | @param propertyName The property's name.
60 |
61 | @return An `RLMProperty` object, or `nil` if there is no property with the given name.
62 | */
63 | - (nullable RLMProperty *)objectForKeyedSubscript:(NSString *)propertyName;
64 |
65 | /**
66 | Returns whether two `RLMObjectSchema` instances are equal.
67 | */
68 | - (BOOL)isEqualToObjectSchema:(RLMObjectSchema *)objectSchema;
69 |
70 | @end
71 |
72 | NS_ASSUME_NONNULL_END
73 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMObjectSchema_Private.hpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import "RLMObjectSchema_Private.h"
20 |
21 | namespace realm {
22 | class ObjectSchema;
23 | }
24 | @class RLMSchema;
25 |
26 | @interface RLMObjectSchema ()
27 | // create realm::ObjectSchema copy
28 | - (realm::ObjectSchema)objectStoreCopy:(RLMSchema *)schema;
29 |
30 | // initialize with realm::ObjectSchema
31 | + (instancetype)objectSchemaForObjectStoreSchema:(realm::ObjectSchema const&)objectSchema;
32 | @end
33 |
34 | // An objc_ivar pointer which is guaranteed to not point to any actually-existing
35 | // ivar. Used as part of https://github.com/realm/realm-cocoa/issues/5784
36 | extern const Ivar RLMDummySwiftIvar;
37 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMObject_Private.hpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2014 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import "RLMObject_Private.h"
20 |
21 | #import "RLMRealm_Private.hpp"
22 | #import "RLMUtil.hpp"
23 |
24 | #import // required by row.hpp
25 | #import
26 |
27 | class RLMObservationInfo;
28 |
29 | // RLMObject accessor and read/write realm
30 | @interface RLMObjectBase () {
31 | @public
32 | realm::Row _row;
33 | RLMObservationInfo *_observationInfo;
34 | RLMClassInfo *_info;
35 | }
36 | @end
37 |
38 | // FIXME-2.0: This should be folded into initWithRealm:schema:, but changing the
39 | // signature of that is a breaking change for Swift
40 | id RLMCreateManagedAccessor(Class cls, RLMRealm *realm, RLMClassInfo *info) NS_RETURNS_RETAINED;
41 |
42 | // throw an exception if the object is invalidated or on the wrong thread
43 | static inline void RLMVerifyAttached(__unsafe_unretained RLMObjectBase *const obj) {
44 | if (!obj->_row.is_attached()) {
45 | @throw RLMException(@"Object has been deleted or invalidated.");
46 | }
47 | [obj->_realm verifyThread];
48 | }
49 |
50 | // throw an exception if the object can't be modified for any reason
51 | static inline void RLMVerifyInWriteTransaction(__unsafe_unretained RLMObjectBase *const obj) {
52 | // first verify is attached
53 | RLMVerifyAttached(obj);
54 |
55 | if (!obj->_realm.inWriteTransaction) {
56 | @throw RLMException(@"Attempting to modify object outside of a write transaction - call beginWriteTransaction on an RLMRealm instance first.");
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMOptionalBase.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2015 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #import
20 | #import
21 |
22 | NS_ASSUME_NONNULL_BEGIN
23 |
24 | @class RLMObjectBase, RLMProperty;
25 |
26 | @interface RLMOptionalBase : NSProxy
27 | - (instancetype)init;
28 | @end
29 |
30 | FOUNDATION_EXTERN id _Nullable RLMGetOptional(RLMOptionalBase *);
31 | FOUNDATION_EXTERN void RLMSetOptional(RLMOptionalBase *, id _Nullable);
32 |
33 | void RLMInitializeManagedOptional(RLMOptionalBase *, RLMObjectBase *parent, RLMProperty *prop);
34 | void RLMInitializeUnmanagedOptional(RLMOptionalBase *, RLMObjectBase *parent, RLMProperty *prop);
35 |
36 | NS_ASSUME_NONNULL_END
37 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMPlatform.h:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMPredicateUtil.hpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2015 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 |
18 | #import
19 | #import
20 |
21 | using ExpressionVisitor = std::function;
22 | NSPredicate *transformPredicate(NSPredicate *, ExpressionVisitor);
23 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMPrefix.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright 2015 Realm Inc.
4 | //
5 | // Licensed under the Apache License, Version 2.0 (the "License");
6 | // you may not use this file except in compliance with the License.
7 | // You may obtain a copy of the License at
8 | //
9 | // http://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing, software
12 | // distributed under the License is distributed on an "AS IS" BASIS,
13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | // See the License for the specific language governing permissions and
15 | // limitations under the License.
16 | //
17 | ////////////////////////////////////////////////////////////////////////////
18 |
19 | #ifdef __OBJC__
20 | #import
21 | #endif
22 |
23 | #ifdef __cplusplus
24 | #import
25 | #import