├── DatabasePersistencePattern.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── sakaifumiya.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── xcuserdata
│ └── sakaifumiya.xcuserdatad
│ └── xcschemes
│ ├── DatabasePersistencePattern.xcscheme
│ └── xcschememanagement.plist
├── DatabasePersistencePattern.xcworkspace
├── contents.xcworkspacedata
└── xcuserdata
│ └── sakaifumiya.xcuserdatad
│ ├── UserInterfaceState.xcuserstate
│ └── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
├── DatabasePersistencePattern
├── AddController.swift
├── AppDelegate.swift
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── CDOmiyage+CoreDataProperties.swift
├── CDOmiyage.swift
├── CDOmiyageComment+CoreDataProperties.swift
├── CDOmiyageComment.swift
├── CommentAddController.swift
├── CommentCell.swift
├── CommentCell.xib
├── ConvertNSDate.swift
├── DatabasePersistencePattern.xcdatamodeld
│ ├── .xccurrentversion
│ └── DatabasePersistencePattern.xcdatamodel
│ │ └── contents
├── DbDefinition.swift
├── DetailController.swift
├── Info.plist
├── ListCell.swift
├── ListCell.xib
├── Omiyage.swift
├── OmiyageComment.swift
├── SortDedinition.swift
├── ViewController.swift
├── noimage_omiyage.jpg
└── noimage_omiyage_comment.jpg
├── DatabasePersistencePatternTests
├── DatabasePersistencePatternTests.swift
└── Info.plist
├── DatabasePersistencePatternUITests
├── DatabasePersistencePatternUITests.swift
└── Info.plist
├── Podfile
├── Podfile.lock
├── Pods
├── Manifest.lock
├── Pods.xcodeproj
│ ├── project.pbxproj
│ └── xcuserdata
│ │ └── sakaifumiya.xcuserdatad
│ │ └── xcschemes
│ │ ├── Pods-DatabasePersistencePattern.xcscheme
│ │ ├── Realm.xcscheme
│ │ ├── RealmSwift.xcscheme
│ │ └── xcschememanagement.plist
├── Realm
│ ├── LICENSE
│ ├── README.md
│ ├── Realm
│ │ ├── ObjectStore
│ │ │ ├── collection_notifications.cpp
│ │ │ ├── impl
│ │ │ │ ├── apple
│ │ │ │ │ ├── external_commit_helper.cpp
│ │ │ │ │ └── weak_realm_notifier.cpp
│ │ │ │ ├── collection_change_builder.cpp
│ │ │ │ ├── collection_notifier.cpp
│ │ │ │ ├── list_notifier.cpp
│ │ │ │ ├── realm_coordinator.cpp
│ │ │ │ ├── results_notifier.cpp
│ │ │ │ └── transact_log_handler.cpp
│ │ │ ├── index_set.cpp
│ │ │ ├── list.cpp
│ │ │ ├── object_schema.cpp
│ │ │ ├── object_store.cpp
│ │ │ ├── results.cpp
│ │ │ ├── schema.cpp
│ │ │ ├── shared_realm.cpp
│ │ │ └── util
│ │ │ │ └── format.cpp
│ │ ├── RLMAccessor.mm
│ │ ├── RLMAnalytics.mm
│ │ ├── RLMArray.mm
│ │ ├── RLMArrayLinkView.mm
│ │ ├── RLMCollection.mm
│ │ ├── RLMConstants.m
│ │ ├── RLMListBase.mm
│ │ ├── RLMMigration.mm
│ │ ├── RLMObject.mm
│ │ ├── RLMObjectBase.mm
│ │ ├── RLMObjectSchema.mm
│ │ ├── RLMObjectStore.mm
│ │ ├── RLMObservation.mm
│ │ ├── RLMOptionalBase.mm
│ │ ├── RLMPredicateUtil.mm
│ │ ├── RLMProperty.mm
│ │ ├── RLMQueryUtil.mm
│ │ ├── RLMRealm.mm
│ │ ├── RLMRealmConfiguration.mm
│ │ ├── RLMRealmUtil.mm
│ │ ├── RLMResults.mm
│ │ ├── RLMSchema.mm
│ │ ├── RLMSwiftSupport.m
│ │ ├── RLMUpdateChecker.mm
│ │ ├── RLMUtil.mm
│ │ └── module.modulemap
│ ├── build.sh
│ ├── core
│ │ └── librealm-ios.a
│ └── include
│ │ ├── RLMAccessor.h
│ │ ├── RLMAnalytics.hpp
│ │ ├── RLMArray.h
│ │ ├── RLMArray_Private.h
│ │ ├── RLMArray_Private.hpp
│ │ ├── RLMCollection.h
│ │ ├── RLMCollection_Private.hpp
│ │ ├── RLMConstants.h
│ │ ├── RLMListBase.h
│ │ ├── RLMMigration.h
│ │ ├── RLMMigration_Private.h
│ │ ├── RLMObject.h
│ │ ├── RLMObjectBase.h
│ │ ├── RLMObjectBase_Dynamic.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.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
│ │ ├── RLMSchema.h
│ │ ├── RLMSchema_Private.h
│ │ ├── RLMSchema_Private.hpp
│ │ ├── RLMSwiftBridgingHeader.h
│ │ ├── RLMSwiftSupport.h
│ │ ├── RLMUpdateChecker.hpp
│ │ ├── RLMUtil.hpp
│ │ ├── Realm.h
│ │ ├── 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_integer.hpp
│ │ │ ├── array_string.hpp
│ │ │ ├── array_string_long.hpp
│ │ │ ├── binary_data.hpp
│ │ │ ├── bptree.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
│ │ │ ├── commit_log.hpp
│ │ │ ├── data_type.hpp
│ │ │ ├── descriptor.hpp
│ │ │ ├── descriptor_fwd.hpp
│ │ │ ├── disable_sync_to_disk.hpp
│ │ │ ├── exceptions.hpp
│ │ │ ├── group.hpp
│ │ │ ├── group_shared.hpp
│ │ │ ├── group_writer.hpp
│ │ │ ├── handover_defs.hpp
│ │ │ ├── history.hpp
│ │ │ ├── impl
│ │ │ ├── array_writer.hpp
│ │ │ ├── continuous_transactions_history.hpp
│ │ │ ├── destroy_guard.hpp
│ │ │ ├── input_stream.hpp
│ │ │ ├── output_stream.hpp
│ │ │ ├── sequential_getter.hpp
│ │ │ ├── simulated_failure.hpp
│ │ │ └── transact_log.hpp
│ │ │ ├── importer.hpp
│ │ │ ├── index_string.hpp
│ │ │ ├── lang_bind_helper.hpp
│ │ │ ├── link_view.hpp
│ │ │ ├── link_view_fwd.hpp
│ │ │ ├── mixed.hpp
│ │ │ ├── null.hpp
│ │ │ ├── olddatetime.hpp
│ │ │ ├── owned_data.hpp
│ │ │ ├── query.hpp
│ │ │ ├── query_conditions.hpp
│ │ │ ├── query_engine.hpp
│ │ │ ├── query_expression.hpp
│ │ │ ├── realm_nmmintrin.h
│ │ │ ├── replication.hpp
│ │ │ ├── row.hpp
│ │ │ ├── spec.hpp
│ │ │ ├── string_data.hpp
│ │ │ ├── table.hpp
│ │ │ ├── table_accessors.hpp
│ │ │ ├── table_basic.hpp
│ │ │ ├── table_basic_fwd.hpp
│ │ │ ├── table_macros.hpp
│ │ │ ├── table_ref.hpp
│ │ │ ├── table_view.hpp
│ │ │ ├── table_view_basic.hpp
│ │ │ ├── timestamp.hpp
│ │ │ ├── unicode.hpp
│ │ │ ├── util
│ │ │ ├── assert.hpp
│ │ │ ├── basic_system_errors.hpp
│ │ │ ├── bind_ptr.hpp
│ │ │ ├── buffer.hpp
│ │ │ ├── call_with_tuple.hpp
│ │ │ ├── cf_ptr.hpp
│ │ │ ├── config.h
│ │ │ ├── encrypted_file_mapping.hpp
│ │ │ ├── event_loop.hpp
│ │ │ ├── features.h
│ │ │ ├── file.hpp
│ │ │ ├── file_mapper.hpp
│ │ │ ├── hex_dump.hpp
│ │ │ ├── inspect.hpp
│ │ │ ├── interprocess_condvar.hpp
│ │ │ ├── interprocess_mutex.hpp
│ │ │ ├── logger.hpp
│ │ │ ├── memory_stream.hpp
│ │ │ ├── meta.hpp
│ │ │ ├── misc_errors.hpp
│ │ │ ├── miscellaneous.hpp
│ │ │ ├── network.hpp
│ │ │ ├── optional.hpp
│ │ │ ├── priority_queue.hpp
│ │ │ ├── safe_int_ops.hpp
│ │ │ ├── scope_exit.hpp
│ │ │ ├── shared_ptr.hpp
│ │ │ ├── string_buffer.hpp
│ │ │ ├── terminate.hpp
│ │ │ ├── thread.hpp
│ │ │ ├── to_string.hpp
│ │ │ ├── tuple.hpp
│ │ │ ├── type_list.hpp
│ │ │ ├── type_traits.hpp
│ │ │ ├── uri.hpp
│ │ │ └── utf8.hpp
│ │ │ ├── utilities.hpp
│ │ │ ├── version.hpp
│ │ │ └── views.hpp
│ │ ├── impl
│ │ ├── apple
│ │ │ ├── external_commit_helper.hpp
│ │ │ └── weak_realm_notifier.hpp
│ │ ├── collection_change_builder.hpp
│ │ ├── collection_notifier.hpp
│ │ ├── external_commit_helper.hpp
│ │ ├── list_notifier.hpp
│ │ ├── realm_coordinator.hpp
│ │ ├── results_notifier.hpp
│ │ ├── transact_log_handler.hpp
│ │ ├── weak_realm_notifier.hpp
│ │ └── weak_realm_notifier_base.hpp
│ │ ├── index_set.hpp
│ │ ├── list.hpp
│ │ ├── object_schema.hpp
│ │ ├── object_store.hpp
│ │ ├── property.hpp
│ │ ├── results.hpp
│ │ ├── schema.hpp
│ │ ├── shared_realm.hpp
│ │ └── util
│ │ ├── atomic_shared_ptr.hpp
│ │ └── format.hpp
├── RealmSwift
│ ├── LICENSE
│ ├── README.md
│ ├── RealmSwift
│ │ ├── Aliases.swift
│ │ ├── Error.swift
│ │ ├── LinkingObjects.swift
│ │ ├── List.swift
│ │ ├── Migration.swift
│ │ ├── Object.swift
│ │ ├── ObjectSchema.swift
│ │ ├── Optional.swift
│ │ ├── Property.swift
│ │ ├── Realm.swift
│ │ ├── RealmCollectionType.swift
│ │ ├── RealmConfiguration.swift
│ │ ├── Results.swift
│ │ ├── Schema.swift
│ │ ├── SortDescriptor.swift
│ │ ├── SwiftVersion.swift
│ │ └── Util.swift
│ └── build.sh
└── Target Support Files
│ ├── Pods-DatabasePersistencePattern
│ ├── Info.plist
│ ├── Pods-DatabasePersistencePattern-acknowledgements.markdown
│ ├── Pods-DatabasePersistencePattern-acknowledgements.plist
│ ├── Pods-DatabasePersistencePattern-dummy.m
│ ├── Pods-DatabasePersistencePattern-frameworks.sh
│ ├── Pods-DatabasePersistencePattern-resources.sh
│ ├── Pods-DatabasePersistencePattern-umbrella.h
│ ├── Pods-DatabasePersistencePattern.debug.xcconfig
│ ├── Pods-DatabasePersistencePattern.modulemap
│ └── Pods-DatabasePersistencePattern.release.xcconfig
│ ├── Realm
│ ├── Info.plist
│ ├── Realm-dummy.m
│ ├── Realm-prefix.pch
│ ├── Realm.modulemap
│ └── Realm.xcconfig
│ └── RealmSwift
│ ├── Info.plist
│ ├── RealmSwift-dummy.m
│ ├── RealmSwift-prefix.pch
│ ├── RealmSwift-umbrella.h
│ ├── RealmSwift.modulemap
│ └── RealmSwift.xcconfig
└── README.md
/DatabasePersistencePattern.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern.xcodeproj/project.xcworkspace/xcuserdata/sakaifumiya.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fumiyasac/DatabasePersistencePattern/9cac78996b89e0b81b635dec616c0aa9a0e36cbf/DatabasePersistencePattern.xcodeproj/project.xcworkspace/xcuserdata/sakaifumiya.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/DatabasePersistencePattern.xcodeproj/xcuserdata/sakaifumiya.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | DatabasePersistencePattern.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | DE5098C71C2A596100BB94A1
16 |
17 | primary
18 |
19 |
20 | DE5098DE1C2A596200BB94A1
21 |
22 | primary
23 |
24 |
25 | DE5098E91C2A596200BB94A1
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern.xcworkspace/xcuserdata/sakaifumiya.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fumiyasac/DatabasePersistencePattern/9cac78996b89e0b81b635dec616c0aa9a0e36cbf/DatabasePersistencePattern.xcworkspace/xcuserdata/sakaifumiya.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/DatabasePersistencePattern.xcworkspace/xcuserdata/sakaifumiya.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/DatabasePersistencePattern/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 |
27 |
28 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/CDOmiyage+CoreDataProperties.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CDOmiyage+CoreDataProperties.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/05.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 | // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu
9 | // to delete and recreate this implementation file for your updated model.
10 | //
11 |
12 | import Foundation
13 | import CoreData
14 |
15 | extension CDOmiyage {
16 |
17 | @NSManaged var cd_average: NSNumber?
18 | @NSManaged var cd_createDate: NSDate?
19 | @NSManaged var cd_detail: String?
20 | @NSManaged var cd_id: NSNumber?
21 | @NSManaged var cd_imageData: NSData?
22 | @NSManaged var cd_title: String?
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/CDOmiyage.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CDOmiyage.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/05.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CoreData
11 |
12 | class CDOmiyage: NSManagedObject {
13 |
14 | // Insert code here to add functionality to your managed object subclass
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/CDOmiyageComment+CoreDataProperties.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CDOmiyageComment+CoreDataProperties.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/05.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 | // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu
9 | // to delete and recreate this implementation file for your updated model.
10 | //
11 |
12 | import Foundation
13 | import CoreData
14 |
15 | extension CDOmiyageComment {
16 |
17 | @NSManaged var cd_comment_comment: String?
18 | @NSManaged var cd_comment_id: NSNumber?
19 | @NSManaged var cd_comment_imageData: NSData?
20 | @NSManaged var cd_comment_star: NSNumber?
21 | @NSManaged var cd_id: NSNumber?
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/CDOmiyageComment.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CDOmiyageComment.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/05.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CoreData
11 |
12 | class CDOmiyageComment: NSManagedObject {
13 |
14 | // Insert code here to add functionality to your managed object subclass
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/CommentCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CommentCell.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/04.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class CommentCell: UITableViewCell {
12 |
13 | //Outlet
14 | @IBOutlet weak var commentImage: UIImageView!
15 | @IBOutlet weak var commentStar: UILabel!
16 | @IBOutlet weak var commentPoint: UILabel!
17 | @IBOutlet weak var commentText: UILabel!
18 |
19 | override func awakeFromNib() {
20 | super.awakeFromNib()
21 | // Initialization code
22 | }
23 |
24 | override func setSelected(selected: Bool, animated: Bool) {
25 | super.setSelected(selected, animated: animated)
26 |
27 | // Configure the view for the selected state
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/ConvertNSDate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ConvertNSDate.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/05.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | //日付をNSDateからStringの変換用のstruct
12 | struct ConvertNSDate {
13 |
14 | //NSDate → Stringへの変換
15 | static func convertNSDateToString (date: NSDate) -> String {
16 |
17 | let dateFormatter: NSDateFormatter = NSDateFormatter()
18 | dateFormatter.locale = NSLocale(localeIdentifier: "ja_JP")
19 | dateFormatter.dateFormat = "yyyy.MM.dd"
20 | let dateString: String = dateFormatter.stringFromDate(date)
21 | return dateString
22 | }
23 | }
--------------------------------------------------------------------------------
/DatabasePersistencePattern/DatabasePersistencePattern.xcdatamodeld/.xccurrentversion:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | _XCCurrentVersionName
6 | DatabasePersistencePattern.xcdatamodel
7 |
8 |
9 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/DatabasePersistencePattern.xcdatamodeld/DatabasePersistencePattern.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/DbDefinition.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DbDefinition.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/05.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 |
9 | //格納用DBの選択enum
10 | enum DbDefinition: Int {
11 |
12 | //セグメント番号の名称
13 | case RealmUse, CoreDataUse
14 |
15 | //enumの値を返す
16 | func returnValue() -> Int {
17 | return self.rawValue
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
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 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/ListCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ListCell.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/04.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ListCell: UITableViewCell {
12 |
13 | //Outlet
14 | @IBOutlet weak var listDate: UILabel!
15 | @IBOutlet weak var listAverage: UILabel!
16 | @IBOutlet weak var listImage: UIImageView!
17 | @IBOutlet weak var listTitle: UILabel!
18 | @IBOutlet weak var listComments: UILabel!
19 |
20 | override func awakeFromNib() {
21 | super.awakeFromNib()
22 | // Initialization code
23 | }
24 |
25 | override func setSelected(selected: Bool, animated: Bool) {
26 | super.setSelected(selected, animated: animated)
27 |
28 | // Configure the view for the selected state
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/OmiyageComment.swift:
--------------------------------------------------------------------------------
1 | //
2 | // OmiyageComment.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/05.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | //Realmクラスのインポート
12 | import RealmSwift
13 |
14 | class OmiyageComment: Object {
15 |
16 | //Realmクラスのインスタンス
17 | static let realm = try! Realm()
18 |
19 | //id
20 | dynamic var id = 0
21 |
22 | //おみやげid
23 | dynamic var omiyage_id = 0
24 |
25 | //コメント
26 | dynamic var comment = ""
27 |
28 | //評価
29 | dynamic var star = 0
30 |
31 | //その時の写真
32 | /**
33 | * 下記記事で紹介されている実装を元に作成
34 | *
35 | * JFYI:(Qiita) Realm × Swift2 でシームレスに画像を保存する
36 | * http://qiita.com/_ha1f/items/593ca4f9c97ae697fc75
37 | *
38 | */
39 | //
40 | dynamic private var _image: UIImage? = nil
41 |
42 | dynamic var image: UIImage? {
43 |
44 | //画像のセッター
45 | set {
46 | self._image = newValue
47 | if let value = newValue {
48 | self.imageData = UIImagePNGRepresentation(value)
49 | }
50 | }
51 |
52 | //画像のゲッター
53 | get {
54 | if let image = self._image {
55 | return image
56 | }
57 | if let data = self.imageData {
58 | self._image = UIImage(data: data)
59 | return self._image
60 | }
61 | return nil
62 | }
63 | }
64 |
65 | dynamic private var imageData: NSData? = nil
66 |
67 | //PrimaryKeyの設定
68 | override static func primaryKey() -> String? {
69 | return "id"
70 | }
71 |
72 | //保存しないプロパティの一覧
73 | override static func ignoredProperties() -> [String] {
74 | return ["image", "_image"]
75 | }
76 |
77 | //新規追加用のインスタンス生成メソッド
78 | static func create() -> OmiyageComment {
79 | let omiyageComment = OmiyageComment()
80 | omiyageComment.id = self.getLastId()
81 | return omiyageComment
82 | }
83 |
84 | //プライマリキーの作成メソッド
85 | static func getLastId() -> Int {
86 | if let omiyageComment = realm.objects(OmiyageComment).last {
87 | return omiyageComment.id + 1
88 | } else {
89 | return 1
90 | }
91 | }
92 |
93 | //インスタンス保存用メソッド
94 | func save() {
95 | try! OmiyageComment.realm.write {
96 | OmiyageComment.realm.add(self)
97 | }
98 | }
99 |
100 | //平均値を取得
101 | static func getAverage(target_id: Int) -> Double {
102 |
103 | if let average: Double = realm.objects(OmiyageComment).filter("omiyage_id = %@", target_id).average("star") {
104 | return average
105 | } else {
106 | return 0.0
107 | }
108 | }
109 |
110 | //インスタンス削除用メソッド
111 | func delete() {
112 | try! OmiyageComment.realm.write {
113 | OmiyageComment.realm.delete(self)
114 | }
115 | }
116 |
117 | //ソートをかけた順のデータの全件取得をする
118 | static func fetchAllOmiyageList(target_id: Int) -> [OmiyageComment] {
119 |
120 | var omiyageComments: Results
121 | omiyageComments = realm.objects(OmiyageComment).filter("omiyage_id = %@", target_id).sorted("id", ascending: true)
122 |
123 | var omiyageCommentList: [OmiyageComment] = []
124 | for omiyageComment in omiyageComments {
125 | omiyageCommentList.append(omiyageComment)
126 | }
127 | return omiyageCommentList
128 | }
129 |
130 | }
131 |
132 |
133 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/SortDedinition.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SortDedinition.swift
3 | // DatabasePersistencePattern
4 | //
5 | // Created by 酒井文也 on 2016/01/05.
6 | // Copyright © 2016年 just1factory. All rights reserved.
7 | //
8 |
9 | //ソートの選択enum
10 | enum SortDefinition: Int {
11 |
12 | //セグメント番号の名称
13 | case SortScore, SortId
14 |
15 | //enumの値を返す
16 | func returnValue() -> Int {
17 | return self.rawValue
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/DatabasePersistencePattern/noimage_omiyage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fumiyasac/DatabasePersistencePattern/9cac78996b89e0b81b635dec616c0aa9a0e36cbf/DatabasePersistencePattern/noimage_omiyage.jpg
--------------------------------------------------------------------------------
/DatabasePersistencePattern/noimage_omiyage_comment.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fumiyasac/DatabasePersistencePattern/9cac78996b89e0b81b635dec616c0aa9a0e36cbf/DatabasePersistencePattern/noimage_omiyage_comment.jpg
--------------------------------------------------------------------------------
/DatabasePersistencePatternTests/DatabasePersistencePatternTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DatabasePersistencePatternTests.swift
3 | // DatabasePersistencePatternTests
4 | //
5 | // Created by 酒井文也 on 2015/12/23.
6 | // Copyright © 2015年 just1factory. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import DatabasePersistencePattern
11 |
12 | class DatabasePersistencePatternTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | // Use XCTAssert and related functions to verify your tests produce the correct results.
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measureBlock {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/DatabasePersistencePatternTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/DatabasePersistencePatternUITests/DatabasePersistencePatternUITests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DatabasePersistencePatternUITests.swift
3 | // DatabasePersistencePatternUITests
4 | //
5 | // Created by 酒井文也 on 2015/12/23.
6 | // Copyright © 2015年 just1factory. All rights reserved.
7 | //
8 |
9 | import XCTest
10 |
11 | class DatabasePersistencePatternUITests: XCTestCase {
12 |
13 | override func setUp() {
14 | super.setUp()
15 |
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 |
18 | // In UI tests it is usually best to stop immediately when a failure occurs.
19 | continueAfterFailure = false
20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
21 | XCUIApplication().launch()
22 |
23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
24 | }
25 |
26 | override func tearDown() {
27 | // Put teardown code here. This method is called after the invocation of each test method in the class.
28 | super.tearDown()
29 | }
30 |
31 | func testExample() {
32 | // Use recording to get started writing UI tests.
33 | // Use XCTAssert and related functions to verify your tests produce the correct results.
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/DatabasePersistencePatternUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 | target 'DatabasePersistencePattern' do
3 | pod 'RealmSwift'
4 | end
5 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Realm (1.0.2):
3 | - Realm/Headers (= 1.0.2)
4 | - Realm/Headers (1.0.2)
5 | - RealmSwift (1.0.2):
6 | - Realm (= 1.0.2)
7 |
8 | DEPENDENCIES:
9 | - RealmSwift
10 |
11 | SPEC CHECKSUMS:
12 | Realm: 9d5c46a4d7d27958530a8dfc58f63a99e5c2cba3
13 | RealmSwift: 82f3ac5e24530143dddfde2033acc0d308f27d96
14 |
15 | PODFILE CHECKSUM: 560c5262b82959a1531457b166fc8a43031eefec
16 |
17 | COCOAPODS: 1.0.1
18 |
--------------------------------------------------------------------------------
/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Realm (1.0.2):
3 | - Realm/Headers (= 1.0.2)
4 | - Realm/Headers (1.0.2)
5 | - RealmSwift (1.0.2):
6 | - Realm (= 1.0.2)
7 |
8 | DEPENDENCIES:
9 | - RealmSwift
10 |
11 | SPEC CHECKSUMS:
12 | Realm: 9d5c46a4d7d27958530a8dfc58f63a99e5c2cba3
13 | RealmSwift: 82f3ac5e24530143dddfde2033acc0d308f27d96
14 |
15 | PODFILE CHECKSUM: 560c5262b82959a1531457b166fc8a43031eefec
16 |
17 | COCOAPODS: 1.0.1
18 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/sakaifumiya.xcuserdatad/xcschemes/Pods-DatabasePersistencePattern.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
66 |
67 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/sakaifumiya.xcuserdatad/xcschemes/Realm.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/sakaifumiya.xcuserdatad/xcschemes/RealmSwift.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/sakaifumiya.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Pods-DatabasePersistencePattern.xcscheme
8 |
9 | isShown
10 |
11 |
12 | Realm.xcscheme
13 |
14 | isShown
15 |
16 |
17 | RealmSwift.xcscheme
18 |
19 | isShown
20 |
21 |
22 |
23 | SuppressBuildableAutocreation
24 |
25 | 36B5F025B7DA2B6128779B97EDC667A5
26 |
27 | primary
28 |
29 |
30 | AE94E5EB1EEA064C3E8F989C1F7FBC37
31 |
32 | primary
33 |
34 |
35 | B1130B0BDC28121AB57F3E9E7A43CEBA
36 |
37 | primary
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/ObjectStore/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, size_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 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/ObjectStore/impl/apple/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 |
23 | #include
24 |
25 | using namespace realm;
26 | using namespace realm::_impl;
27 |
28 | WeakRealmNotifier::WeakRealmNotifier(const std::shared_ptr& realm, bool cache)
29 | : WeakRealmNotifierBase(realm, cache)
30 | {
31 | struct RefCountedWeakPointer {
32 | std::weak_ptr realm;
33 | std::atomic ref_count;
34 | };
35 |
36 | CFRunLoopSourceContext ctx{};
37 | ctx.info = new RefCountedWeakPointer{realm, {0}};
38 | ctx.perform = [](void* info) {
39 | if (auto realm = static_cast(info)->realm.lock()) {
40 | realm->notify();
41 | }
42 | };
43 | ctx.retain = [](const void* info) {
44 | static_cast(const_cast(info))->ref_count.fetch_add(1, std::memory_order_relaxed);
45 | return info;
46 | };
47 | ctx.release = [](const void* info) {
48 | auto ptr = static_cast(const_cast(info));
49 | if (ptr->ref_count.fetch_add(-1, std::memory_order_acq_rel) == 1) {
50 | delete ptr;
51 | }
52 | };
53 |
54 | m_runloop = CFRunLoopGetCurrent();
55 | CFRetain(m_runloop);
56 | m_signal = CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &ctx);
57 | CFRunLoopAddSource(m_runloop, m_signal, kCFRunLoopDefaultMode);
58 | }
59 |
60 | WeakRealmNotifier::WeakRealmNotifier(WeakRealmNotifier&& rgt)
61 | : WeakRealmNotifierBase(std::move(rgt))
62 | , m_runloop(rgt.m_runloop)
63 | , m_signal(rgt.m_signal)
64 | {
65 | rgt.m_runloop = nullptr;
66 | rgt.m_signal = nullptr;
67 | }
68 |
69 | WeakRealmNotifier& WeakRealmNotifier::operator=(WeakRealmNotifier&& rgt)
70 | {
71 | WeakRealmNotifierBase::operator=(std::move(rgt));
72 |
73 | invalidate();
74 | m_runloop = rgt.m_runloop;
75 | m_signal = rgt.m_signal;
76 | rgt.m_runloop = nullptr;
77 | rgt.m_signal = nullptr;
78 |
79 | return *this;
80 | }
81 |
82 | WeakRealmNotifier::~WeakRealmNotifier()
83 | {
84 | invalidate();
85 | }
86 |
87 | void WeakRealmNotifier::invalidate()
88 | {
89 | if (m_signal) {
90 | CFRunLoopSourceInvalidate(m_signal);
91 | CFRelease(m_signal);
92 | CFRelease(m_runloop);
93 | }
94 | }
95 |
96 | void WeakRealmNotifier::notify()
97 | {
98 | CFRunLoopSourceSignal(m_signal);
99 | // Signalling the source makes it run the next time the runloop gets
100 | // to it, but doesn't make the runloop start if it's currently idle
101 | // waiting for events
102 | CFRunLoopWakeUp(m_runloop);
103 | }
104 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/ObjectStore/util/format.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 "util/format.hpp"
20 |
21 | #include
22 |
23 | #include
24 | #include
25 |
26 | namespace realm { namespace _impl {
27 | Printable::Printable(StringData value) : m_type(Type::String), m_string(value.data()) { }
28 |
29 | void Printable::print(std::ostream& out) const
30 | {
31 | switch (m_type) {
32 | case Printable::Type::Bool:
33 | out << (m_uint ? "true" : "false");
34 | break;
35 | case Printable::Type::Uint:
36 | out << m_uint;
37 | break;
38 | case Printable::Type::Int:
39 | out << m_int;
40 | break;
41 | case Printable::Type::String:
42 | out << m_string;
43 | break;
44 | }
45 | }
46 |
47 | std::string format(const char* fmt, std::initializer_list values)
48 | {
49 | std::stringstream ss;
50 | while (*fmt) {
51 | auto next = strchr(fmt, '%');
52 |
53 | // emit the rest of the format string if there are no more percents
54 | if (!next) {
55 | ss << fmt;
56 | break;
57 | }
58 |
59 | // emit everything up to the next percent
60 | ss.write(fmt, next - fmt);
61 | ++next;
62 | REALM_ASSERT(*next);
63 |
64 | // %% produces a single escaped %
65 | if (*next == '%') {
66 | ss << '%';
67 | fmt = next + 1;
68 | continue;
69 | }
70 | REALM_ASSERT(isdigit(*next));
71 |
72 | // The const_cast is safe because stroul does not actually modify
73 | // the pointed-to string, but it lacks a const overload
74 | auto index = strtoul(next, const_cast(&fmt), 10) - 1;
75 | REALM_ASSERT(index < values.size());
76 | (values.begin() + index)->print(ss);
77 | }
78 | return ss.str();
79 | }
80 |
81 | } // namespace _impl
82 | } // namespace realm
83 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained [])buffer count:(NSUInteger)len {
45 | return [__rlmArray countByEnumeratingWithState:state objects:buffer count:len];
46 | }
47 |
48 | - (NSArray *)objectsAtIndexes:(NSIndexSet *)indexes {
49 | return [__rlmArray objectsAtIndexes:indexes];
50 | }
51 |
52 | - (void)addObserver:(id)observer
53 | forKeyPath:(NSString *)keyPath
54 | options:(NSKeyValueObservingOptions)options
55 | context:(void *)context {
56 | RLMEnsureArrayObservationInfo(_observationInfo, keyPath, __rlmArray, self);
57 | [super addObserver:observer forKeyPath:keyPath options:options context:context];
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/RLMOptionalBase.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 "RLMAccessor.h"
20 | #import "RLMOptionalBase.h"
21 | #import "RLMObject_Private.h"
22 | #import "RLMObjectStore.h"
23 | #import "RLMProperty.h"
24 | #import "RLMUtil.hpp"
25 |
26 | #import
27 |
28 | @interface RLMOptionalBase ()
29 | @property (nonatomic) id unmanagedValue;
30 | @end
31 |
32 | @implementation RLMOptionalBase
33 |
34 | - (instancetype)init {
35 | return self;
36 | }
37 |
38 | - (id)underlyingValue {
39 | if ((_object && _object->_realm) || _object.isInvalidated) {
40 | return RLMDynamicGet(_object, _property);
41 | }
42 | else {
43 | return _unmanagedValue;
44 | }
45 | }
46 |
47 | - (void)setUnderlyingValue:(id)underlyingValue {
48 | if ((_object && _object->_realm) || _object.isInvalidated) {
49 | RLMDynamicSet(_object, _property, underlyingValue, RLMCreationOptionsNone);
50 | }
51 | else {
52 | NSString *propertyName = _property.name;
53 | [_object willChangeValueForKey:propertyName];
54 | _unmanagedValue = underlyingValue;
55 | [_object didChangeValueForKey:propertyName];
56 | }
57 | }
58 |
59 | - (BOOL)isKindOfClass:(Class)aClass {
60 | return [self.underlyingValue isKindOfClass:aClass] || RLMIsKindOfClass(object_getClass(self), aClass);
61 | }
62 |
63 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel {
64 | return [self.underlyingValue methodSignatureForSelector:sel];
65 | }
66 |
67 | - (void)forwardInvocation:(NSInvocation *)invocation {
68 | [invocation invokeWithTarget:self.underlyingValue];
69 | }
70 |
71 | - (id)forwardingTargetForSelector:(__unused SEL)sel {
72 | return self.underlyingValue;
73 | }
74 |
75 | - (BOOL)respondsToSelector:(SEL)aSelector {
76 | if (id val = self.underlyingValue) {
77 | return [val respondsToSelector:aSelector];
78 | }
79 | return NO;
80 | }
81 |
82 | - (void)doesNotRecognizeSelector:(SEL)aSelector {
83 | [self.underlyingValue doesNotRecognizeSelector:aSelector];
84 | }
85 |
86 | @end
87 |
--------------------------------------------------------------------------------
/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/RLMUpdateChecker.mm:
--------------------------------------------------------------------------------
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 "RLMUpdateChecker.hpp"
20 |
21 | #import "RLMRealm.h"
22 | #import "RLMUtil.hpp"
23 |
24 | #if TARGET_IPHONE_SIMULATOR && !defined(REALM_COCOA_VERSION)
25 | #import "RLMVersion.h"
26 | #endif
27 |
28 | void RLMCheckForUpdates() {
29 | #if TARGET_IPHONE_SIMULATOR
30 | if (getenv("REALM_DISABLE_UPDATE_CHECKER") || RLMIsRunningInPlayground()) {
31 | return;
32 | }
33 |
34 | auto handler = ^(NSData *data, NSURLResponse *response, NSError *error) {
35 | if (error || ((NSHTTPURLResponse *)response).statusCode != 200) {
36 | return;
37 | }
38 |
39 | NSString *latestVersion = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
40 | if (![REALM_COCOA_VERSION isEqualToString:latestVersion]) {
41 | NSLog(@"Version %@ of Realm is now available: https://github.com/realm/realm-cocoa/blob/v%@/CHANGELOG.md", latestVersion, latestVersion);
42 | }
43 | };
44 |
45 | NSString *url = [NSString stringWithFormat:@"https://static.realm.io/update/cocoa?%@", REALM_COCOA_VERSION];
46 | [[NSURLSession.sharedSession dataTaskWithURL:[NSURL URLWithString:url] completionHandler:handler] resume];
47 | #endif
48 | }
49 |
--------------------------------------------------------------------------------
/Pods/Realm/Realm/module.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 "RLMListBase.h"
11 | header "RLMMigration_Private.h"
12 | header "RLMObjectSchema_Private.h"
13 | header "RLMObjectStore.h"
14 | header "RLMObject_Private.h"
15 | header "RLMOptionalBase.h"
16 | header "RLMProperty_Private.h"
17 | header "RLMRealmConfiguration_Private.h"
18 | header "RLMRealm_Private.h"
19 | header "RLMResults_Private.h"
20 | header "RLMSchema_Private.h"
21 | }
22 |
23 | explicit module Dynamic {
24 | header "RLMRealm_Dynamic.h"
25 | header "RLMObjectBase_Dynamic.h"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Pods/Realm/core/librealm-ios.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fumiyasac/DatabasePersistencePattern/9cac78996b89e0b81b635dec616c0aa9a0e36cbf/Pods/Realm/core/librealm-ios.a
--------------------------------------------------------------------------------
/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 |
22 | @class RLMObjectSchema, RLMProperty, RLMObjectBase, RLMProperty;
23 |
24 | #ifdef __cplusplus
25 | typedef NSUInteger RLMCreationOptions;
26 | #else
27 | typedef NS_OPTIONS(NSUInteger, RLMCreationOptions);
28 | #endif
29 |
30 | NS_ASSUME_NONNULL_BEGIN
31 |
32 | //
33 | // Accessors Class Creation/Caching
34 | //
35 |
36 | // get accessor classes for an object class - generates classes if not cached
37 | Class RLMAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema, NSString *prefix);
38 | Class RLMUnmanagedAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema);
39 |
40 | // Check if a given class is a generated accessor class
41 | bool RLMIsGeneratedClass(Class cls);
42 |
43 | //
44 | // Dynamic getters/setters
45 | //
46 | FOUNDATION_EXTERN void RLMDynamicValidatedSet(RLMObjectBase *obj, NSString *propName, id __nullable val);
47 | FOUNDATION_EXTERN RLMProperty *RLMValidatedGetProperty(RLMObjectBase *obj, NSString *propName);
48 | FOUNDATION_EXTERN id __nullable RLMDynamicGet(RLMObjectBase *obj, RLMProperty *prop);
49 |
50 | // by property/column
51 | FOUNDATION_EXTERN void RLMDynamicSet(RLMObjectBase *obj, RLMProperty *prop, id val, RLMCreationOptions options);
52 |
53 | //
54 | // Class modification
55 | //
56 |
57 | // Replace className method for the given class
58 | void RLMReplaceClassNameMethod(Class accessorClass, NSString *className);
59 |
60 | // Replace sharedSchema method for the given class
61 | void RLMReplaceSharedSchemaMethod(Class accessorClass, RLMObjectSchema * __nullable schema);
62 |
63 | NS_ASSUME_NONNULL_END
64 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMAnalytics.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 |
19 | // Asynchronously submits build information to Realm if running in an iOS
20 | // simulator or on OS X if a debugger is attached. Does nothing if running on an
21 | // iOS / watchOS device or if a debugger is *not* attached.
22 | //
23 | // To be clear: this does *not* run when your app is in production or on
24 | // your end-user’s devices; it will only run in the simulator or when a debugger
25 | // is attached.
26 | //
27 | // Why are we doing this? In short, because it helps us build a better product
28 | // for you. None of the data personally identifies you, your employer or your
29 | // app, but it *will* help us understand what language you use, what iOS
30 | // versions you target, etc. Having this info will help prioritizing our time,
31 | // adding new features and deprecating old features. Collecting an anonymized
32 | // bundle & anonymized MAC is the only way for us to count actual usage of the
33 | // other metrics accurately. If we don’t have a way to deduplicate the info
34 | // reported, it will be useless, as a single developer building their Swift app
35 | // 10 times would report 10 times more than a single Objective-C developer that
36 | // only builds once, making the data all but useless.
37 | // No one likes sharing data unless it’s necessary, we get it, and we’ve
38 | // debated adding this for a long long time. Since Realm is a free product
39 | // without an email signup, we feel this is a necessary step so we can collect
40 | // relevant data to build a better product for you. If you truly, absolutely
41 | // feel compelled to not send this data back to Realm, then you can set an env
42 | // variable named REALM_DISABLE_ANALYTICS. Since Realm is free we believe
43 | // letting these analytics run is a small price to pay for the product & support
44 | // we give you.
45 | //
46 | // Currently the following information is reported:
47 | // - What version of Realm is being used, and from which language (obj-c or Swift).
48 | // - What version of OS X it's running on (in case Xcode aggressively drops
49 | // support for older versions again, we need to know what we need to support).
50 | // - The minimum iOS/OS X version that the application is targeting (again, to
51 | // help us decide what versions we need to support).
52 | // - An anonymous MAC address and bundle ID to aggregate the other information on.
53 | // - What version of Swift is being used (if applicable).
54 |
55 | void RLMSendAnalytics();
56 |
--------------------------------------------------------------------------------
/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 |
21 | @interface RLMArray ()
22 | - (instancetype)initWithObjectClassName:(NSString *)objectClassName;
23 | - (NSString *)descriptionWithMaxDepth:(NSUInteger)depth;
24 | @end
25 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMArray_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 "RLMArray_Private.h"
20 |
21 | #import "RLMCollection_Private.hpp"
22 |
23 | #import
24 |
25 | #import
26 | #import
27 |
28 | namespace realm {
29 | class LinkView;
30 | class Results;
31 | class TableView;
32 | struct SortOrder;
33 | }
34 |
35 | @class RLMObjectBase;
36 | @class RLMObjectSchema;
37 | class RLMObservationInfo;
38 |
39 | @interface RLMArray () {
40 | @protected
41 | NSString *_objectClassName;
42 | @public
43 | // The name of the property which this RLMArray represents
44 | NSString *_key;
45 | __weak RLMObjectBase *_parentObject;
46 | }
47 | @end
48 |
49 | //
50 | // LinkView backed RLMArray subclass
51 | //
52 | @interface RLMArrayLinkView : RLMArray
53 | @property (nonatomic, unsafe_unretained) RLMObjectSchema *objectSchema;
54 |
55 | + (RLMArrayLinkView *)arrayWithObjectClassName:(NSString *)objectClassName
56 | view:(realm::LinkViewRef)view
57 | realm:(RLMRealm *)realm
58 | key:(NSString *)key
59 | parentSchema:(RLMObjectSchema *)parentSchema;
60 |
61 | // deletes all objects in the RLMArray from their containing realms
62 | - (void)deleteObjectsFromRealm;
63 | @end
64 |
65 | void RLMValidateArrayObservationKey(NSString *keyPath, RLMArray *array);
66 |
67 | // Initialize the observation info for an array if needed
68 | void RLMEnsureArrayObservationInfo(std::unique_ptr& info,
69 | NSString *keyPath, RLMArray *array, id observed);
70 |
71 |
72 | //
73 | // RLMResults private methods
74 | //
75 | @interface RLMResults ()
76 | + (instancetype)resultsWithObjectSchema:(RLMObjectSchema *)objectSchema
77 | results:(realm::Results)results;
78 |
79 | - (void)deleteObjectsFromRealm;
80 | @end
81 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMCollection_Private.hpp:
--------------------------------------------------------------------------------
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 | namespace realm {
24 | class List;
25 | class Results;
26 | class TableView;
27 | struct CollectionChangeSet;
28 | struct NotificationToken;
29 | }
30 | @class RLMObjectSchema;
31 |
32 | @protocol RLMFastEnumerable
33 | @property (nonatomic, readonly) RLMRealm *realm;
34 | @property (nonatomic, readonly) RLMObjectSchema *objectSchema;
35 | @property (nonatomic, readonly) NSUInteger count;
36 |
37 | - (NSUInteger)indexInSource:(NSUInteger)index;
38 | - (realm::TableView)tableView;
39 | @end
40 |
41 | // An object which encapulates the shared logic for fast-enumerating RLMArray
42 | // and RLMResults, and has a buffer to store strong references to the current
43 | // set of enumerated items
44 | @interface RLMFastEnumerator : NSObject
45 | - (instancetype)initWithCollection:(id)collection
46 | objectSchema:(RLMObjectSchema *)objectSchema;
47 |
48 | // Detach this enumerator from the source collection. Must be called before the
49 | // source collection is changed.
50 | - (void)detach;
51 |
52 | - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
53 | count:(NSUInteger)len;
54 | @end
55 |
56 | @interface RLMCancellationToken : RLMNotificationToken
57 | - (instancetype)initWithToken:(realm::NotificationToken)token;
58 | @end
59 |
60 | @interface RLMCollectionChange ()
61 | - (instancetype)initWithChanges:(realm::CollectionChangeSet)indices;
62 | @end
63 |
64 | template
65 | RLMNotificationToken *RLMAddNotificationBlock(id objcCollection,
66 | Collection& collection,
67 | void (^block)(id, RLMCollectionChange *, NSError *),
68 | bool suppressInitialChange=false);
69 |
70 | NSArray *RLMCollectionValueForKey(id collection, NSString *key);
71 | void RLMCollectionSetValueForKey(id collection, NSString *key, id value);
72 | NSString *RLMDescriptionWithMaxDepth(NSString *name, id collection, NSUInteger depth);
73 |
--------------------------------------------------------------------------------
/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 | // A base class for Swift generic Lists to make it possible to interact with
24 | // them from obj-c
25 | @interface RLMListBase : NSObject
26 | @property (nonatomic, strong) RLMArray *_rlmArray;
27 |
28 | - (instancetype)initWithArray:(RLMArray *)array;
29 | @end
30 |
--------------------------------------------------------------------------------
/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 | typedef void (^RLMObjectBaseMigrationBlock)(RLMObjectBase *oldObject, RLMObjectBase *newObject);
24 |
25 | @interface RLMMigration ()
26 |
27 | @property (nonatomic, strong) RLMRealm *oldRealm;
28 | @property (nonatomic, strong) RLMRealm *realm;
29 |
30 | - (instancetype)initWithRealm:(RLMRealm *)realm oldRealm:(RLMRealm *)oldRealm;
31 |
32 | - (void)execute:(RLMMigrationBlock)block;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/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 | @end
40 |
41 | NS_ASSUME_NONNULL_END
42 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMObjectBase_Dynamic.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, RLMRealm;
22 |
23 | /**
24 | Returns the Realm that manages the object, if one exists.
25 |
26 | @warning This function is useful only in specialized circumstances, for example, when building components
27 | that integrate with Realm. If you are simply building an app on Realm, it is
28 | recommended to retrieve the Realm that manages the object via `RLMObject`.
29 |
30 | @param object An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
31 |
32 | @return The Realm which manages this object. Returns `nil `for unmanaged objects.
33 | */
34 | FOUNDATION_EXTERN RLMRealm *RLMObjectBaseRealm(RLMObjectBase *object);
35 |
36 | /**
37 | Returns an `RLMObjectSchema` which describes the managed properties of the object.
38 |
39 | @warning This function is useful only in specialized circumstances, for example, when building components
40 | that integrate with Realm. If you are simply building an app on Realm, it is
41 | recommended to retrieve `objectSchema` via `RLMObject`.
42 |
43 | @param object An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
44 |
45 | @return The object schema which lists the managed properties for the object.
46 | */
47 | FOUNDATION_EXTERN RLMObjectSchema *RLMObjectBaseObjectSchema(RLMObjectBase *object);
48 |
49 | /**
50 | Returns the object corresponding to a key value.
51 |
52 | @warning This function is useful only in specialized circumstances, for example, when building components
53 | that integrate with Realm. If you are simply building an app on Realm, it is
54 | recommended to retrieve key values via `RLMObject`.
55 |
56 | @warning Will throw an `NSUndefinedKeyException` if `key` is not present on the object.
57 |
58 | @param object An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
59 | @param key The name of the property.
60 |
61 | @return The object for the property requested.
62 | */
63 | FOUNDATION_EXTERN id RLMObjectBaseObjectForKeyedSubscript(RLMObjectBase *object, NSString *key);
64 |
65 | /**
66 | Sets a value for a key on the object.
67 |
68 | @warning This function is useful only in specialized circumstances, for example, when building components
69 | that integrate with Realm. If you are simply building an app on Realm, it is
70 | recommended to set key values via `RLMObject`.
71 |
72 | @warning Will throw an `NSUndefinedKeyException` if `key` is not present on the object.
73 |
74 | @param object An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
75 | @param key The name of the property.
76 | @param obj The object to set as the value of the key.
77 | */
78 | FOUNDATION_EXTERN void RLMObjectBaseSetObjectForKeyedSubscript(RLMObjectBase *object, NSString *key, id obj);
79 |
80 |
--------------------------------------------------------------------------------
/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:(id )propertyName;
64 |
65 | /**
66 | Returns a Boolean value that indicates 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.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 |
25 | // RLMObjectSchema private
26 | @interface RLMObjectSchema () {
27 | @public
28 | bool _isSwiftClass;
29 | }
30 |
31 | // writable redecleration
32 | @property (nonatomic, readwrite, copy) NSArray *properties;
33 | @property (nonatomic, readwrite, assign) bool isSwiftClass;
34 |
35 | // class used for this object schema
36 | @property (nonatomic, readwrite, assign) Class objectClass;
37 | @property (nonatomic, readwrite, assign) Class accessorClass;
38 | @property (nonatomic, readwrite, assign) Class unmanagedClass;
39 |
40 | @property (nonatomic, readwrite, nullable) RLMProperty *primaryKeyProperty;
41 |
42 | @property (nonatomic, copy) NSArray *computedProperties;
43 | @property (nonatomic, readonly) NSArray *swiftGenericProperties;
44 |
45 | // The Realm retains its object schemas, so they need to not retain the Realm
46 | @property (nonatomic, unsafe_unretained, nullable) RLMRealm *realm;
47 | // returns a cached or new schema for a given object class
48 | + (instancetype)schemaForObjectClass:(Class)objectClass;
49 |
50 | - (RLMProperty *)propertyForTableColumn:(size_t)tableCol;
51 |
52 | @end
53 |
54 | @interface RLMObjectSchema (Dynamic)
55 | /**
56 | This method is useful only in specialized circumstances, for example, when accessing objects
57 | in a Realm produced externally. If you are simply building an app on Realm, it is not recommended
58 | to use this method as an [RLMObjectSchema](RLMObjectSchema) is generated automatically for every [RLMObject](RLMObject) subclass.
59 |
60 | Initialize an RLMObjectSchema with classname, objectClass, and an array of properties
61 |
62 | @warning This method is useful only in specialized circumstances.
63 |
64 | @param objectClassName The name of the class used to refer to objects of this type.
65 | @param objectClass The Objective-C class used when creating instances of this type.
66 | @param properties An array of RLMProperty instances describing the managed properties for this type.
67 |
68 | @return An initialized instance of RLMObjectSchema.
69 | */
70 | - (instancetype)initWithClassName:(NSString *)objectClassName objectClass:(Class)objectClass properties:(NSArray *)properties;
71 | @end
72 |
73 | NS_ASSUME_NONNULL_END
74 |
--------------------------------------------------------------------------------
/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 | #import "object_schema.hpp"
22 | #import "RLMObject_Private.hpp"
23 |
24 | #import
25 | #import
26 |
27 | namespace realm {
28 | class Table;
29 | }
30 |
31 | class RLMObservationInfo;
32 |
33 | // RLMObjectSchema private
34 | @interface RLMObjectSchema () {
35 | @public
36 | std::vector _observedObjects;
37 | }
38 | @property (nonatomic) realm::Table *table;
39 |
40 | // shallow copy reusing properties and property map
41 | - (instancetype)shallowCopy;
42 |
43 | // create realm::ObjectSchema copy
44 | - (realm::ObjectSchema)objectStoreCopy;
45 |
46 | // initialize with realm::ObjectSchema
47 | + (instancetype)objectSchemaForObjectStoreSchema:(realm::ObjectSchema &)objectSchema;
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMObjectStore.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 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | @class RLMRealm, RLMSchema, RLMObjectSchema, RLMObjectBase, RLMResults, RLMProperty;
26 |
27 | //
28 | // Accessor Creation
29 | //
30 |
31 | // create or get cached accessors for the given schema
32 | void RLMRealmCreateAccessors(RLMSchema *schema);
33 |
34 | // Clear the cache of created accessor classes
35 | void RLMClearAccessorCache();
36 |
37 |
38 | //
39 | // Options for object creation
40 | //
41 | typedef NS_OPTIONS(NSUInteger, RLMCreationOptions) {
42 | // Normal object creation
43 | RLMCreationOptionsNone = 0,
44 | // If the property is a link or array property, upsert the linked objects
45 | // if they have a primary key, and insert them otherwise.
46 | RLMCreationOptionsCreateOrUpdate = 1 << 0,
47 | // Allow unmanaged objects to be promoted to managed objects
48 | // if false objects are copied during object creation
49 | RLMCreationOptionsPromoteUnmanaged = 1 << 1,
50 | };
51 |
52 |
53 | //
54 | // Adding, Removing, Getting Objects
55 | //
56 |
57 | // add an object to the given realm
58 | void RLMAddObjectToRealm(RLMObjectBase *object, RLMRealm *realm, bool createOrUpdate);
59 |
60 | // delete an object from its realm
61 | void RLMDeleteObjectFromRealm(RLMObjectBase *object, RLMRealm *realm);
62 |
63 | // deletes all objects from a realm
64 | void RLMDeleteAllObjectsFromRealm(RLMRealm *realm);
65 |
66 | // get objects of a given class
67 | RLMResults *RLMGetObjects(RLMRealm *realm, NSString *objectClassName, NSPredicate *predicate) NS_RETURNS_RETAINED;
68 |
69 | // get an object with the given primary key
70 | id RLMGetObject(RLMRealm *realm, NSString *objectClassName, id key) NS_RETURNS_RETAINED;
71 |
72 | // create object from array or dictionary
73 | RLMObjectBase *RLMCreateObjectInRealmWithValue(RLMRealm *realm, NSString *className, id value, bool createOrUpdate) NS_RETURNS_RETAINED;
74 |
75 |
76 | //
77 | // Accessor Creation
78 | //
79 |
80 |
81 | // switch List<> properties from being backed by unmanaged RLMArrays to RLMArrayLinkView
82 | void RLMInitializeSwiftAccessorGenerics(RLMObjectBase *object);
83 |
84 | #ifdef __cplusplus
85 | }
86 |
87 | namespace realm {
88 | class Table;
89 | template class BasicRowExpr;
90 | using RowExpr = BasicRowExpr;
91 | }
92 | // Create accessors
93 | RLMObjectBase *RLMCreateObjectAccessor(RLMRealm *realm,
94 | RLMObjectSchema *objectSchema,
95 | NSUInteger index) NS_RETURNS_RETAINED;
96 | RLMObjectBase *RLMCreateObjectAccessor(RLMRealm *realm,
97 | RLMObjectSchema *objectSchema,
98 | realm::RowExpr row) NS_RETURNS_RETAINED;
99 | #endif
100 |
--------------------------------------------------------------------------------
/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 |
23 | #import // required by row.hpp
24 | #import
25 |
26 | class RLMObservationInfo;
27 |
28 | // RLMObject accessor and read/write realm
29 | @interface RLMObjectBase () {
30 | @public
31 | realm::Row _row;
32 | RLMObservationInfo *_observationInfo;
33 | }
34 | @end
35 |
36 | // throw an exception if the object is invalidated or on the wrong thread
37 | static inline void RLMVerifyAttached(__unsafe_unretained RLMObjectBase *const obj) {
38 | if (!obj->_row.is_attached()) {
39 | @throw RLMException(@"Object has been deleted or invalidated.");
40 | }
41 | [obj->_realm verifyThread];
42 | }
43 |
44 | // throw an exception if the object can't be modified for any reason
45 | static inline void RLMVerifyInWriteTransaction(__unsafe_unretained RLMObjectBase *const obj) {
46 | // first verify is attached
47 | RLMVerifyAttached(obj);
48 |
49 | if (!obj->_realm.inWriteTransaction) {
50 | @throw RLMException(@"Attempting to modify object outside of a write transaction - call beginWriteTransaction on an RLMRealm instance first.");
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/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 | @class RLMObjectBase, RLMProperty;
23 |
24 | @interface RLMOptionalBase : NSProxy
25 |
26 | - (instancetype)init;
27 |
28 | @property (nonatomic, weak) RLMObjectBase *object;
29 |
30 | @property (nonatomic, unsafe_unretained) RLMProperty *property;
31 |
32 | @property (nonatomic, strong) id underlyingValue;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Pods/Realm/include/RLMPlatform.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fumiyasac/DatabasePersistencePattern/9cac78996b89e0b81b635dec616c0aa9a0e36cbf/Pods/Realm/include/RLMPlatform.h
--------------------------------------------------------------------------------
/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 |
20 | using ExpressionVisitor = NSExpression *(*)(NSExpression *);
21 | NSPredicate *transformPredicate(NSPredicate *, ExpressionVisitor);
22 |
--------------------------------------------------------------------------------
/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