Repository: PoissonBallon/EasyRealm Branch: master Commit: 0e5005ac0f92 Files: 52 Total size: 106.4 KB Directory structure: gitextract_v6e27xxc/ ├── .gitignore ├── .slather.yml ├── .swift-version ├── .travis.yml ├── Cartfile ├── Cartfile.resolved ├── EasyRealm/ │ ├── Assets/ │ │ └── .gitkeep │ ├── Classes/ │ │ ├── .gitkeep │ │ ├── Delete.swift │ │ ├── EasyRealm.swift │ │ ├── EasyRealmList.swift │ │ ├── EasyRealmQueue.swift │ │ ├── Edit.swift │ │ ├── Error.swift │ │ ├── Query.swift │ │ ├── Save.swift │ │ └── Variable.swift │ ├── EasyRealm.h │ └── Info.plist ├── EasyRealm.podspec ├── EasyRealm.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata/ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata/ │ └── xcschemes/ │ └── EasyRealm.xcscheme ├── Example/ │ ├── EasyRealm/ │ │ ├── AppDelegate.swift │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.xib │ │ │ └── Main.storyboard │ │ ├── Images.xcassets/ │ │ │ └── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── ViewController.swift │ ├── EasyRealm.xcodeproj/ │ │ ├── project.pbxproj │ │ ├── project.xcworkspace/ │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── EasyRealm-Example.xcscheme │ ├── EasyRealm.xcworkspace/ │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata/ │ │ └── IDEWorkspaceChecks.plist │ ├── Podfile │ └── Tests/ │ ├── Info.plist │ ├── Pokedex.swift │ ├── Pokemon.swift │ ├── PokemonHelp.swift │ ├── TestDelete.swift │ ├── TestEdit.swift │ ├── TestMeasure.swift │ ├── TestQuery.swift │ ├── TestSave.swift │ ├── TestUpdate.swift │ ├── TestVariable.swift │ └── Trainer.swift ├── LICENSE ├── README.md ├── Ressources/ │ └── easy_realm_logo.sketch └── scripts/ └── deploy.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Xcode # # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore ## Build generated build/ DerivedData/ ## Various settings *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata/ ## Other *.moved-aside *.xcuserstate ## Obj-C/Swift specific *.hmap *.ipa *.dSYM.zip *.dSYM ## Playgrounds timeline.xctimeline playground.xcworkspace # Swift Package Manager # # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. # Packages/ .build/ # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control Pods/ # Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. Carthage/Checkouts Carthage/Build # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the # screenshots whenever they are needed. # For more information about the recommended setup visit: # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output ================================================ FILE: .slather.yml ================================================ # .slather.yml coverage_service: coveralls xcodeproj: Example/EasyRealm.xcodeproj workspace: Example/EasyRealm.xcworkspace scheme: EasyRealm-Example source_directory: Pod/Classes binary_basename: EasyRealm input_format: profdata ================================================ FILE: .swift-version ================================================ 4.2 ================================================ FILE: .travis.yml ================================================ language: objective-c osx_image: xcode10 xcode_project: Example/EasyRealm.xcworkspace before_install: - gem install fastlane -NV before_script: #If one of this failed we have error and all process is stopped - cd Example - pod install --repo-update script: - fastlane scan -s EasyRealm-Example --device "iPhone 6" --clean --code_coverage after_success: - cd $TRAVIS_BUILD_DIR - bash <(curl -s https://codecov.io/bash) ================================================ FILE: Cartfile ================================================ # Require version 3.10 or later github "realm/realm-cocoa" >= 3.10 ================================================ FILE: Cartfile.resolved ================================================ github "realm/realm-cocoa" "v3.0.2" ================================================ FILE: EasyRealm/Assets/.gitkeep ================================================ ================================================ FILE: EasyRealm/Classes/.gitkeep ================================================ ================================================ FILE: EasyRealm/Classes/Delete.swift ================================================ // // ER_Delete.swift // Pods // // Created by Allan Vialatte on 23/11/16. // // import Foundation import Realm import RealmSwift public enum EasyRealmDeleteMethod { case simple case cascade } public extension EasyRealmStatic where T:Object { public func deleteAll() throws { let realm = try Realm() try realm.write { realm.delete(realm.objects(self.baseType)) } } } public extension EasyRealm where T:Object { public func delete(with method:EasyRealmDeleteMethod = .simple) throws { switch method { case .simple: self.isManaged ? try managedSimpleDelete() : try unmanagedSimpleDelete() case .cascade: self.isManaged ? try managedCascadeDelete() : try unmanagedCascadeDelete() } } } //Normal Way fileprivate extension EasyRealm where T: Object { fileprivate func managedSimpleDelete() throws { guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } let ref = ThreadSafeReference(to: self.base) try rq.queue.sync { guard let object = rq.realm.resolve(ref) else { throw EasyRealmError.ObjectCantBeResolved } try rq.realm.write { EasyRealm.simpleDelete(this: object, in: rq) } } } fileprivate func unmanagedSimpleDelete() throws { guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } guard let key = T.primaryKey() else { throw EasyRealmError.ObjectCantBeResolved } try rq.queue.sync { let value = self.base.value(forKey: key) if let object = rq.realm.object(ofType: T.self, forPrimaryKey: value) { try rq.realm.write { EasyRealm.simpleDelete(this: object, in: rq) } } } } fileprivate static func simpleDelete(this object:Object, in queue:EasyRealmQueue) { queue.realm.delete(object) } } //Cascade Way fileprivate extension EasyRealm where T: Object { fileprivate func managedCascadeDelete() throws { guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } let ref = ThreadSafeReference(to: self.base) try rq.queue.sync { guard let object = rq.realm.resolve(ref) else { throw EasyRealmError.ObjectCantBeResolved } try rq.realm.write { EasyRealm.cascadeDelete(this: object, in: rq) } } } fileprivate func unmanagedCascadeDelete() throws { guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } guard let key = T.primaryKey() else { throw EasyRealmError.ObjectCantBeResolved } try rq.queue.sync { let value = self.base.value(forKey: key) if let object = rq.realm.object(ofType: T.self, forPrimaryKey: value) { try rq.realm.write { EasyRealm.cascadeDelete(this: object, in: rq) } } } } fileprivate static func cascadeDelete(this object:Object, in queue:EasyRealmQueue) { for property in object.objectSchema.properties { guard let value = object.value(forKey: property.name) else { continue } if let object = value as? Object { EasyRealm.cascadeDelete(this: object, in: queue) } if let list = value as? EasyRealmList { list.children().forEach { EasyRealm.cascadeDelete(this: $0, in: queue) } } } queue.realm.delete(object) } } ================================================ FILE: EasyRealm/Classes/EasyRealm.swift ================================================ // // EasyRealm.swift // Pods // // Created by Allan Vialatte on 23/11/16. // // import RealmSwift public final class EasyRealm { internal var base: T public init(_ instance: T) { self.base = instance } } public final class EasyRealmStatic { internal var baseType:T.Type public init(_ instance: T.Type) { self.baseType = instance } } public protocol EasyRealmCompatible { associatedtype CompatibleType var er: EasyRealm { get } static var er: EasyRealmStatic { get } } public extension EasyRealmCompatible { public var er: EasyRealm { get { return EasyRealm(self) } } public static var er: EasyRealmStatic { get { return EasyRealmStatic(Self.self) } } } extension Object:EasyRealmCompatible {} ================================================ FILE: EasyRealm/Classes/EasyRealmList.swift ================================================ // // EasyRealmList.swift // Pods // // Created by Allan Vialatte on 01/05/2017. // // import Foundation import RealmSwift internal protocol EasyRealmList { func children() -> [Object] } extension List:EasyRealmList { internal func children() -> [Object] { return self.compactMap { return $0 as? Object } } } ================================================ FILE: EasyRealm/Classes/EasyRealmQueue.swift ================================================ // // EasyRealmCore.swift // Pods // // Created by Allan Vialatte on 17/02/2017. // // import Foundation import RealmSwift internal struct EasyRealmQueue { let realm:Realm let queue:DispatchQueue init?() { queue = DispatchQueue(label: UUID().uuidString) var tmp:Realm? = nil queue.sync { tmp = try? Realm() } guard let valid = tmp else { return nil } self.realm = valid } } ================================================ FILE: EasyRealm/Classes/Edit.swift ================================================ // // ER_Edit.swift // Pods // // Created by Allan Vialatte on 23/11/16. // // import Foundation import Realm import RealmSwift extension EasyRealm where T:Object { public func edit(_ closure: @escaping (_ T:T) -> Void) throws { self.isManaged ? try managed_edit(closure) : try unmanaged_dit(closure) } } fileprivate extension EasyRealm where T:Object { fileprivate func managed_edit(_ closure: @escaping (_ T:T) -> Void) throws { guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } let ref = ThreadSafeReference(to: self.base) try rq.queue.sync { guard let object = rq.realm.resolve(ref) else { throw EasyRealmError.ObjectCantBeResolved } try rq.realm.write { closure(object) } } } fileprivate func unmanaged_dit(_ closure: @escaping (_ T:T) -> Void) throws { closure(self.base) } } ================================================ FILE: EasyRealm/Classes/Error.swift ================================================ // // ER_Error.swift // Pods // // Created by Allan Vialatte on 17/02/2017. // // import Foundation public enum EasyRealmError: Error { case RealmQueueCantBeCreate case ObjectCantBeResolved case ObjectHaveNotPrimaryKey case ObjectWithPrimaryKeyNotFound case ManagedVersionOfObjectDoesntExist } ================================================ FILE: EasyRealm/Classes/Query.swift ================================================ // // ER_Query.swift // Pods // // Created by Allan Vialatte on 05/03/2017. // // import Foundation import RealmSwift public extension EasyRealmStatic where T:Object { public func fromRealm(with primaryKey:K) throws -> T { let realm = try Realm() if let object = realm.object(ofType: self.baseType, forPrimaryKey: primaryKey) { return object } else { throw EasyRealmError.ObjectWithPrimaryKeyNotFound } } public func all() throws -> Results { let realm = try Realm() return realm.objects(self.baseType) } } ================================================ FILE: EasyRealm/Classes/Save.swift ================================================ // // ER_Save.swift // Pods // // Created by Allan Vialatte on 23/11/16. // // import Foundation import RealmSwift extension EasyRealm where T:Object { public func save(update:Bool = false) throws { let _ = try self.saved(update: update) } public func saved(update:Bool = false) throws -> T { return (self.isManaged) ? try managed_save(update: update) : try unmanaged_save(update: update) } public func update() throws { let _ = (self.isManaged) ? try managed_save(update: true) : try unmanaged_save(update: true) } } fileprivate extension EasyRealm where T: Object { fileprivate func managed_save(update:Bool) throws -> T { let ref = ThreadSafeReference(to: self.base) guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } return try rq.queue.sync { guard let object = rq.realm.resolve(ref) else { throw EasyRealmError.ObjectCantBeResolved } rq.realm.beginWrite() let ret = rq.realm.create(T.self, value: object, update: update) try rq.realm.commitWrite() return ret } } fileprivate func unmanaged_save(update:Bool) throws -> T { let realm = try Realm() realm.beginWrite() let ret = realm.create(T.self, value: self.base, update: update) try realm.commitWrite() return ret } } ================================================ FILE: EasyRealm/Classes/Variable.swift ================================================ // // ER_Variable.swift // Pods // // Created by Allan Vialatte on 05/03/2017. // import Foundation import Realm import RealmSwift extension EasyRealm where T: Object { public var isManaged: Bool { return (self.base.realm != nil) } public var managed: T? { guard let realm = try? Realm(), let key = T.primaryKey() else { return nil } let object = realm.object(ofType: T.self, forPrimaryKey: self.base.value(forKey: key)) return object } public var unmanaged:T { return self.base.easyDetached() } func detached() -> T { return self.base.easyDetached() } } fileprivate extension Object { fileprivate func easyDetached() -> Self { let detached = type(of: self).init() for property in objectSchema.properties { guard let value = value(forKey: property.name) else { continue } if let detachable = value as? Object { detached.setValue(detachable.easyDetached(), forKey: property.name) } else if let detachable = value as? EasyRealmList { detached.setValue(detachable.children().compactMap { $0.easyDetached() },forKey: property.name) } else { detached.setValue(value, forKey: property.name) } } return detached } } ================================================ FILE: EasyRealm/EasyRealm.h ================================================ // // EasyRealm.h // EasyRealm // // Created by Allan Vialatte on 26/03/2017. // Copyright © 2017 Allan Vialatte. All rights reserved. // #import //! Project version number for EasyRealm. FOUNDATION_EXPORT double EasyRealmVersionNumber; //! Project version string for EasyRealm. FOUNDATION_EXPORT const unsigned char EasyRealmVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import ================================================ FILE: EasyRealm/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: EasyRealm.podspec ================================================ # # Be sure to run `pod lib lint EasyRealm.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'EasyRealm' s.version = '3.4.0' s.summary = 'EasyRealm is a micro-framework that helps you use Realm.' # This description is used to generate tags and improve search results. # * Think: What does it do? Why did you write it? What is the focus? # * Try to keep it short, snappy and to the point. # * Write the description between the DESC delimiters below. # * Finally, don't worry about the indent, CocoaPods strips it! s.description = <<-DESC EasyRealm is a micro-framework (less than 200 LOC) that helps you use Realm. DESC s.homepage = 'https://github.com/PoissonBallon/EasyRealm.git' # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' s.license = { type: 'MIT', file: 'LICENSE' } s.author = { 'Allan Vialatte' => 'allan.vialatte@icloud.com' } s.source = { git: 'https://github.com/PoissonBallon/EasyRealm.git', tag: s.version.to_s } s.social_media_url = 'https://twitter.com/poissonballon' s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.9' s.tvos.deployment_target = '9.0' s.watchos.deployment_target = '2.0' s.source_files = 'EasyRealm/Classes/**/*.swift' s.swift_version = '4.2' s.dependency 'RealmSwift', '~> 3.10' end ================================================ FILE: EasyRealm.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 3B4CBD9B1E8803000044BCAA /* EasyRealm.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B4CBD991E8803000044BCAA /* EasyRealm.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3B4CBDC11E880B250044BCAA /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B4CBDBB1E8807A20044BCAA /* Realm.framework */; }; 3B4CBDC21E880B250044BCAA /* RealmSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B4CBDBC1E8807A20044BCAA /* RealmSwift.framework */; }; 3B4CBDCC1E880B580044BCAA /* EasyRealm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B4CBDC31E880B580044BCAA /* EasyRealm.swift */; }; 3B760B311EBA8FF50012B56A /* Delete.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B291EBA8FF50012B56A /* Delete.swift */; }; 3B760B321EBA8FF50012B56A /* Variable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2A1EBA8FF50012B56A /* Variable.swift */; }; 3B760B331EBA8FF50012B56A /* EasyRealmList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2B1EBA8FF50012B56A /* EasyRealmList.swift */; }; 3B760B341EBA8FF50012B56A /* EasyRealmQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2C1EBA8FF50012B56A /* EasyRealmQueue.swift */; }; 3B760B351EBA8FF50012B56A /* Edit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2D1EBA8FF50012B56A /* Edit.swift */; }; 3B760B361EBA8FF50012B56A /* Save.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2E1EBA8FF50012B56A /* Save.swift */; }; 3B760B371EBA8FF50012B56A /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2F1EBA8FF50012B56A /* Error.swift */; }; 3B760B381EBA8FF50012B56A /* Query.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B301EBA8FF50012B56A /* Query.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 3B4CBD961E8803000044BCAA /* EasyRealm.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EasyRealm.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3B4CBD991E8803000044BCAA /* EasyRealm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EasyRealm.h; sourceTree = ""; }; 3B4CBD9A1E8803000044BCAA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3B4CBDB51E8806DC0044BCAA /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Realm.framework; path = ../Carthage/Build/iOS/Realm.framework; sourceTree = ""; }; 3B4CBDB61E8806DC0044BCAA /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RealmSwift.framework; path = ../Carthage/Build/iOS/RealmSwift.framework; sourceTree = ""; }; 3B4CBDBB1E8807A20044BCAA /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Realm.framework; path = Carthage/Build/iOS/Realm.framework; sourceTree = ""; }; 3B4CBDBC1E8807A20044BCAA /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RealmSwift.framework; path = Carthage/Build/iOS/RealmSwift.framework; sourceTree = ""; }; 3B4CBDC31E880B580044BCAA /* EasyRealm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyRealm.swift; sourceTree = ""; }; 3B760B291EBA8FF50012B56A /* Delete.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Delete.swift; sourceTree = ""; }; 3B760B2A1EBA8FF50012B56A /* Variable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Variable.swift; sourceTree = ""; }; 3B760B2B1EBA8FF50012B56A /* EasyRealmList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyRealmList.swift; sourceTree = ""; }; 3B760B2C1EBA8FF50012B56A /* EasyRealmQueue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyRealmQueue.swift; sourceTree = ""; }; 3B760B2D1EBA8FF50012B56A /* Edit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Edit.swift; sourceTree = ""; }; 3B760B2E1EBA8FF50012B56A /* Save.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Save.swift; sourceTree = ""; }; 3B760B2F1EBA8FF50012B56A /* Error.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Error.swift; sourceTree = ""; }; 3B760B301EBA8FF50012B56A /* Query.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Query.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 3B4CBD921E8803000044BCAA /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 3B4CBDC11E880B250044BCAA /* Realm.framework in Frameworks */, 3B4CBDC21E880B250044BCAA /* RealmSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 3B4CBD8C1E8803000044BCAA = { isa = PBXGroup; children = ( 3B4CBD981E8803000044BCAA /* EasyRealm */, 3B4CBD971E8803000044BCAA /* Products */, 3B4CBDB41E8806DC0044BCAA /* Frameworks */, ); sourceTree = ""; }; 3B4CBD971E8803000044BCAA /* Products */ = { isa = PBXGroup; children = ( 3B4CBD961E8803000044BCAA /* EasyRealm.framework */, ); name = Products; sourceTree = ""; }; 3B4CBD981E8803000044BCAA /* EasyRealm */ = { isa = PBXGroup; children = ( 3B4CBDA11E8803100044BCAA /* Classes */, 3B4CBD991E8803000044BCAA /* EasyRealm.h */, 3B4CBD9A1E8803000044BCAA /* Info.plist */, ); path = EasyRealm; sourceTree = ""; }; 3B4CBDA11E8803100044BCAA /* Classes */ = { isa = PBXGroup; children = ( 3B760B291EBA8FF50012B56A /* Delete.swift */, 3B760B2A1EBA8FF50012B56A /* Variable.swift */, 3B760B2B1EBA8FF50012B56A /* EasyRealmList.swift */, 3B760B2C1EBA8FF50012B56A /* EasyRealmQueue.swift */, 3B760B2D1EBA8FF50012B56A /* Edit.swift */, 3B760B2E1EBA8FF50012B56A /* Save.swift */, 3B760B2F1EBA8FF50012B56A /* Error.swift */, 3B760B301EBA8FF50012B56A /* Query.swift */, 3B4CBDC31E880B580044BCAA /* EasyRealm.swift */, ); path = Classes; sourceTree = ""; }; 3B4CBDB41E8806DC0044BCAA /* Frameworks */ = { isa = PBXGroup; children = ( 3B4CBDBB1E8807A20044BCAA /* Realm.framework */, 3B4CBDBC1E8807A20044BCAA /* RealmSwift.framework */, 3B4CBDB51E8806DC0044BCAA /* Realm.framework */, 3B4CBDB61E8806DC0044BCAA /* RealmSwift.framework */, ); name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 3B4CBD931E8803000044BCAA /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 3B4CBD9B1E8803000044BCAA /* EasyRealm.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 3B4CBD951E8803000044BCAA /* EasyRealm */ = { isa = PBXNativeTarget; buildConfigurationList = 3B4CBD9E1E8803000044BCAA /* Build configuration list for PBXNativeTarget "EasyRealm" */; buildPhases = ( 3B4CBD921E8803000044BCAA /* Frameworks */, 3B4CBDB91E8807200044BCAA /* Carthage */, 3B4CBD911E8803000044BCAA /* Sources */, 3B4CBD931E8803000044BCAA /* Headers */, 3B4CBD941E8803000044BCAA /* Resources */, ); buildRules = ( ); dependencies = ( ); name = EasyRealm; productName = EasyRealm; productReference = 3B4CBD961E8803000044BCAA /* EasyRealm.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 3B4CBD8D1E8803000044BCAA /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Allan Vialatte"; TargetAttributes = { 3B4CBD951E8803000044BCAA = { CreatedOnToolsVersion = 8.2; LastSwiftMigration = 0820; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 3B4CBD901E8803000044BCAA /* Build configuration list for PBXProject "EasyRealm" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 3B4CBD8C1E8803000044BCAA; productRefGroup = 3B4CBD971E8803000044BCAA /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 3B4CBD951E8803000044BCAA /* EasyRealm */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 3B4CBD941E8803000044BCAA /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 3B4CBDB91E8807200044BCAA /* Carthage */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = Carthage; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/usr/local/bin/carthage copy-frameworks\n"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 3B4CBD911E8803000044BCAA /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 3B4CBDCC1E880B580044BCAA /* EasyRealm.swift in Sources */, 3B760B351EBA8FF50012B56A /* Edit.swift in Sources */, 3B760B331EBA8FF50012B56A /* EasyRealmList.swift in Sources */, 3B760B311EBA8FF50012B56A /* Delete.swift in Sources */, 3B760B361EBA8FF50012B56A /* Save.swift in Sources */, 3B760B341EBA8FF50012B56A /* EasyRealmQueue.swift in Sources */, 3B760B381EBA8FF50012B56A /* Query.swift in Sources */, 3B760B371EBA8FF50012B56A /* Error.swift in Sources */, 3B760B321EBA8FF50012B56A /* Variable.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ 3B4CBD9C1E8803000044BCAA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; 3B4CBD9D1E8803000044BCAA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; 3B4CBD9F1E8803000044BCAA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = EasyRealm/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = vialatte.EasyRealm; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_VERSION = 4.0; }; name = Debug; }; 3B4CBDA01E8803000044BCAA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = EasyRealm/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = vialatte.EasyRealm; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 4.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 3B4CBD901E8803000044BCAA /* Build configuration list for PBXProject "EasyRealm" */ = { isa = XCConfigurationList; buildConfigurations = ( 3B4CBD9C1E8803000044BCAA /* Debug */, 3B4CBD9D1E8803000044BCAA /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 3B4CBD9E1E8803000044BCAA /* Build configuration list for PBXNativeTarget "EasyRealm" */ = { isa = XCConfigurationList; buildConfigurations = ( 3B4CBD9F1E8803000044BCAA /* Debug */, 3B4CBDA01E8803000044BCAA /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 3B4CBD8D1E8803000044BCAA /* Project object */; } ================================================ FILE: EasyRealm.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: EasyRealm.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: EasyRealm.xcodeproj/xcshareddata/xcschemes/EasyRealm.xcscheme ================================================ ================================================ FILE: Example/EasyRealm/AppDelegate.swift ================================================ // // AppDelegate.swift // EasyRealm // // Created by Allan Vialatte on 03/13/2017. // Copyright (c) 2017 Allan Vialatte. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { return true } } ================================================ FILE: Example/EasyRealm/Base.lproj/LaunchScreen.xib ================================================ ================================================ FILE: Example/EasyRealm/Base.lproj/Main.storyboard ================================================ ================================================ FILE: Example/EasyRealm/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/EasyRealm/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft ================================================ FILE: Example/EasyRealm/ViewController.swift ================================================ // // ViewController.swift // EasyRealm // // Created by Allan Vialatte on 03/13/2017. // Copyright (c) 2017 Allan Vialatte. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } ================================================ FILE: Example/EasyRealm.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 3B27B1C91EBDDE30008BF579 /* TestQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B27B1C81EBDDE30008BF579 /* TestQuery.swift */; }; 3B7956D122170A0C00246717 /* TestUpdate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7956CF221709E000246717 /* TestUpdate.swift */; }; 3B7CD02B1E76DFAF00011116 /* Pokemon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD01E1E76DF6400011116 /* Pokemon.swift */; }; 3B7CD02C1E76DFAF00011116 /* PokemonHelp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD01F1E76DF6400011116 /* PokemonHelp.swift */; }; 3B7CD02D1E76DFAF00011116 /* TestDelete.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD0201E76DF6400011116 /* TestDelete.swift */; }; 3B7CD02E1E76DFAF00011116 /* TestEdit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD0211E76DF6400011116 /* TestEdit.swift */; }; 3B7CD02F1E76DFAF00011116 /* TestSave.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD0221E76DF6400011116 /* TestSave.swift */; }; 3B7CD0301E76DFAF00011116 /* TestVariable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD0231E76DF6400011116 /* TestVariable.swift */; }; 3BBFC7611EB7AE3A0003B466 /* TestMeasure.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BBFC7601EB7AE3A0003B466 /* TestMeasure.swift */; }; 3BC33AF61EAB98930019E72C /* Trainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BC33AF41EAB98930019E72C /* Trainer.swift */; }; 3BC33AFA1EAB98F70019E72C /* Pokedex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BC33AF81EAB98F70019E72C /* Pokedex.swift */; }; 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 7A0176CE0868DE2CDA9E6587 /* Pods_EasyRealm_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD2EF73E42A8D43D39780307 /* Pods_EasyRealm_Example.framework */; }; 95B8589827346242E7A2141E /* Pods_EasyRealm_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 467AB1A027915AF4125C6A80 /* Pods_EasyRealm_Tests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 607FACC81AFB9204008FA782 /* Project object */; proxyType = 1; remoteGlobalIDString = 607FACCF1AFB9204008FA782; remoteInfo = EasyRealm; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 061E59C21F2F2720DFCDC799 /* Pods-EasyRealm_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EasyRealm_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-EasyRealm_Example/Pods-EasyRealm_Example.release.xcconfig"; sourceTree = ""; }; 0A4DA23DD187DD2E8EEA00C8 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 3B27B1C81EBDDE30008BF579 /* TestQuery.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestQuery.swift; sourceTree = ""; }; 3B7956CF221709E000246717 /* TestUpdate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestUpdate.swift; sourceTree = ""; }; 3B7CD01E1E76DF6400011116 /* Pokemon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pokemon.swift; sourceTree = ""; }; 3B7CD01F1E76DF6400011116 /* PokemonHelp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PokemonHelp.swift; sourceTree = ""; }; 3B7CD0201E76DF6400011116 /* TestDelete.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestDelete.swift; sourceTree = ""; }; 3B7CD0211E76DF6400011116 /* TestEdit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEdit.swift; sourceTree = ""; }; 3B7CD0221E76DF6400011116 /* TestSave.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestSave.swift; sourceTree = ""; }; 3B7CD0231E76DF6400011116 /* TestVariable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestVariable.swift; sourceTree = ""; }; 3BBFC7601EB7AE3A0003B466 /* TestMeasure.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestMeasure.swift; sourceTree = ""; }; 3BC33AF41EAB98930019E72C /* Trainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Trainer.swift; sourceTree = ""; }; 3BC33AF81EAB98F70019E72C /* Pokedex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pokedex.swift; sourceTree = ""; }; 467AB1A027915AF4125C6A80 /* Pods_EasyRealm_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EasyRealm_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 5AC0DD2B71C5BD7C3E4B045D /* Pods-EasyRealm_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EasyRealm_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-EasyRealm_Tests/Pods-EasyRealm_Tests.debug.xcconfig"; sourceTree = ""; }; 607FACD01AFB9204008FA782 /* EasyRealm_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EasyRealm_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 607FACE51AFB9204008FA782 /* EasyRealm_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EasyRealm_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 962F9CCB6FC7DAF0C47B9A39 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; B6C45787A877C3285FE205B0 /* Pods-EasyRealm_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EasyRealm_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-EasyRealm_Tests/Pods-EasyRealm_Tests.release.xcconfig"; sourceTree = ""; }; CEE03CDEB69479C449935B09 /* EasyRealm.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = EasyRealm.podspec; path = ../EasyRealm.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; DD2EF73E42A8D43D39780307 /* Pods_EasyRealm_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EasyRealm_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; ED34CAE00F1E0583F8416DB8 /* Pods-EasyRealm_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EasyRealm_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-EasyRealm_Example/Pods-EasyRealm_Example.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 607FACCD1AFB9204008FA782 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 7A0176CE0868DE2CDA9E6587 /* Pods_EasyRealm_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 607FACE21AFB9204008FA782 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 95B8589827346242E7A2141E /* Pods_EasyRealm_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 607FACC71AFB9204008FA782 = { isa = PBXGroup; children = ( 607FACF51AFB993E008FA782 /* Podspec Metadata */, 607FACD21AFB9204008FA782 /* Example for EasyRealm */, 607FACE81AFB9204008FA782 /* Tests */, 607FACD11AFB9204008FA782 /* Products */, E379C712C20BF558D7C530B0 /* Pods */, D6FD36A88B40A890865461C3 /* Frameworks */, ); sourceTree = ""; }; 607FACD11AFB9204008FA782 /* Products */ = { isa = PBXGroup; children = ( 607FACD01AFB9204008FA782 /* EasyRealm_Example.app */, 607FACE51AFB9204008FA782 /* EasyRealm_Tests.xctest */, ); name = Products; sourceTree = ""; }; 607FACD21AFB9204008FA782 /* Example for EasyRealm */ = { isa = PBXGroup; children = ( 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 607FACD71AFB9204008FA782 /* ViewController.swift */, 607FACD91AFB9204008FA782 /* Main.storyboard */, 607FACDC1AFB9204008FA782 /* Images.xcassets */, 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 607FACD31AFB9204008FA782 /* Supporting Files */, ); name = "Example for EasyRealm"; path = EasyRealm; sourceTree = ""; }; 607FACD31AFB9204008FA782 /* Supporting Files */ = { isa = PBXGroup; children = ( 607FACD41AFB9204008FA782 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; 607FACE81AFB9204008FA782 /* Tests */ = { isa = PBXGroup; children = ( 3BC33AF41EAB98930019E72C /* Trainer.swift */, 3BC33AF81EAB98F70019E72C /* Pokedex.swift */, 3B7CD01E1E76DF6400011116 /* Pokemon.swift */, 3B7CD01F1E76DF6400011116 /* PokemonHelp.swift */, 3B7CD0201E76DF6400011116 /* TestDelete.swift */, 3B27B1C81EBDDE30008BF579 /* TestQuery.swift */, 3B7CD0211E76DF6400011116 /* TestEdit.swift */, 3B7CD0221E76DF6400011116 /* TestSave.swift */, 3B7956CF221709E000246717 /* TestUpdate.swift */, 3B7CD0231E76DF6400011116 /* TestVariable.swift */, 3BBFC7601EB7AE3A0003B466 /* TestMeasure.swift */, 607FACE91AFB9204008FA782 /* Supporting Files */, ); path = Tests; sourceTree = ""; }; 607FACE91AFB9204008FA782 /* Supporting Files */ = { isa = PBXGroup; children = ( 607FACEA1AFB9204008FA782 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { isa = PBXGroup; children = ( CEE03CDEB69479C449935B09 /* EasyRealm.podspec */, 962F9CCB6FC7DAF0C47B9A39 /* README.md */, 0A4DA23DD187DD2E8EEA00C8 /* LICENSE */, ); name = "Podspec Metadata"; sourceTree = ""; }; D6FD36A88B40A890865461C3 /* Frameworks */ = { isa = PBXGroup; children = ( DD2EF73E42A8D43D39780307 /* Pods_EasyRealm_Example.framework */, 467AB1A027915AF4125C6A80 /* Pods_EasyRealm_Tests.framework */, ); name = Frameworks; sourceTree = ""; }; E379C712C20BF558D7C530B0 /* Pods */ = { isa = PBXGroup; children = ( ED34CAE00F1E0583F8416DB8 /* Pods-EasyRealm_Example.debug.xcconfig */, 061E59C21F2F2720DFCDC799 /* Pods-EasyRealm_Example.release.xcconfig */, 5AC0DD2B71C5BD7C3E4B045D /* Pods-EasyRealm_Tests.debug.xcconfig */, B6C45787A877C3285FE205B0 /* Pods-EasyRealm_Tests.release.xcconfig */, ); name = Pods; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 607FACCF1AFB9204008FA782 /* EasyRealm_Example */ = { isa = PBXNativeTarget; buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "EasyRealm_Example" */; buildPhases = ( 1AFB4B2777294C8EFD045DB3 /* [CP] Check Pods Manifest.lock */, 607FACCC1AFB9204008FA782 /* Sources */, 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, 8584362E4784F814598805E0 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = EasyRealm_Example; productName = EasyRealm; productReference = 607FACD01AFB9204008FA782 /* EasyRealm_Example.app */; productType = "com.apple.product-type.application"; }; 607FACE41AFB9204008FA782 /* EasyRealm_Tests */ = { isa = PBXNativeTarget; buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "EasyRealm_Tests" */; buildPhases = ( 8B9E29F1A378E57DB2A2813E /* [CP] Check Pods Manifest.lock */, 607FACE11AFB9204008FA782 /* Sources */, 607FACE21AFB9204008FA782 /* Frameworks */, 607FACE31AFB9204008FA782 /* Resources */, ); buildRules = ( ); dependencies = ( 607FACE71AFB9204008FA782 /* PBXTargetDependency */, ); name = EasyRealm_Tests; productName = Tests; productReference = 607FACE51AFB9204008FA782 /* EasyRealm_Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 607FACC81AFB9204008FA782 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; LastUpgradeCheck = 1010; ORGANIZATIONNAME = CocoaPods; TargetAttributes = { 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; LastSwiftMigration = 0820; ProvisioningStyle = Manual; }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; LastSwiftMigration = 1010; ProvisioningStyle = Manual; TestTargetID = 607FACCF1AFB9204008FA782; }; }; }; buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "EasyRealm" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 607FACC71AFB9204008FA782; productRefGroup = 607FACD11AFB9204008FA782 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 607FACCF1AFB9204008FA782 /* EasyRealm_Example */, 607FACE41AFB9204008FA782 /* EasyRealm_Tests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 607FACCE1AFB9204008FA782 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 607FACE31AFB9204008FA782 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 1AFB4B2777294C8EFD045DB3 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-EasyRealm_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 8584362E4784F814598805E0 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-EasyRealm_Example/Pods-EasyRealm_Example-frameworks.sh", "${BUILT_PRODUCTS_DIR}/EasyRealm/EasyRealm.framework", "${BUILT_PRODUCTS_DIR}/Realm/Realm.framework", "${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EasyRealm.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-EasyRealm_Example/Pods-EasyRealm_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 8B9E29F1A378E57DB2A2813E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-EasyRealm_Tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 607FACCC1AFB9204008FA782 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 607FACE11AFB9204008FA782 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 3BC33AFA1EAB98F70019E72C /* Pokedex.swift in Sources */, 3BBFC7611EB7AE3A0003B466 /* TestMeasure.swift in Sources */, 3BC33AF61EAB98930019E72C /* Trainer.swift in Sources */, 3B7CD02C1E76DFAF00011116 /* PokemonHelp.swift in Sources */, 3B7CD0301E76DFAF00011116 /* TestVariable.swift in Sources */, 3B7956D122170A0C00246717 /* TestUpdate.swift in Sources */, 3B7CD02D1E76DFAF00011116 /* TestDelete.swift in Sources */, 3B7CD02F1E76DFAF00011116 /* TestSave.swift in Sources */, 3B7CD02B1E76DFAF00011116 /* Pokemon.swift in Sources */, 3B27B1C91EBDDE30008BF579 /* TestQuery.swift in Sources */, 3B7CD02E1E76DFAF00011116 /* TestEdit.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 607FACCF1AFB9204008FA782 /* EasyRealm_Example */; targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 607FACD91AFB9204008FA782 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 607FACDA1AFB9204008FA782 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { isa = PBXVariantGroup; children = ( 607FACDF1AFB9204008FA782 /* Base */, ); name = LaunchScreen.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 607FACED1AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.2; }; name = Debug; }; 607FACEE1AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 4.2; VALIDATE_PRODUCT = YES; }; name = Release; }; 607FACF01AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = ED34CAE00F1E0583F8416DB8 /* Pods-EasyRealm_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = EasyRealm/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 4.2; }; name = Debug; }; 607FACF11AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 061E59C21F2F2720DFCDC799 /* Pods-EasyRealm_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = EasyRealm/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 4.2; }; name = Release; }; 607FACF31AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5AC0DD2B71C5BD7C3E4B045D /* Pods-EasyRealm_Tests.debug.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EasyRealm_Example.app/EasyRealm_Example"; }; name = Debug; }; 607FACF41AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = B6C45787A877C3285FE205B0 /* Pods-EasyRealm_Tests.release.xcconfig */; buildSettings = { CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EasyRealm_Example.app/EasyRealm_Example"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "EasyRealm" */ = { isa = XCConfigurationList; buildConfigurations = ( 607FACED1AFB9204008FA782 /* Debug */, 607FACEE1AFB9204008FA782 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "EasyRealm_Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 607FACF01AFB9204008FA782 /* Debug */, 607FACF11AFB9204008FA782 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "EasyRealm_Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 607FACF31AFB9204008FA782 /* Debug */, 607FACF41AFB9204008FA782 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 607FACC81AFB9204008FA782 /* Project object */; } ================================================ FILE: Example/EasyRealm.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: Example/EasyRealm.xcodeproj/xcshareddata/xcschemes/EasyRealm-Example.xcscheme ================================================ ================================================ FILE: Example/EasyRealm.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: Example/EasyRealm.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: Example/Podfile ================================================ use_frameworks! platform :ios, '10.0' target 'EasyRealm_Example' do pod 'EasyRealm', :path => '../' target 'EasyRealm_Tests' do inherit! :search_paths end end ================================================ FILE: Example/Tests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: Example/Tests/Pokedex.swift ================================================ // // Pokedex.swift // EasyRealm // // Created by Allan Vialatte on 22/04/2017. // Copyright © 2017 CocoaPods. All rights reserved. // import Foundation import RealmSwift final class Pokedex:Object { @objc dynamic var identifier = UUID().uuidString override static func primaryKey() -> String? { return "identifier" } } ================================================ FILE: Example/Tests/Pokemon.swift ================================================ // // Pokemon.swift // EasyRealm // // Created by Allan Vialatte on 10/03/2017. // import Foundation import RealmSwift final class Pokeball:Object { @objc dynamic var identifier = UUID().uuidString @objc dynamic var level = 1 @objc dynamic var branding = "" override static func primaryKey() -> String? { return "identifier" } static func create() -> Pokeball { let ball = Pokeball() ball.level = Int(arc4random()) % 5 return ball } } final class Pokemon: Object { @objc dynamic var name: String? @objc dynamic var level: Int = 1 @objc dynamic var pokeball:Pokeball? let specialBoost = RealmOptional() override static func primaryKey() -> String? { return "name" } } ================================================ FILE: Example/Tests/PokemonHelp.swift ================================================ // // PokemonHelp.swift // EasyRealm // // Created by Allan Vialatte on 10/03/2017. // import Foundation struct HelpPokemon { static func pokemons(with names:[String]) -> [Pokemon] { return names.compactMap { let pokemon = Pokemon() pokemon.name = $0 pokemon.level = Int(arc4random()) % 100 return pokemon } } static func generateRandomPokemon() -> Pokemon { let pokemon = Pokemon() pokemon.name = allPokemonName[Int(arc4random()) % allPokemonName.count] pokemon.level = Int(arc4random()) % 100 return pokemon } static func generateCapturedRandomPokemon() -> Pokemon { let pokemon = Pokemon() pokemon.name = allPokemonName[Int(arc4random()) % allPokemonName.count] pokemon.level = Int(arc4random()) % 100 pokemon.pokeball = Pokeball.create() return pokemon } static func allPokedex() -> [Pokemon] { return allPokemonName.compactMap { let pokemon = Pokemon() pokemon.name = $0 pokemon.level = Int(arc4random()) % 100 return pokemon } } static let allPokemonName = [ "Bulbasaur", "Ivysaur", "Venusaur", "Charmander", "Charmeleon", "Charizard", "Squirtle", "Wartortle", "Blastoise", "Caterpie", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata", "Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Nidoran♀", "Nidorina", "Nidoqueen", "Nidoran♂", "Nidorino", "Nidoking", "Clefairy", "Clefable", "Vulpix", "Ninetales", "Jigglypuff", "Wigglytuff", "Zubat", "Golbat", "Oddish", "Gloom", "Vileplume", "Paras", "Parasect", "Venonat", "Venomoth", "Diglett", "Dugtrio", "Meowth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Growlithe", "Arcanine", "Poliwag", "Poliwhirl", "Poliwrath", "Abra", "Kadabra", "Alakazam", "Machop", "Machoke", "Machamp", "Bellsprout", "Weepinbell", "Victreebel", "Tentacool", "Tentacruel", "Geodude", "Graveler", "Golem", "Ponyta", "Rapidash", "Slowpoke", "Slowbro", "Magnemite", "Magneton", "Farfetch’d", "Doduo", "Dodrio", "Seel", "Dewgong", "Grimer", "Muk", "Shellder", "Cloyster", "Gastly", "Haunter", "Gengar", "Onix", "Drowzee", "Hypno", "Krabby", "Kingler", "Voltorb", "Electrode", "Exeggcute", "Exeggutor", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Lickitung", "Koffing", "Weezing", "Rhyhorn", "Rhydon", "Chansey", "Tangela", "Kangaskhan", "Horsea", "Seadra", "Goldeen", "Seaking", "Staryu", "Starmie", "er. Mime", "Scyther", "Jynx", "Electabuzz", "Magmar", "Pinsir", "Tauros", "Magikarp", "Gyarados", "Lapras", "Ditto", "Eevee", "Vaporeon", "Jolteon", "Flareon", "Porygon", "Omanyte", "Omastar", "Kabuto", "Kabutops", "Aerodactyl", "Snorlax", "Articuno", "Zapdos", "Moltres", "Dratini", "Dragonair", "Dragonite", "Mewtwo", "Mew", "Chikorita", "Bayleef", "Meganium", "Cyndaquil", "Quilava", "Typhlosion", "Totodile", "Croconaw", "Feraligatr", "Sentret", "Furret", "Hoothoot", "Noctowl", "Ledyba", "Ledian", "Spinarak", "Ariados", "Crobat", "Chinchou", "Lanturn", "Pichu", "Cleffa", "Igglybuff", "Togepi", "Togetic", "Natu", "Xatu", "Mareep", "Flaaffy", "Ampharos", "Bellossom", "Marill", "Azumarill", "Sudowoodo", "Politoed", "Hoppip", "Skiploom", "Jumpluff", "Aipom", "Sunkern", "Sunflora", "Yanma", "Wooper", "Quagsire", "Espeon", "Umbreon", "Murkrow", "Slowking", "Misdreavus", "Unown", "Wobbuffet", "Girafarig", "Pineco", "Forretress", "Dunsparce", "Gligar", "Steelix", "Snubbull", "Granbull", "Qwilfish", "Scizor", "Shuckle", "Heracross", "Sneasel", "Teddiursa", "Ursaring", "Slugma", "Magcargo", "Swinub", "Piloswine", "Corsola", "Remoraid", "Octillery", "Delibird", "Mantine", "Skarmory", "Houndour", "Houndoom", "Kingdra", "Phanpy", "Donphan", "Porygon2", "Stantler", "Smeargle", "Tyrogue", "Hitmontop", "Smoochum", "Elekid", "Magby", "Miltank", "Blissey", "Raikou", "Entei", "Suicune", "Larvitar", "Pupitar", "Tyranitar", "Lugia", "Ho-Oh", "Celebi", "Treecko", "Grovyle", "Sceptile", "Torchic", "Combusken", "Blaziken", "Mudkip", "Marshtomp", "Swampert", "Poochyena", "Mightyena", "Zigzagoon", "Linoone", "Wurmple", "Silcoon", "Beautifly", "Cascoon", "Dustox", "Lotad", "Lombre", "Ludicolo", "Seedot", "Nuzleaf", "Shiftry", "Taillow", "Swellow", "Wingull", "Pelipper", "Ralts", "Kirlia", "Gardevoir", "Surskit", "Masquerain", "Shroomish", "Breloom", "Slakoth", "Vigoroth", "Slaking", "Nincada", "Ninjask", "Shedinja", "Whismur", "Loudred", "Exploud", "Makuhita", "Hariyama", "Azurill", "Nosepass", "Skitty", "Delcatty", "Sableye", "Mawile", "Aron", "Lairon", "Aggron", "Meditite", "Medicham", "Electrike", "Manectric", "Plusle", "Minun", "Volbeat", "Illumise", "Roselia", "Gulpin", "Swalot", "Carvanha", "Sharpedo", "Wailmer", "Wailord", "Numel", "Camerupt", "Torkoal", "Spoink", "Grumpig", "Spinda", "Trapinch", "Vibrava", "Flygon", "Cacnea", "Cacturne", "Swablu", "Altaria", "Zangoose", "Seviper", "Lunatone", "Solrock", "Barboach", "Whiscash", "Corphish", "Crawdaunt", "Baltoy", "Claydol", "Lileep", "Cradily", "Anorith", "Armaldo", "Feebas", "Milotic", "Castform", "Kecleon", "Shuppet", "Banette", "Duskull", "Dusclops", "Tropius", "Chimecho", "Absol", "Wynaut", "Snorunt", "Glalie", "Spheal", "Sealeo", "Walrein", "Clamperl", "Huntail", "Gorebyss", "Relicanth", "Luvdisc", "Bagon", "Shelgon", "Salamence", "Beldum", "Metang", "Metagross", "Regirock", "Regice", "Registeel", "Latias", "Latios", "Kyogre", "Groudon", "Rayquaza", "Jirachi", "Deoxys", "Turtwig", "Grotle", "Torterra", "Chimchar", "Monferno", "Infernape", "Piplup", "Prinplup", "Empoleon", "Starly", "Staravia", "Staraptor", "Bidoof", "Bibarel", "Kricketot", "Kricketune", "Shinx", "Luxio", "Luxray", "Budew", "Roserade", "Cranidos", "Rampardos", "Shieldon", "Bastiodon", "Burmy", "Wormadam", "Mothim", "Combee", "Vespiquen", "Pachirisu", "Buizel", "Floatzel", "Cherubi", "Cherrim", "Shellos", "Gastrodon", "Ambipom", "Drifloon", "Drifblim", "Buneary", "Lopunny", "Mismagius", "Honchkrow", "Glameow", "Purugly", "Chingling", "Stunky", "Skuntank", "Bronzor", "Bronzong", "Bonsly", "Mime Jr.", "Happiny", "Chatot", "Spiritomb", "Gible", "Gabite", "Garchomp", "Munchlax", "Riolu", "Lucario", "Hippopotas", "Hippowdon", "Skorupi", "Drapion", "Croagunk", "Toxicroak", "Carnivine", "Finneon", "Lumineon", "Mantyke", "Snover", "Abomasnow", "Weavile", "Magnezone", "Lickilicky", "Rhyperior", "Tangrowth", "Electivire", "Magmortar", "Togekiss", "Yanmega", "Leafeon", "Glaceon", "Gliscor", "Mamoswine", "Porygon-Z", "Gallade", "Probopass", "Dusknoir", "Froslass", "Rotom", "Uxie", "Mesprit", "Azelf", "Dialga", "Palkia", "Heatran", "Regigigas", "Giratina", "Cresselia", "Phione", "Manaphy", "Darkrai", "Shaymin", "Arceus", "Victini", "Snivy", "Servine", "Serperior", "Tepig", "Pignite", "Emboar", "Oshawott", "Dewott", "Samurott", "Patrat", "Watchog", "Lillipup", "Herdier", "Stoutland", "Purrloin", "Liepard", "Pansage", "Simisage", "Pansear", "Simisear", "Panpour", "Simipour", "Munna", "Musharna", "Pidove", "Tranquill", "Unfezant", "Blitzle", "Zebstrika", "Roggenrola", "Boldore", "Gigalith", "Woobat", "Swoobat", "Drilbur", "Excadrill", "Audino", "Timburr", "Gurdurr", "Conkeldurr", "Tympole", "Palpitoad", "Seismitoad", "Throh", "Sawk", "Sewaddle", "Swadloon", "Leavanny", "Venipede", "Whirlipede", "Scolipede", "Cottonee", "Whimsicott", "Petilil", "Lilligant", "Basculin", "Sandile", "Krokorok", "Krookodile", "Darumaka", "Darmanitan", "Maractus", "Dwebble", "Crustle", "Scraggy", "Scrafty", "Sigilyph", "Yamask", "Cofagrigus", "Tirtouga", "Carracosta", "Archen", "Archeops", "Trubbish", "Garbodor", "Zorua", "Zoroark", "Minccino", "Cinccino", "Gothita", "Gothorita", "Gothitelle", "Solosis", "Duosion", "Reuniclus", "Ducklett", "Swanna", "Vanillite", "Vanillish", "Vanilluxe", "Deerling", "Sawsbuck", "Emolga", "Karrablast", "Escavalier", "Foongus", "Amoonguss", "Frillish", "Jellicent", "Alomomola", "Joltik", "Galvantula", "Ferroseed", "Ferrothorn", "Klink", "Klang", "Klinklang", "Tynamo", "Eelektrik", "Eelektross", "Elgyem", "Beheeyem", "Litwick", "Lampent", "Chandelure", "Axew", "Fraxure", "Haxorus", "Cubchoo", "Beartic", "Cryogonal", "Shelmet", "Accelgor", "Stunfisk", "Mienfoo", "Mienshao", "Druddigon", "Golett", "Golurk", "Pawniard", "Bisharp", "Bouffalant", "Rufflet", "Braviary", "Vullaby", "Mandibuzz", "Heatmor", "Durant", "Deino", "Zweilous", "Hydreigon", "Larvesta", "Volcarona", "Cobalion", "Terrakion", "Virizion", "Tornadus", "Thundurus", "Reshiram", "Zekrom ", "Landorus", "Kyurem", "Keldeo", "Meloetta", "Genesect", "Chespin", "Quilladin", "Chesnaught", "Fennekin", "Braixen", "Delphox", "Froakie", "Frogadier", "Greninja", "Bunnelby", "Diggersby", "Fletchling", "Fletchinder", "Talonflame", "Scatterbug", "Spewpa", "Vivillon", "Litleo", "Pyroar", "Flabebe", "Floette", "Florges", "Skiddo", "Gogoat", "Pancham", "Pangoro", "Furfrou", "Espurr", "Meowstic", "Honedge", "Doublade", "Aegislash", "Spritzee", "Aromatisse", "Swirlix", "Slurpuff", "Inkay", "Malamar", "Binacle", "Barbaracle", "Skrelp", "Dragalge", "Clauncher", "Clawitzer", "Helioptile", "Heliolisk", "Tyrunt", "Tyrantrum", "Amaura", "Aurorus", "Sylveon", "Hawlucha", "Dedenne", "Carbink", "Goomy", "Sliggoo", "Goodra", "Klefki", "Phantump", "Trevenant", "Pumpkaboo", "Gourgeist", "Bergmite", "Avalugg", "Noibat", "Noivern", "Xerneas", "Yveltal", "Zygarde", "Diancie", "Hoopa", "Volcanion", "Rowlet", "Dartrix", "Decidueye", "Litten", "Torracat", "Incineroar", "Popplio", "Brionne", "Primarina", "Pikipek", "Trumbeak", "Toucannon", "Yungoos", "Gumshoos", "Grubbin", "Charjabug", "Vikavolt", "Crabrawler", "Crabominable", "Oricorio", "Cutiefly", "Ribombee", "Rockruff", "Lycanroc", "Wishiwashi", "Mareanie", "Toxapex", "Mudbray", "Mudsdale", "Dewpider", "Araquanid", "Fomantis", "Lurantis", "Morelull", "Shiinotic", "Salandit", "Salazzle", "Stufful", "Bewear", "Bounsweet", "Steenee", "Tsareena", "Comfey", "Oranguru", "Passimian", "Wimpod", "Golisopod", "Sandygast", "Palossand", "Pyukumuku", "Type: Null", "Silvally", "Minior", "Komala", "Turtonator", "Togedemaru", "Mimikyu", "Bruxish", "Drampa", "Dhelmise", "Jangmo-o", "Hakamo-o", "Kommo-o", "Tapu Koko", "Tapu Lele", "Tapu Bulu", "Tapu Fini", "Cosmog", "Cosmoem", "Solgaleo", "Lunala", "Nihilego", "Buzzwole", "Pheromosa", "Xurkitree", "Celesteela", "Kartana", "Guzzlord", "Necrozma", "Magearna", "Marshadow" ] } ================================================ FILE: Example/Tests/TestDelete.swift ================================================ // // Test_Delete.swift // EasyRealm // // Created by Allan Vialatte on 10/03/2017. // import XCTest import RealmSwift import EasyRealm class TestDelete: XCTestCase { let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] override func setUp() { super.setUp() Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name } override func tearDown() { super.tearDown() let realm = try! Realm() try! realm.write { realm.deleteAll() } } func testDeleteAll() { HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } try! Pokemon.er.deleteAll() let count = try! Pokemon.er.all().count XCTAssertEqual(count, 0) } func testDeleteUnmanaged() { let pokemons = HelpPokemon.pokemons(with: self.testPokemon) pokemons.forEach { try! $0.er.save(update: true) } pokemons.forEach { pokemon in XCTAssert(pokemon.realm == nil) try! pokemon.er.delete() } let count = try! Pokemon.er.all().count XCTAssertEqual(count, 0) } func testDeleteManaged() { HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } let pokemons = try! Pokemon.er.all() pokemons.forEach { XCTAssert($0.realm != nil) try! $0.er.delete() } let count = try! Pokemon.er.all().count XCTAssertEqual(count, 0) } func testDeleteCascadeComplexManagedObject() { let trainer = Trainer() let pokedex = Pokedex() trainer.pokemons.append(objectsIn: HelpPokemon.allPokedex()) trainer.pokedex = pokedex try! trainer.er.save(update: true) XCTAssertEqual(try! Trainer.er.all().count, 1) XCTAssertEqual(try! Pokedex.er.all().count, 1) XCTAssertEqual(try! Pokemon.er.all().count, HelpPokemon.allPokedex().count) let managed = trainer.er.managed! try! managed.er.delete(with: .cascade) XCTAssertEqual(try! Trainer.er.all().count, 0) XCTAssertEqual(try! Pokedex.er.all().count, 0) XCTAssertEqual(try! Pokemon.er.all().count, 0) } func testDeleteCascadeComplexUnManagedObject() { let trainer = Trainer() let pokedex = Pokedex() trainer.pokemons.append(objectsIn: HelpPokemon.allPokedex()) trainer.pokedex = pokedex try! trainer.er.save(update: true) XCTAssertEqual(try! Trainer.er.all().count, 1) XCTAssertEqual(try! Pokedex.er.all().count, 1) XCTAssertEqual(try! Pokemon.er.all().count, HelpPokemon.allPokedex().count) try! trainer.er.delete(with: .cascade) XCTAssertEqual(try! Trainer.er.all().count, 0) XCTAssertEqual(try! Pokedex.er.all().count, 0) XCTAssertEqual(try! Pokemon.er.all().count, 0) } } ================================================ FILE: Example/Tests/TestEdit.swift ================================================ // // Test_Edit.swift // EasyRealm // // Created by Allan Vialatte on 12/03/2017. // import XCTest import RealmSwift import EasyRealm class TestEdit: XCTestCase { let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] override func setUp() { super.setUp() Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name } override func tearDown() { super.tearDown() let realm = try! Realm() try! realm.write { realm.deleteAll() } } func testEditUnmanaged() { let pokemons = HelpPokemon.pokemons(with: self.testPokemon) pokemons.forEach { try! $0.er.edit { $0.level = 42 } } pokemons.forEach { XCTAssertEqual($0.level, 42) } } func testSaveManaged() { HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } let pokemons = try! Pokemon.er.all() pokemons.forEach { try! $0.er.edit { $0.level = 42 } } pokemons.forEach { XCTAssertTrue($0.realm != nil) XCTAssertEqual($0.level, 42) } } } ================================================ FILE: Example/Tests/TestMeasure.swift ================================================ // // TestMeasure.swift // EasyRealm // // Created by Allan Vialatte on 01/05/2017. // Copyright © 2017 CocoaPods. All rights reserved. // import XCTest import RealmSwift import EasyRealm class TestMeasure: XCTestCase { override func setUp() { super.setUp() Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name } override func tearDown() { super.tearDown() let realm = try! Realm() try! realm.write { realm.deleteAll() } } // Traditional Way func testCreateAndSave() { self.measure { let realm = try! Realm() let trainer = Trainer() let pokedex = Pokedex() trainer.pokemons.append(HelpPokemon.generateCapturedRandomPokemon()) trainer.pokedex = pokedex try! realm.write { realm.add(trainer, update: true) } } } // Easy Realm Way func testERCreateAndSave() { self.measure { let trainer = Trainer() let pokedex = Pokedex() trainer.pokemons.append(HelpPokemon.generateCapturedRandomPokemon()) trainer.pokedex = pokedex try! trainer.er.save(update: true) } } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } } ================================================ FILE: Example/Tests/TestQuery.swift ================================================ // // TestQuery.swift // EasyRealm // // Created by Allan Vialatte on 06/05/2017. // Copyright © 2017 CocoaPods. All rights reserved. // import XCTest import RealmSwift import EasyRealm class TestQuery: XCTestCase { override func setUp() { super.setUp() Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name } override func tearDown() { super.tearDown() let realm = try! Realm() try! realm.write { realm.deleteAll() } } func testQueryError() { if let firstPokemonName = HelpPokemon.allPokemonName.first { do { _ = try Pokemon.er.fromRealm(with: firstPokemonName) } catch EasyRealmError.ObjectWithPrimaryKeyNotFound { XCTAssertTrue(true) print("ObjectWithPrimaryKeyNotFound") } catch { print(error) XCTAssertTrue(false) } } } } ================================================ FILE: Example/Tests/TestSave.swift ================================================ // // Test_Save.swift // EasyRealm // // Created by Allan Vialatte on 10/03/2017. // import XCTest import RealmSwift import EasyRealm class TestSave: XCTestCase { let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] override func setUp() { super.setUp() Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name } override func tearDown() { super.tearDown() let realm = try! Realm() try! realm.write { realm.deleteAll() } } func testSaveUnmanaged() { HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } try! Pokeball.create().er.save() try! Pokeball.create().er.save() let numberOfPokemon = try! Pokemon.er.all() let numberOfPokeball = try! Pokeball.er.all() XCTAssertEqual(self.testPokemon.count, numberOfPokemon.count) XCTAssertEqual(2, numberOfPokeball.count) } func testSaveManaged() { HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } let managedPokemon = testPokemon.compactMap { try! Pokemon.er.fromRealm(with: $0) } managedPokemon.forEach { try! $0.er.save(update: true) } } func testMeasureSaveUnmanaged() { self.measure { try! Pokeball.create().er.save() } } func testMeasureSaveManaged() { let pokemon = HelpPokemon.pokemons(with: [self.testPokemon[0]]).first! try! pokemon.er.save(update: true) self.measure { try! pokemon.er.save(update: true) } } func testSaveLotOfComplexObject() { for _ in 0...10000 { try! HelpPokemon.generateCapturedRandomPokemon().er.save(update: true) } } } ================================================ FILE: Example/Tests/TestUpdate.swift ================================================ // // TestUpdate.swift // EasyRealm_Example // // Created by Allan Vialatte on 15/02/2019. // Copyright © 2019 CocoaPods. All rights reserved. // import XCTest import RealmSwift import EasyRealm class TestUpdate: XCTestCase { let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] override func setUp() { super.setUp() Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name } override func tearDown() { super.tearDown() let realm = try! Realm() try! realm.write { realm.deleteAll() } } func testUpdateUnmanaged() { HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } let pokemons = try! Pokemon.er.all() let unmanaged = Array(pokemons).map { $0.er.unmanaged } unmanaged.forEach { $0.level = 42 } unmanaged.forEach { try! $0.er.update() } let pikachus = try! Pokemon.er.all() pikachus.forEach { XCTAssertEqual($0.level, 42) } } } ================================================ FILE: Example/Tests/TestVariable.swift ================================================ // // Test_Variable.swift // EasyRealm // // Created by Allan Vialatte on 10/03/2017. // import XCTest import RealmSwift import EasyRealm class TestVariable: XCTestCase { let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] override func setUp() { super.setUp() Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name } override func tearDown() { super.tearDown() let realm = try! Realm() try! realm.write { realm.deleteAll() } } func testIsManaged() { HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } var pokemon = HelpPokemon.pokemons(with: [self.testPokemon[0]]).first! XCTAssertFalse(pokemon.er.isManaged) if let pok = pokemon.er.managed { pokemon = pok } XCTAssertTrue(pokemon.er.isManaged) } func testManaged() { let pokemon = HelpPokemon.generateCapturedRandomPokemon() try! pokemon.er.edit { $0.pokeball?.branding = "Masterball" } try! pokemon.er.save(update: true) let managed = pokemon.er.managed XCTAssertNotNil(managed) XCTAssertTrue(managed?.er.isManaged ?? false) XCTAssertEqual(managed?.pokeball?.branding, "Masterball") } func testUnManaged() { let pokemon = HelpPokemon.generateCapturedRandomPokemon() try! pokemon.er.edit { $0.pokeball?.branding = "Masterball" } try! pokemon.er.save(update: true) let managed = pokemon.er.managed XCTAssertNotNil(managed) XCTAssertTrue(managed?.er.isManaged ?? false) XCTAssertEqual(managed?.pokeball?.branding, "Masterball") let unmnaged = pokemon.er.unmanaged XCTAssertNotNil(unmnaged) XCTAssertFalse(unmnaged.er.isManaged) XCTAssertEqual(unmnaged.pokeball?.branding, "Masterball") } func testComplexObject() { let trainer = Trainer() let pokedex = Pokedex() trainer.pokemons.append(HelpPokemon.generateCapturedRandomPokemon()) trainer.pokedex = pokedex trainer.pokemons.forEach { $0.specialBoost.value = 42 } try! trainer.er.save(update: true) let managed = trainer.er.managed! XCTAssertTrue(managed.er.isManaged) XCTAssertTrue(managed.pokedex!.er.isManaged) XCTAssertFalse(managed.pokemons.isEmpty) managed.pokemons.forEach { XCTAssertTrue($0.er.isManaged) XCTAssertEqual($0.specialBoost.value!, 42) } let unmanaged = managed.er.unmanaged XCTAssertFalse(unmanaged.er.isManaged) XCTAssertFalse(unmanaged.pokedex!.er.isManaged) XCTAssertFalse(unmanaged.pokemons.isEmpty) unmanaged.pokemons.forEach { XCTAssertFalse($0.er.isManaged) XCTAssertEqual($0.specialBoost.value!, 42) } } } ================================================ FILE: Example/Tests/Trainer.swift ================================================ // // Tainer.swift // EasyRealm // // Created by Allan Vialatte on 22/04/2017. // Copyright © 2017 CocoaPods. All rights reserved. // import Foundation import RealmSwift final class Trainer: Object { @objc dynamic var identifier = UUID().uuidString @objc dynamic var pokedex:Pokedex? var pokemons = List() override static func primaryKey() -> String? { return "identifier" } } ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2017 Vialatte Allan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================

EasyRealm

[![Version](https://img.shields.io/cocoapods/v/EasyRealm.svg?style=flat)](http://cocoapods.org/pods/EasyRealm) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Platform](https://img.shields.io/cocoapods/p/EasyRealm.svg?style=flat)](http://cocoapods.org/pods/EasyRealm) [![Build Status](https://travis-ci.org/PoissonBallon/EasyRealm.svg?branch=master)](https://travis-ci.org/PoissonBallon/EasyRealm) [![Swift 4.2](https://img.shields.io/badge/Language-Swift%204.2-orange.svg)](https://developer.apple.com/swift/) [![codecov](https://codecov.io/gh/PoissonBallon/EasyRealm/branch/master/graph/badge.svg)](https://codecov.io/gh/PoissonBallon/EasyRealm) [![License](https://img.shields.io/cocoapods/l/EasyRealm.svg?style=flat)](http://cocoapods.org/pods/EasyRealm) EasyRealm is a micro-framework (less than 200 LOC) that helps you use Realm. ## Versions guides | Swift | Realm | EasyRealm | |-----------|-----------|-----------| | 3.0 | >= 2.4 | 2.0.1 | | 3.2 / 4.0 | >= 3.1.0 | >= 3.0.0 | | 4.2 | >= 3.10 | >= 3.4.0 | ## Keys Features EasyRealm import many features as : * Deep cascade deleting * Deep unmanaged object * Get managed object from unmanaged object. * Multithread Action (save / edit / delete / query) ## Promise EasyRealm make 4 promises : * EasyRealm never transform secretly an unmanaged Object to a managed Object and vice-versa. * EasyRealm let you use managed and unmanaged objects identically. * EasyRealm never manipulate thread behind your back, you keep full control of your process flow. * EasyRealm never handle Error for you. ## Examples ### Using * No inheritance. * No protocol. * Import Framework * Enjoy ### Save To save an object : ```swift let pokemon = Pokemon() try pokemon.er.save(update: true) //OR let managed = try pokemon.er.saved(update: true) ``` ### Edit To edit an object : ```swift let pokemon = Pokemon() try pokemon.er.edit { $0.level = 42 } ``` ### Delete To delete an object : ```swift let pokemon = Pokemon(name: "Pikachu") try pokemon.er.delete() //or try pokemon.er.delete(with: .simple) //or try pokemon.er.delete(with: .cascade) ``` To delete all objects : ```swift try Pokemon.er.deleteAll() ``` ### Queries To query all objects of one type : ```swift let pokemons = try Pokemon.er.all() ``` To query one object by its primaryKey : ```swift let pokemon = Pokemon.er.fromRealm(with: "Pikachu") ``` ### Helping Variables * isManaged : ```swift pokemon.er.isManaged // Return true if realm != nil and return false if realm == nil ``` * managed : ```swift pokemon.er.managed // Return the managed version of the object if one exist in Realm Database ``` * unmanaged : ```swift pokemon.er.unmanaged // Return an unmanaged version of the object ``` ## Installation EasyRealm is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile: #### CocoaPods ```ruby use_frameworks! pod "EasyRealm", '~> 3.2.0' ``` #### Carthage ```ruby github 'PoissonBallon/EasyRealm' ``` ## Author * PoissonBallon [@poissonballon](https://twitter.com/poissonballon) ## License EasyRealm is available under the MIT license. See the LICENSE file for more info. ## Other * Thanks to [@error32](http://savinien.net/) for logo * Thanks to [@trpl](https://github.com/trpl) for text review ================================================ FILE: scripts/deploy.sh ================================================ #!/usr/bin/env bash pod trunk push EasyRealm.podspec --verbose