├── .gitignore ├── .slather.yml ├── .swift-version ├── .travis.yml ├── Cartfile ├── Cartfile.resolved ├── EasyRealm.podspec ├── EasyRealm.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── EasyRealm.xcscheme ├── 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 ├── Example ├── EasyRealm.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── EasyRealm-Example.xcscheme ├── EasyRealm.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── EasyRealm │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── ViewController.swift ├── Podfile ├── Podfile.lock └── 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.png └── easy_realm_logo.sketch └── scripts └── deploy.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | Pods/ 46 | 47 | # Carthage 48 | # 49 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 50 | Carthage/Checkouts 51 | Carthage/Build 52 | 53 | # fastlane 54 | # 55 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 56 | # screenshots whenever they are needed. 57 | # For more information about the recommended setup visit: 58 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 59 | 60 | fastlane/report.xml 61 | fastlane/Preview.html 62 | fastlane/screenshots 63 | fastlane/test_output 64 | -------------------------------------------------------------------------------- /.slather.yml: -------------------------------------------------------------------------------- 1 | # .slather.yml 2 | 3 | coverage_service: coveralls 4 | xcodeproj: Example/EasyRealm.xcodeproj 5 | workspace: Example/EasyRealm.xcworkspace 6 | scheme: EasyRealm-Example 7 | source_directory: Pod/Classes 8 | binary_basename: EasyRealm 9 | input_format: profdata 10 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.2 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode10 3 | xcode_project: Example/EasyRealm.xcworkspace 4 | before_install: 5 | - gem install fastlane -NV 6 | before_script: 7 | #If one of this failed we have error and all process is stopped 8 | - cd Example 9 | - pod install --repo-update 10 | 11 | script: 12 | - fastlane scan -s EasyRealm-Example --device "iPhone 6" --clean --code_coverage 13 | 14 | after_success: 15 | - cd $TRAVIS_BUILD_DIR 16 | - bash <(curl -s https://codecov.io/bash) 17 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | # Require version 3.10 or later 2 | github "realm/realm-cocoa" >= 3.10 3 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "realm/realm-cocoa" "v3.0.2" 2 | -------------------------------------------------------------------------------- /EasyRealm.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint EasyRealm.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'EasyRealm' 11 | s.version = '3.4.0' 12 | s.summary = 'EasyRealm is a micro-framework that helps you use Realm.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | EasyRealm is a micro-framework (less than 200 LOC) that helps you use Realm. 22 | DESC 23 | 24 | s.homepage = 'https://github.com/PoissonBallon/EasyRealm.git' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { type: 'MIT', file: 'LICENSE' } 27 | s.author = { 'Allan Vialatte' => 'allan.vialatte@icloud.com' } 28 | s.source = { git: 'https://github.com/PoissonBallon/EasyRealm.git', tag: s.version.to_s } 29 | s.social_media_url = 'https://twitter.com/poissonballon' 30 | 31 | 32 | s.ios.deployment_target = '8.0' 33 | s.osx.deployment_target = '10.9' 34 | s.tvos.deployment_target = '9.0' 35 | s.watchos.deployment_target = '2.0' 36 | 37 | s.source_files = 'EasyRealm/Classes/**/*.swift' 38 | s.swift_version = '4.2' 39 | s.dependency 'RealmSwift', '~> 3.10' 40 | end 41 | -------------------------------------------------------------------------------- /EasyRealm.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3B4CBD9B1E8803000044BCAA /* EasyRealm.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B4CBD991E8803000044BCAA /* EasyRealm.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 3B4CBDC11E880B250044BCAA /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B4CBDBB1E8807A20044BCAA /* Realm.framework */; }; 12 | 3B4CBDC21E880B250044BCAA /* RealmSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B4CBDBC1E8807A20044BCAA /* RealmSwift.framework */; }; 13 | 3B4CBDCC1E880B580044BCAA /* EasyRealm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B4CBDC31E880B580044BCAA /* EasyRealm.swift */; }; 14 | 3B760B311EBA8FF50012B56A /* Delete.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B291EBA8FF50012B56A /* Delete.swift */; }; 15 | 3B760B321EBA8FF50012B56A /* Variable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2A1EBA8FF50012B56A /* Variable.swift */; }; 16 | 3B760B331EBA8FF50012B56A /* EasyRealmList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2B1EBA8FF50012B56A /* EasyRealmList.swift */; }; 17 | 3B760B341EBA8FF50012B56A /* EasyRealmQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2C1EBA8FF50012B56A /* EasyRealmQueue.swift */; }; 18 | 3B760B351EBA8FF50012B56A /* Edit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2D1EBA8FF50012B56A /* Edit.swift */; }; 19 | 3B760B361EBA8FF50012B56A /* Save.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2E1EBA8FF50012B56A /* Save.swift */; }; 20 | 3B760B371EBA8FF50012B56A /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B2F1EBA8FF50012B56A /* Error.swift */; }; 21 | 3B760B381EBA8FF50012B56A /* Query.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B760B301EBA8FF50012B56A /* Query.swift */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | 3B4CBD961E8803000044BCAA /* EasyRealm.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EasyRealm.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 3B4CBD991E8803000044BCAA /* EasyRealm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EasyRealm.h; sourceTree = ""; }; 27 | 3B4CBD9A1E8803000044BCAA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | 3B4CBDB51E8806DC0044BCAA /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Realm.framework; path = ../Carthage/Build/iOS/Realm.framework; sourceTree = ""; }; 29 | 3B4CBDB61E8806DC0044BCAA /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RealmSwift.framework; path = ../Carthage/Build/iOS/RealmSwift.framework; sourceTree = ""; }; 30 | 3B4CBDBB1E8807A20044BCAA /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Realm.framework; path = Carthage/Build/iOS/Realm.framework; sourceTree = ""; }; 31 | 3B4CBDBC1E8807A20044BCAA /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RealmSwift.framework; path = Carthage/Build/iOS/RealmSwift.framework; sourceTree = ""; }; 32 | 3B4CBDC31E880B580044BCAA /* EasyRealm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyRealm.swift; sourceTree = ""; }; 33 | 3B760B291EBA8FF50012B56A /* Delete.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Delete.swift; sourceTree = ""; }; 34 | 3B760B2A1EBA8FF50012B56A /* Variable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Variable.swift; sourceTree = ""; }; 35 | 3B760B2B1EBA8FF50012B56A /* EasyRealmList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyRealmList.swift; sourceTree = ""; }; 36 | 3B760B2C1EBA8FF50012B56A /* EasyRealmQueue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyRealmQueue.swift; sourceTree = ""; }; 37 | 3B760B2D1EBA8FF50012B56A /* Edit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Edit.swift; sourceTree = ""; }; 38 | 3B760B2E1EBA8FF50012B56A /* Save.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Save.swift; sourceTree = ""; }; 39 | 3B760B2F1EBA8FF50012B56A /* Error.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Error.swift; sourceTree = ""; }; 40 | 3B760B301EBA8FF50012B56A /* Query.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Query.swift; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 3B4CBD921E8803000044BCAA /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | 3B4CBDC11E880B250044BCAA /* Realm.framework in Frameworks */, 49 | 3B4CBDC21E880B250044BCAA /* RealmSwift.framework in Frameworks */, 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | 3B4CBD8C1E8803000044BCAA = { 57 | isa = PBXGroup; 58 | children = ( 59 | 3B4CBD981E8803000044BCAA /* EasyRealm */, 60 | 3B4CBD971E8803000044BCAA /* Products */, 61 | 3B4CBDB41E8806DC0044BCAA /* Frameworks */, 62 | ); 63 | sourceTree = ""; 64 | }; 65 | 3B4CBD971E8803000044BCAA /* Products */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 3B4CBD961E8803000044BCAA /* EasyRealm.framework */, 69 | ); 70 | name = Products; 71 | sourceTree = ""; 72 | }; 73 | 3B4CBD981E8803000044BCAA /* EasyRealm */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 3B4CBDA11E8803100044BCAA /* Classes */, 77 | 3B4CBD991E8803000044BCAA /* EasyRealm.h */, 78 | 3B4CBD9A1E8803000044BCAA /* Info.plist */, 79 | ); 80 | path = EasyRealm; 81 | sourceTree = ""; 82 | }; 83 | 3B4CBDA11E8803100044BCAA /* Classes */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 3B760B291EBA8FF50012B56A /* Delete.swift */, 87 | 3B760B2A1EBA8FF50012B56A /* Variable.swift */, 88 | 3B760B2B1EBA8FF50012B56A /* EasyRealmList.swift */, 89 | 3B760B2C1EBA8FF50012B56A /* EasyRealmQueue.swift */, 90 | 3B760B2D1EBA8FF50012B56A /* Edit.swift */, 91 | 3B760B2E1EBA8FF50012B56A /* Save.swift */, 92 | 3B760B2F1EBA8FF50012B56A /* Error.swift */, 93 | 3B760B301EBA8FF50012B56A /* Query.swift */, 94 | 3B4CBDC31E880B580044BCAA /* EasyRealm.swift */, 95 | ); 96 | path = Classes; 97 | sourceTree = ""; 98 | }; 99 | 3B4CBDB41E8806DC0044BCAA /* Frameworks */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 3B4CBDBB1E8807A20044BCAA /* Realm.framework */, 103 | 3B4CBDBC1E8807A20044BCAA /* RealmSwift.framework */, 104 | 3B4CBDB51E8806DC0044BCAA /* Realm.framework */, 105 | 3B4CBDB61E8806DC0044BCAA /* RealmSwift.framework */, 106 | ); 107 | name = Frameworks; 108 | sourceTree = ""; 109 | }; 110 | /* End PBXGroup section */ 111 | 112 | /* Begin PBXHeadersBuildPhase section */ 113 | 3B4CBD931E8803000044BCAA /* Headers */ = { 114 | isa = PBXHeadersBuildPhase; 115 | buildActionMask = 2147483647; 116 | files = ( 117 | 3B4CBD9B1E8803000044BCAA /* EasyRealm.h in Headers */, 118 | ); 119 | runOnlyForDeploymentPostprocessing = 0; 120 | }; 121 | /* End PBXHeadersBuildPhase section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | 3B4CBD951E8803000044BCAA /* EasyRealm */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = 3B4CBD9E1E8803000044BCAA /* Build configuration list for PBXNativeTarget "EasyRealm" */; 127 | buildPhases = ( 128 | 3B4CBD921E8803000044BCAA /* Frameworks */, 129 | 3B4CBDB91E8807200044BCAA /* Carthage */, 130 | 3B4CBD911E8803000044BCAA /* Sources */, 131 | 3B4CBD931E8803000044BCAA /* Headers */, 132 | 3B4CBD941E8803000044BCAA /* Resources */, 133 | ); 134 | buildRules = ( 135 | ); 136 | dependencies = ( 137 | ); 138 | name = EasyRealm; 139 | productName = EasyRealm; 140 | productReference = 3B4CBD961E8803000044BCAA /* EasyRealm.framework */; 141 | productType = "com.apple.product-type.framework"; 142 | }; 143 | /* End PBXNativeTarget section */ 144 | 145 | /* Begin PBXProject section */ 146 | 3B4CBD8D1E8803000044BCAA /* Project object */ = { 147 | isa = PBXProject; 148 | attributes = { 149 | LastUpgradeCheck = 0820; 150 | ORGANIZATIONNAME = "Allan Vialatte"; 151 | TargetAttributes = { 152 | 3B4CBD951E8803000044BCAA = { 153 | CreatedOnToolsVersion = 8.2; 154 | LastSwiftMigration = 0820; 155 | ProvisioningStyle = Automatic; 156 | }; 157 | }; 158 | }; 159 | buildConfigurationList = 3B4CBD901E8803000044BCAA /* Build configuration list for PBXProject "EasyRealm" */; 160 | compatibilityVersion = "Xcode 3.2"; 161 | developmentRegion = English; 162 | hasScannedForEncodings = 0; 163 | knownRegions = ( 164 | en, 165 | ); 166 | mainGroup = 3B4CBD8C1E8803000044BCAA; 167 | productRefGroup = 3B4CBD971E8803000044BCAA /* Products */; 168 | projectDirPath = ""; 169 | projectRoot = ""; 170 | targets = ( 171 | 3B4CBD951E8803000044BCAA /* EasyRealm */, 172 | ); 173 | }; 174 | /* End PBXProject section */ 175 | 176 | /* Begin PBXResourcesBuildPhase section */ 177 | 3B4CBD941E8803000044BCAA /* Resources */ = { 178 | isa = PBXResourcesBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | /* End PBXResourcesBuildPhase section */ 185 | 186 | /* Begin PBXShellScriptBuildPhase section */ 187 | 3B4CBDB91E8807200044BCAA /* Carthage */ = { 188 | isa = PBXShellScriptBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | ); 192 | inputPaths = ( 193 | ); 194 | name = Carthage; 195 | outputPaths = ( 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | shellPath = /bin/sh; 199 | shellScript = "/usr/local/bin/carthage copy-frameworks\n"; 200 | }; 201 | /* End PBXShellScriptBuildPhase section */ 202 | 203 | /* Begin PBXSourcesBuildPhase section */ 204 | 3B4CBD911E8803000044BCAA /* Sources */ = { 205 | isa = PBXSourcesBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | 3B4CBDCC1E880B580044BCAA /* EasyRealm.swift in Sources */, 209 | 3B760B351EBA8FF50012B56A /* Edit.swift in Sources */, 210 | 3B760B331EBA8FF50012B56A /* EasyRealmList.swift in Sources */, 211 | 3B760B311EBA8FF50012B56A /* Delete.swift in Sources */, 212 | 3B760B361EBA8FF50012B56A /* Save.swift in Sources */, 213 | 3B760B341EBA8FF50012B56A /* EasyRealmQueue.swift in Sources */, 214 | 3B760B381EBA8FF50012B56A /* Query.swift in Sources */, 215 | 3B760B371EBA8FF50012B56A /* Error.swift in Sources */, 216 | 3B760B321EBA8FF50012B56A /* Variable.swift in Sources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXSourcesBuildPhase section */ 221 | 222 | /* Begin XCBuildConfiguration section */ 223 | 3B4CBD9C1E8803000044BCAA /* Debug */ = { 224 | isa = XCBuildConfiguration; 225 | buildSettings = { 226 | ALWAYS_SEARCH_USER_PATHS = NO; 227 | CLANG_ANALYZER_NONNULL = YES; 228 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 229 | CLANG_CXX_LIBRARY = "libc++"; 230 | CLANG_ENABLE_MODULES = YES; 231 | CLANG_ENABLE_OBJC_ARC = YES; 232 | CLANG_WARN_BOOL_CONVERSION = YES; 233 | CLANG_WARN_CONSTANT_CONVERSION = YES; 234 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 235 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 236 | CLANG_WARN_EMPTY_BODY = YES; 237 | CLANG_WARN_ENUM_CONVERSION = YES; 238 | CLANG_WARN_INFINITE_RECURSION = YES; 239 | CLANG_WARN_INT_CONVERSION = YES; 240 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 241 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 242 | CLANG_WARN_UNREACHABLE_CODE = YES; 243 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 244 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 245 | COPY_PHASE_STRIP = NO; 246 | CURRENT_PROJECT_VERSION = 1; 247 | DEBUG_INFORMATION_FORMAT = dwarf; 248 | ENABLE_STRICT_OBJC_MSGSEND = YES; 249 | ENABLE_TESTABILITY = YES; 250 | GCC_C_LANGUAGE_STANDARD = gnu99; 251 | GCC_DYNAMIC_NO_PIC = NO; 252 | GCC_NO_COMMON_BLOCKS = YES; 253 | GCC_OPTIMIZATION_LEVEL = 0; 254 | GCC_PREPROCESSOR_DEFINITIONS = ( 255 | "DEBUG=1", 256 | "$(inherited)", 257 | ); 258 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 259 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 260 | GCC_WARN_UNDECLARED_SELECTOR = YES; 261 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 262 | GCC_WARN_UNUSED_FUNCTION = YES; 263 | GCC_WARN_UNUSED_VARIABLE = YES; 264 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 265 | MTL_ENABLE_DEBUG_INFO = YES; 266 | ONLY_ACTIVE_ARCH = YES; 267 | SDKROOT = iphoneos; 268 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 269 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 270 | TARGETED_DEVICE_FAMILY = "1,2"; 271 | VERSIONING_SYSTEM = "apple-generic"; 272 | VERSION_INFO_PREFIX = ""; 273 | }; 274 | name = Debug; 275 | }; 276 | 3B4CBD9D1E8803000044BCAA /* Release */ = { 277 | isa = XCBuildConfiguration; 278 | buildSettings = { 279 | ALWAYS_SEARCH_USER_PATHS = NO; 280 | CLANG_ANALYZER_NONNULL = YES; 281 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 282 | CLANG_CXX_LIBRARY = "libc++"; 283 | CLANG_ENABLE_MODULES = YES; 284 | CLANG_ENABLE_OBJC_ARC = YES; 285 | CLANG_WARN_BOOL_CONVERSION = YES; 286 | CLANG_WARN_CONSTANT_CONVERSION = YES; 287 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 288 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 289 | CLANG_WARN_EMPTY_BODY = YES; 290 | CLANG_WARN_ENUM_CONVERSION = YES; 291 | CLANG_WARN_INFINITE_RECURSION = YES; 292 | CLANG_WARN_INT_CONVERSION = YES; 293 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 294 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 295 | CLANG_WARN_UNREACHABLE_CODE = YES; 296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 298 | COPY_PHASE_STRIP = NO; 299 | CURRENT_PROJECT_VERSION = 1; 300 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 301 | ENABLE_NS_ASSERTIONS = NO; 302 | ENABLE_STRICT_OBJC_MSGSEND = YES; 303 | GCC_C_LANGUAGE_STANDARD = gnu99; 304 | GCC_NO_COMMON_BLOCKS = YES; 305 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 306 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 307 | GCC_WARN_UNDECLARED_SELECTOR = YES; 308 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 309 | GCC_WARN_UNUSED_FUNCTION = YES; 310 | GCC_WARN_UNUSED_VARIABLE = YES; 311 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 312 | MTL_ENABLE_DEBUG_INFO = NO; 313 | SDKROOT = iphoneos; 314 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 315 | TARGETED_DEVICE_FAMILY = "1,2"; 316 | VALIDATE_PRODUCT = YES; 317 | VERSIONING_SYSTEM = "apple-generic"; 318 | VERSION_INFO_PREFIX = ""; 319 | }; 320 | name = Release; 321 | }; 322 | 3B4CBD9F1E8803000044BCAA /* Debug */ = { 323 | isa = XCBuildConfiguration; 324 | buildSettings = { 325 | CLANG_ENABLE_MODULES = YES; 326 | CODE_SIGN_IDENTITY = ""; 327 | DEFINES_MODULE = YES; 328 | DYLIB_COMPATIBILITY_VERSION = 1; 329 | DYLIB_CURRENT_VERSION = 1; 330 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 331 | FRAMEWORK_SEARCH_PATHS = ( 332 | "$(inherited)", 333 | "$(PROJECT_DIR)/Carthage/Build/iOS", 334 | ); 335 | INFOPLIST_FILE = EasyRealm/Info.plist; 336 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 337 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 338 | PRODUCT_BUNDLE_IDENTIFIER = vialatte.EasyRealm; 339 | PRODUCT_NAME = "$(TARGET_NAME)"; 340 | SKIP_INSTALL = YES; 341 | SWIFT_VERSION = 4.0; 342 | }; 343 | name = Debug; 344 | }; 345 | 3B4CBDA01E8803000044BCAA /* Release */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | CLANG_ENABLE_MODULES = YES; 349 | CODE_SIGN_IDENTITY = ""; 350 | DEFINES_MODULE = YES; 351 | DYLIB_COMPATIBILITY_VERSION = 1; 352 | DYLIB_CURRENT_VERSION = 1; 353 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 354 | FRAMEWORK_SEARCH_PATHS = ( 355 | "$(inherited)", 356 | "$(PROJECT_DIR)/Carthage/Build/iOS", 357 | ); 358 | INFOPLIST_FILE = EasyRealm/Info.plist; 359 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 360 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 361 | PRODUCT_BUNDLE_IDENTIFIER = vialatte.EasyRealm; 362 | PRODUCT_NAME = "$(TARGET_NAME)"; 363 | SKIP_INSTALL = YES; 364 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 365 | SWIFT_VERSION = 4.0; 366 | }; 367 | name = Release; 368 | }; 369 | /* End XCBuildConfiguration section */ 370 | 371 | /* Begin XCConfigurationList section */ 372 | 3B4CBD901E8803000044BCAA /* Build configuration list for PBXProject "EasyRealm" */ = { 373 | isa = XCConfigurationList; 374 | buildConfigurations = ( 375 | 3B4CBD9C1E8803000044BCAA /* Debug */, 376 | 3B4CBD9D1E8803000044BCAA /* Release */, 377 | ); 378 | defaultConfigurationIsVisible = 0; 379 | defaultConfigurationName = Release; 380 | }; 381 | 3B4CBD9E1E8803000044BCAA /* Build configuration list for PBXNativeTarget "EasyRealm" */ = { 382 | isa = XCConfigurationList; 383 | buildConfigurations = ( 384 | 3B4CBD9F1E8803000044BCAA /* Debug */, 385 | 3B4CBDA01E8803000044BCAA /* Release */, 386 | ); 387 | defaultConfigurationIsVisible = 0; 388 | defaultConfigurationName = Release; 389 | }; 390 | /* End XCConfigurationList section */ 391 | }; 392 | rootObject = 3B4CBD8D1E8803000044BCAA /* Project object */; 393 | } 394 | -------------------------------------------------------------------------------- /EasyRealm.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /EasyRealm.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /EasyRealm.xcodeproj/xcshareddata/xcschemes/EasyRealm.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /EasyRealm/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PoissonBallon/EasyRealm/0e5005ac0f92213f438a6ba8d7d53ce4d4457ecb/EasyRealm/Assets/.gitkeep -------------------------------------------------------------------------------- /EasyRealm/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PoissonBallon/EasyRealm/0e5005ac0f92213f438a6ba8d7d53ce4d4457ecb/EasyRealm/Classes/.gitkeep -------------------------------------------------------------------------------- /EasyRealm/Classes/Delete.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ER_Delete.swift 3 | // Pods 4 | // 5 | // Created by Allan Vialatte on 23/11/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | import Realm 11 | import RealmSwift 12 | 13 | public enum EasyRealmDeleteMethod { 14 | case simple 15 | case cascade 16 | } 17 | 18 | public extension EasyRealmStatic where T:Object { 19 | 20 | public func deleteAll() throws { 21 | let realm = try Realm() 22 | try realm.write { 23 | realm.delete(realm.objects(self.baseType)) 24 | } 25 | } 26 | 27 | } 28 | 29 | public extension EasyRealm where T:Object { 30 | 31 | public func delete(with method:EasyRealmDeleteMethod = .simple) throws { 32 | switch method { 33 | case .simple: self.isManaged ? try managedSimpleDelete() : try unmanagedSimpleDelete() 34 | case .cascade: self.isManaged ? try managedCascadeDelete() : try unmanagedCascadeDelete() 35 | } 36 | } 37 | 38 | } 39 | 40 | 41 | 42 | //Normal Way 43 | fileprivate extension EasyRealm where T: Object { 44 | 45 | fileprivate func managedSimpleDelete() throws { 46 | guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } 47 | let ref = ThreadSafeReference(to: self.base) 48 | try rq.queue.sync { 49 | guard let object = rq.realm.resolve(ref) else { throw EasyRealmError.ObjectCantBeResolved } 50 | try rq.realm.write { 51 | EasyRealm.simpleDelete(this: object, in: rq) 52 | } 53 | } 54 | } 55 | 56 | fileprivate func unmanagedSimpleDelete() throws { 57 | guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } 58 | guard let key = T.primaryKey() else { throw EasyRealmError.ObjectCantBeResolved } 59 | 60 | try rq.queue.sync { 61 | let value = self.base.value(forKey: key) 62 | if let object = rq.realm.object(ofType: T.self, forPrimaryKey: value) { 63 | try rq.realm.write { 64 | EasyRealm.simpleDelete(this: object, in: rq) 65 | } 66 | } 67 | } 68 | } 69 | 70 | fileprivate static func simpleDelete(this object:Object, in queue:EasyRealmQueue) { 71 | queue.realm.delete(object) 72 | } 73 | 74 | 75 | } 76 | 77 | //Cascade Way 78 | fileprivate extension EasyRealm where T: Object { 79 | 80 | fileprivate func managedCascadeDelete() throws { 81 | guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } 82 | let ref = ThreadSafeReference(to: self.base) 83 | try rq.queue.sync { 84 | guard let object = rq.realm.resolve(ref) else { throw EasyRealmError.ObjectCantBeResolved } 85 | try rq.realm.write { 86 | EasyRealm.cascadeDelete(this: object, in: rq) 87 | } 88 | } 89 | } 90 | 91 | fileprivate func unmanagedCascadeDelete() throws { 92 | guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } 93 | guard let key = T.primaryKey() else { throw EasyRealmError.ObjectCantBeResolved } 94 | 95 | try rq.queue.sync { 96 | let value = self.base.value(forKey: key) 97 | if let object = rq.realm.object(ofType: T.self, forPrimaryKey: value) { 98 | try rq.realm.write { 99 | EasyRealm.cascadeDelete(this: object, in: rq) 100 | } 101 | } 102 | } 103 | } 104 | 105 | 106 | fileprivate static func cascadeDelete(this object:Object, in queue:EasyRealmQueue) { 107 | for property in object.objectSchema.properties { 108 | guard let value = object.value(forKey: property.name) else { continue } 109 | if let object = value as? Object { 110 | EasyRealm.cascadeDelete(this: object, in: queue) 111 | } 112 | if let list = value as? EasyRealmList { 113 | list.children().forEach { 114 | EasyRealm.cascadeDelete(this: $0, in: queue) 115 | } 116 | } 117 | } 118 | queue.realm.delete(object) 119 | } 120 | 121 | } 122 | 123 | -------------------------------------------------------------------------------- /EasyRealm/Classes/EasyRealm.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EasyRealm.swift 3 | // Pods 4 | // 5 | // Created by Allan Vialatte on 23/11/16. 6 | // 7 | // 8 | 9 | import RealmSwift 10 | 11 | 12 | public final class EasyRealm { 13 | internal var base: T 14 | 15 | public init(_ instance: T) { 16 | self.base = instance 17 | } 18 | } 19 | 20 | public final class EasyRealmStatic { 21 | internal var baseType:T.Type 22 | 23 | public init(_ instance: T.Type) { 24 | self.baseType = instance 25 | } 26 | } 27 | 28 | public protocol EasyRealmCompatible { 29 | associatedtype CompatibleType 30 | var er: EasyRealm { get } 31 | static var er: EasyRealmStatic { get } 32 | } 33 | 34 | public extension EasyRealmCompatible { 35 | public var er: EasyRealm { 36 | get { return EasyRealm(self) } 37 | } 38 | public static var er: EasyRealmStatic { 39 | get { return EasyRealmStatic(Self.self) } 40 | } 41 | } 42 | 43 | 44 | extension Object:EasyRealmCompatible {} 45 | -------------------------------------------------------------------------------- /EasyRealm/Classes/EasyRealmList.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EasyRealmList.swift 3 | // Pods 4 | // 5 | // Created by Allan Vialatte on 01/05/2017. 6 | // 7 | // 8 | 9 | import Foundation 10 | import RealmSwift 11 | 12 | 13 | internal protocol EasyRealmList { 14 | func children() -> [Object] 15 | } 16 | 17 | extension List:EasyRealmList { 18 | internal func children() -> [Object] { 19 | return self.compactMap { return $0 as? Object } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRealm/Classes/EasyRealmQueue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EasyRealmCore.swift 3 | // Pods 4 | // 5 | // Created by Allan Vialatte on 17/02/2017. 6 | // 7 | // 8 | 9 | import Foundation 10 | import RealmSwift 11 | 12 | 13 | internal struct EasyRealmQueue { 14 | let realm:Realm 15 | let queue:DispatchQueue 16 | 17 | init?() { 18 | queue = DispatchQueue(label: UUID().uuidString) 19 | var tmp:Realm? = nil 20 | queue.sync { tmp = try? Realm() } 21 | guard let valid = tmp else { return nil } 22 | self.realm = valid 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /EasyRealm/Classes/Edit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ER_Edit.swift 3 | // Pods 4 | // 5 | // Created by Allan Vialatte on 23/11/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | import Realm 11 | import RealmSwift 12 | 13 | extension EasyRealm where T:Object { 14 | 15 | public func edit(_ closure: @escaping (_ T:T) -> Void) throws { 16 | self.isManaged ? try managed_edit(closure) : try unmanaged_dit(closure) 17 | } 18 | 19 | } 20 | 21 | 22 | fileprivate extension EasyRealm where T:Object { 23 | 24 | fileprivate func managed_edit(_ closure: @escaping (_ T:T) -> Void) throws { 25 | guard let rq = EasyRealmQueue() else { throw EasyRealmError.RealmQueueCantBeCreate } 26 | let ref = ThreadSafeReference(to: self.base) 27 | try rq.queue.sync { 28 | guard let object = rq.realm.resolve(ref) else { throw EasyRealmError.ObjectCantBeResolved } 29 | try rq.realm.write { closure(object) } 30 | } 31 | } 32 | 33 | fileprivate func unmanaged_dit(_ closure: @escaping (_ T:T) -> Void) throws { 34 | closure(self.base) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /EasyRealm/Classes/Error.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ER_Error.swift 3 | // Pods 4 | // 5 | // Created by Allan Vialatte on 17/02/2017. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | public enum EasyRealmError: Error { 12 | case RealmQueueCantBeCreate 13 | case ObjectCantBeResolved 14 | case ObjectHaveNotPrimaryKey 15 | case ObjectWithPrimaryKeyNotFound 16 | case ManagedVersionOfObjectDoesntExist 17 | } 18 | -------------------------------------------------------------------------------- /EasyRealm/Classes/Query.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ER_Query.swift 3 | // Pods 4 | // 5 | // Created by Allan Vialatte on 05/03/2017. 6 | // 7 | // 8 | 9 | import Foundation 10 | import RealmSwift 11 | 12 | public extension EasyRealmStatic where T:Object { 13 | 14 | public func fromRealm(with primaryKey:K) throws -> T { 15 | let realm = try Realm() 16 | if let object = realm.object(ofType: self.baseType, forPrimaryKey: primaryKey) { 17 | return object 18 | } else { 19 | throw EasyRealmError.ObjectWithPrimaryKeyNotFound 20 | } 21 | } 22 | 23 | public func all() throws -> Results { 24 | let realm = try Realm() 25 | return realm.objects(self.baseType) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /EasyRealm/Classes/Save.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ER_Save.swift 3 | // Pods 4 | // 5 | // Created by Allan Vialatte on 23/11/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | import RealmSwift 11 | 12 | extension EasyRealm where T:Object { 13 | 14 | public func save(update:Bool = false) throws { 15 | let _ = try self.saved(update: update) 16 | } 17 | 18 | public func saved(update:Bool = false) throws -> T { 19 | return (self.isManaged) ? try managed_save(update: update) : try unmanaged_save(update: update) 20 | } 21 | 22 | public func update() throws { 23 | let _ = (self.isManaged) ? try managed_save(update: true) : try unmanaged_save(update: true) 24 | } 25 | 26 | } 27 | 28 | fileprivate extension EasyRealm where T: Object { 29 | 30 | fileprivate func managed_save(update:Bool) throws -> T { 31 | let ref = ThreadSafeReference(to: self.base) 32 | guard let rq = EasyRealmQueue() else { 33 | throw EasyRealmError.RealmQueueCantBeCreate 34 | } 35 | return try rq.queue.sync { 36 | guard let object = rq.realm.resolve(ref) else { throw EasyRealmError.ObjectCantBeResolved } 37 | rq.realm.beginWrite() 38 | let ret = rq.realm.create(T.self, value: object, update: update) 39 | try rq.realm.commitWrite() 40 | return ret 41 | } 42 | } 43 | 44 | fileprivate func unmanaged_save(update:Bool) throws -> T { 45 | let realm = try Realm() 46 | realm.beginWrite() 47 | let ret = realm.create(T.self, value: self.base, update: update) 48 | try realm.commitWrite() 49 | return ret 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /EasyRealm/Classes/Variable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ER_Variable.swift 3 | // Pods 4 | // 5 | // Created by Allan Vialatte on 05/03/2017. 6 | // 7 | 8 | import Foundation 9 | import Realm 10 | import RealmSwift 11 | 12 | extension EasyRealm where T: Object { 13 | 14 | public var isManaged: Bool { 15 | return (self.base.realm != nil) 16 | } 17 | 18 | public var managed: T? { 19 | guard let realm = try? Realm(), let key = T.primaryKey() else { return nil } 20 | let object = realm.object(ofType: T.self, forPrimaryKey: self.base.value(forKey: key)) 21 | return object 22 | } 23 | 24 | public var unmanaged:T { 25 | return self.base.easyDetached() 26 | } 27 | 28 | func detached() -> T { 29 | return self.base.easyDetached() 30 | } 31 | } 32 | 33 | 34 | fileprivate extension Object { 35 | fileprivate func easyDetached() -> Self { 36 | let detached = type(of: self).init() 37 | for property in objectSchema.properties { 38 | guard let value = value(forKey: property.name) else { continue } 39 | if let detachable = value as? Object { 40 | detached.setValue(detachable.easyDetached(), forKey: property.name) 41 | } else if let detachable = value as? EasyRealmList { 42 | detached.setValue(detachable.children().compactMap { $0.easyDetached() },forKey: property.name) 43 | } else { 44 | detached.setValue(value, forKey: property.name) 45 | } 46 | } 47 | return detached 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /EasyRealm/EasyRealm.h: -------------------------------------------------------------------------------- 1 | // 2 | // EasyRealm.h 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 26/03/2017. 6 | // Copyright © 2017 Allan Vialatte. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for EasyRealm. 12 | FOUNDATION_EXPORT double EasyRealmVersionNumber; 13 | 14 | //! Project version string for EasyRealm. 15 | FOUNDATION_EXPORT const unsigned char EasyRealmVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /EasyRealm/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/EasyRealm.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3B27B1C91EBDDE30008BF579 /* TestQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B27B1C81EBDDE30008BF579 /* TestQuery.swift */; }; 11 | 3B7956D122170A0C00246717 /* TestUpdate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7956CF221709E000246717 /* TestUpdate.swift */; }; 12 | 3B7CD02B1E76DFAF00011116 /* Pokemon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD01E1E76DF6400011116 /* Pokemon.swift */; }; 13 | 3B7CD02C1E76DFAF00011116 /* PokemonHelp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD01F1E76DF6400011116 /* PokemonHelp.swift */; }; 14 | 3B7CD02D1E76DFAF00011116 /* TestDelete.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD0201E76DF6400011116 /* TestDelete.swift */; }; 15 | 3B7CD02E1E76DFAF00011116 /* TestEdit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD0211E76DF6400011116 /* TestEdit.swift */; }; 16 | 3B7CD02F1E76DFAF00011116 /* TestSave.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD0221E76DF6400011116 /* TestSave.swift */; }; 17 | 3B7CD0301E76DFAF00011116 /* TestVariable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B7CD0231E76DF6400011116 /* TestVariable.swift */; }; 18 | 3BBFC7611EB7AE3A0003B466 /* TestMeasure.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BBFC7601EB7AE3A0003B466 /* TestMeasure.swift */; }; 19 | 3BC33AF61EAB98930019E72C /* Trainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BC33AF41EAB98930019E72C /* Trainer.swift */; }; 20 | 3BC33AFA1EAB98F70019E72C /* Pokedex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BC33AF81EAB98F70019E72C /* Pokedex.swift */; }; 21 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 22 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 23 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 24 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 25 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 26 | 7A0176CE0868DE2CDA9E6587 /* Pods_EasyRealm_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD2EF73E42A8D43D39780307 /* Pods_EasyRealm_Example.framework */; }; 27 | 95B8589827346242E7A2141E /* Pods_EasyRealm_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 467AB1A027915AF4125C6A80 /* Pods_EasyRealm_Tests.framework */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXContainerItemProxy section */ 31 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 36 | remoteInfo = EasyRealm; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 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 = ""; }; 42 | 0A4DA23DD187DD2E8EEA00C8 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 43 | 3B27B1C81EBDDE30008BF579 /* TestQuery.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestQuery.swift; sourceTree = ""; }; 44 | 3B7956CF221709E000246717 /* TestUpdate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestUpdate.swift; sourceTree = ""; }; 45 | 3B7CD01E1E76DF6400011116 /* Pokemon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pokemon.swift; sourceTree = ""; }; 46 | 3B7CD01F1E76DF6400011116 /* PokemonHelp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PokemonHelp.swift; sourceTree = ""; }; 47 | 3B7CD0201E76DF6400011116 /* TestDelete.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestDelete.swift; sourceTree = ""; }; 48 | 3B7CD0211E76DF6400011116 /* TestEdit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEdit.swift; sourceTree = ""; }; 49 | 3B7CD0221E76DF6400011116 /* TestSave.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestSave.swift; sourceTree = ""; }; 50 | 3B7CD0231E76DF6400011116 /* TestVariable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestVariable.swift; sourceTree = ""; }; 51 | 3BBFC7601EB7AE3A0003B466 /* TestMeasure.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestMeasure.swift; sourceTree = ""; }; 52 | 3BC33AF41EAB98930019E72C /* Trainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Trainer.swift; sourceTree = ""; }; 53 | 3BC33AF81EAB98F70019E72C /* Pokedex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pokedex.swift; sourceTree = ""; }; 54 | 467AB1A027915AF4125C6A80 /* Pods_EasyRealm_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EasyRealm_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 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 = ""; }; 56 | 607FACD01AFB9204008FA782 /* EasyRealm_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EasyRealm_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 59 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 60 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 61 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 62 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 63 | 607FACE51AFB9204008FA782 /* EasyRealm_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EasyRealm_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65 | 962F9CCB6FC7DAF0C47B9A39 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 66 | 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 = ""; }; 67 | CEE03CDEB69479C449935B09 /* EasyRealm.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = EasyRealm.podspec; path = ../EasyRealm.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 68 | DD2EF73E42A8D43D39780307 /* Pods_EasyRealm_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EasyRealm_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | 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 = ""; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 7A0176CE0868DE2CDA9E6587 /* Pods_EasyRealm_Example.framework in Frameworks */, 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 82 | isa = PBXFrameworksBuildPhase; 83 | buildActionMask = 2147483647; 84 | files = ( 85 | 95B8589827346242E7A2141E /* Pods_EasyRealm_Tests.framework in Frameworks */, 86 | ); 87 | runOnlyForDeploymentPostprocessing = 0; 88 | }; 89 | /* End PBXFrameworksBuildPhase section */ 90 | 91 | /* Begin PBXGroup section */ 92 | 607FACC71AFB9204008FA782 = { 93 | isa = PBXGroup; 94 | children = ( 95 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 96 | 607FACD21AFB9204008FA782 /* Example for EasyRealm */, 97 | 607FACE81AFB9204008FA782 /* Tests */, 98 | 607FACD11AFB9204008FA782 /* Products */, 99 | E379C712C20BF558D7C530B0 /* Pods */, 100 | D6FD36A88B40A890865461C3 /* Frameworks */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | 607FACD11AFB9204008FA782 /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 607FACD01AFB9204008FA782 /* EasyRealm_Example.app */, 108 | 607FACE51AFB9204008FA782 /* EasyRealm_Tests.xctest */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 607FACD21AFB9204008FA782 /* Example for EasyRealm */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 117 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 118 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 119 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 120 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 121 | 607FACD31AFB9204008FA782 /* Supporting Files */, 122 | ); 123 | name = "Example for EasyRealm"; 124 | path = EasyRealm; 125 | sourceTree = ""; 126 | }; 127 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 607FACD41AFB9204008FA782 /* Info.plist */, 131 | ); 132 | name = "Supporting Files"; 133 | sourceTree = ""; 134 | }; 135 | 607FACE81AFB9204008FA782 /* Tests */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 3BC33AF41EAB98930019E72C /* Trainer.swift */, 139 | 3BC33AF81EAB98F70019E72C /* Pokedex.swift */, 140 | 3B7CD01E1E76DF6400011116 /* Pokemon.swift */, 141 | 3B7CD01F1E76DF6400011116 /* PokemonHelp.swift */, 142 | 3B7CD0201E76DF6400011116 /* TestDelete.swift */, 143 | 3B27B1C81EBDDE30008BF579 /* TestQuery.swift */, 144 | 3B7CD0211E76DF6400011116 /* TestEdit.swift */, 145 | 3B7CD0221E76DF6400011116 /* TestSave.swift */, 146 | 3B7956CF221709E000246717 /* TestUpdate.swift */, 147 | 3B7CD0231E76DF6400011116 /* TestVariable.swift */, 148 | 3BBFC7601EB7AE3A0003B466 /* TestMeasure.swift */, 149 | 607FACE91AFB9204008FA782 /* Supporting Files */, 150 | ); 151 | path = Tests; 152 | sourceTree = ""; 153 | }; 154 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 607FACEA1AFB9204008FA782 /* Info.plist */, 158 | ); 159 | name = "Supporting Files"; 160 | sourceTree = ""; 161 | }; 162 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | CEE03CDEB69479C449935B09 /* EasyRealm.podspec */, 166 | 962F9CCB6FC7DAF0C47B9A39 /* README.md */, 167 | 0A4DA23DD187DD2E8EEA00C8 /* LICENSE */, 168 | ); 169 | name = "Podspec Metadata"; 170 | sourceTree = ""; 171 | }; 172 | D6FD36A88B40A890865461C3 /* Frameworks */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | DD2EF73E42A8D43D39780307 /* Pods_EasyRealm_Example.framework */, 176 | 467AB1A027915AF4125C6A80 /* Pods_EasyRealm_Tests.framework */, 177 | ); 178 | name = Frameworks; 179 | sourceTree = ""; 180 | }; 181 | E379C712C20BF558D7C530B0 /* Pods */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | ED34CAE00F1E0583F8416DB8 /* Pods-EasyRealm_Example.debug.xcconfig */, 185 | 061E59C21F2F2720DFCDC799 /* Pods-EasyRealm_Example.release.xcconfig */, 186 | 5AC0DD2B71C5BD7C3E4B045D /* Pods-EasyRealm_Tests.debug.xcconfig */, 187 | B6C45787A877C3285FE205B0 /* Pods-EasyRealm_Tests.release.xcconfig */, 188 | ); 189 | name = Pods; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXGroup section */ 193 | 194 | /* Begin PBXNativeTarget section */ 195 | 607FACCF1AFB9204008FA782 /* EasyRealm_Example */ = { 196 | isa = PBXNativeTarget; 197 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "EasyRealm_Example" */; 198 | buildPhases = ( 199 | 1AFB4B2777294C8EFD045DB3 /* [CP] Check Pods Manifest.lock */, 200 | 607FACCC1AFB9204008FA782 /* Sources */, 201 | 607FACCD1AFB9204008FA782 /* Frameworks */, 202 | 607FACCE1AFB9204008FA782 /* Resources */, 203 | 8584362E4784F814598805E0 /* [CP] Embed Pods Frameworks */, 204 | ); 205 | buildRules = ( 206 | ); 207 | dependencies = ( 208 | ); 209 | name = EasyRealm_Example; 210 | productName = EasyRealm; 211 | productReference = 607FACD01AFB9204008FA782 /* EasyRealm_Example.app */; 212 | productType = "com.apple.product-type.application"; 213 | }; 214 | 607FACE41AFB9204008FA782 /* EasyRealm_Tests */ = { 215 | isa = PBXNativeTarget; 216 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "EasyRealm_Tests" */; 217 | buildPhases = ( 218 | 8B9E29F1A378E57DB2A2813E /* [CP] Check Pods Manifest.lock */, 219 | 607FACE11AFB9204008FA782 /* Sources */, 220 | 607FACE21AFB9204008FA782 /* Frameworks */, 221 | 607FACE31AFB9204008FA782 /* Resources */, 222 | ); 223 | buildRules = ( 224 | ); 225 | dependencies = ( 226 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 227 | ); 228 | name = EasyRealm_Tests; 229 | productName = Tests; 230 | productReference = 607FACE51AFB9204008FA782 /* EasyRealm_Tests.xctest */; 231 | productType = "com.apple.product-type.bundle.unit-test"; 232 | }; 233 | /* End PBXNativeTarget section */ 234 | 235 | /* Begin PBXProject section */ 236 | 607FACC81AFB9204008FA782 /* Project object */ = { 237 | isa = PBXProject; 238 | attributes = { 239 | LastSwiftUpdateCheck = 0720; 240 | LastUpgradeCheck = 1010; 241 | ORGANIZATIONNAME = CocoaPods; 242 | TargetAttributes = { 243 | 607FACCF1AFB9204008FA782 = { 244 | CreatedOnToolsVersion = 6.3.1; 245 | LastSwiftMigration = 0820; 246 | ProvisioningStyle = Manual; 247 | }; 248 | 607FACE41AFB9204008FA782 = { 249 | CreatedOnToolsVersion = 6.3.1; 250 | LastSwiftMigration = 1010; 251 | ProvisioningStyle = Manual; 252 | TestTargetID = 607FACCF1AFB9204008FA782; 253 | }; 254 | }; 255 | }; 256 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "EasyRealm" */; 257 | compatibilityVersion = "Xcode 3.2"; 258 | developmentRegion = English; 259 | hasScannedForEncodings = 0; 260 | knownRegions = ( 261 | en, 262 | Base, 263 | ); 264 | mainGroup = 607FACC71AFB9204008FA782; 265 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 266 | projectDirPath = ""; 267 | projectRoot = ""; 268 | targets = ( 269 | 607FACCF1AFB9204008FA782 /* EasyRealm_Example */, 270 | 607FACE41AFB9204008FA782 /* EasyRealm_Tests */, 271 | ); 272 | }; 273 | /* End PBXProject section */ 274 | 275 | /* Begin PBXResourcesBuildPhase section */ 276 | 607FACCE1AFB9204008FA782 /* Resources */ = { 277 | isa = PBXResourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 281 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 282 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | 607FACE31AFB9204008FA782 /* Resources */ = { 287 | isa = PBXResourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | /* End PBXResourcesBuildPhase section */ 294 | 295 | /* Begin PBXShellScriptBuildPhase section */ 296 | 1AFB4B2777294C8EFD045DB3 /* [CP] Check Pods Manifest.lock */ = { 297 | isa = PBXShellScriptBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | inputPaths = ( 302 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 303 | "${PODS_ROOT}/Manifest.lock", 304 | ); 305 | name = "[CP] Check Pods Manifest.lock"; 306 | outputPaths = ( 307 | "$(DERIVED_FILE_DIR)/Pods-EasyRealm_Example-checkManifestLockResult.txt", 308 | ); 309 | runOnlyForDeploymentPostprocessing = 0; 310 | shellPath = /bin/sh; 311 | 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"; 312 | showEnvVarsInLog = 0; 313 | }; 314 | 8584362E4784F814598805E0 /* [CP] Embed Pods Frameworks */ = { 315 | isa = PBXShellScriptBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | ); 319 | inputPaths = ( 320 | "${SRCROOT}/Pods/Target Support Files/Pods-EasyRealm_Example/Pods-EasyRealm_Example-frameworks.sh", 321 | "${BUILT_PRODUCTS_DIR}/EasyRealm/EasyRealm.framework", 322 | "${BUILT_PRODUCTS_DIR}/Realm/Realm.framework", 323 | "${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework", 324 | ); 325 | name = "[CP] Embed Pods Frameworks"; 326 | outputPaths = ( 327 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/EasyRealm.framework", 328 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework", 329 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework", 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | shellPath = /bin/sh; 333 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-EasyRealm_Example/Pods-EasyRealm_Example-frameworks.sh\"\n"; 334 | showEnvVarsInLog = 0; 335 | }; 336 | 8B9E29F1A378E57DB2A2813E /* [CP] Check Pods Manifest.lock */ = { 337 | isa = PBXShellScriptBuildPhase; 338 | buildActionMask = 2147483647; 339 | files = ( 340 | ); 341 | inputPaths = ( 342 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 343 | "${PODS_ROOT}/Manifest.lock", 344 | ); 345 | name = "[CP] Check Pods Manifest.lock"; 346 | outputPaths = ( 347 | "$(DERIVED_FILE_DIR)/Pods-EasyRealm_Tests-checkManifestLockResult.txt", 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | shellPath = /bin/sh; 351 | 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"; 352 | showEnvVarsInLog = 0; 353 | }; 354 | /* End PBXShellScriptBuildPhase section */ 355 | 356 | /* Begin PBXSourcesBuildPhase section */ 357 | 607FACCC1AFB9204008FA782 /* Sources */ = { 358 | isa = PBXSourcesBuildPhase; 359 | buildActionMask = 2147483647; 360 | files = ( 361 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 362 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 363 | ); 364 | runOnlyForDeploymentPostprocessing = 0; 365 | }; 366 | 607FACE11AFB9204008FA782 /* Sources */ = { 367 | isa = PBXSourcesBuildPhase; 368 | buildActionMask = 2147483647; 369 | files = ( 370 | 3BC33AFA1EAB98F70019E72C /* Pokedex.swift in Sources */, 371 | 3BBFC7611EB7AE3A0003B466 /* TestMeasure.swift in Sources */, 372 | 3BC33AF61EAB98930019E72C /* Trainer.swift in Sources */, 373 | 3B7CD02C1E76DFAF00011116 /* PokemonHelp.swift in Sources */, 374 | 3B7CD0301E76DFAF00011116 /* TestVariable.swift in Sources */, 375 | 3B7956D122170A0C00246717 /* TestUpdate.swift in Sources */, 376 | 3B7CD02D1E76DFAF00011116 /* TestDelete.swift in Sources */, 377 | 3B7CD02F1E76DFAF00011116 /* TestSave.swift in Sources */, 378 | 3B7CD02B1E76DFAF00011116 /* Pokemon.swift in Sources */, 379 | 3B27B1C91EBDDE30008BF579 /* TestQuery.swift in Sources */, 380 | 3B7CD02E1E76DFAF00011116 /* TestEdit.swift in Sources */, 381 | ); 382 | runOnlyForDeploymentPostprocessing = 0; 383 | }; 384 | /* End PBXSourcesBuildPhase section */ 385 | 386 | /* Begin PBXTargetDependency section */ 387 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 388 | isa = PBXTargetDependency; 389 | target = 607FACCF1AFB9204008FA782 /* EasyRealm_Example */; 390 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 391 | }; 392 | /* End PBXTargetDependency section */ 393 | 394 | /* Begin PBXVariantGroup section */ 395 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 396 | isa = PBXVariantGroup; 397 | children = ( 398 | 607FACDA1AFB9204008FA782 /* Base */, 399 | ); 400 | name = Main.storyboard; 401 | sourceTree = ""; 402 | }; 403 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 404 | isa = PBXVariantGroup; 405 | children = ( 406 | 607FACDF1AFB9204008FA782 /* Base */, 407 | ); 408 | name = LaunchScreen.xib; 409 | sourceTree = ""; 410 | }; 411 | /* End PBXVariantGroup section */ 412 | 413 | /* Begin XCBuildConfiguration section */ 414 | 607FACED1AFB9204008FA782 /* Debug */ = { 415 | isa = XCBuildConfiguration; 416 | buildSettings = { 417 | ALWAYS_SEARCH_USER_PATHS = NO; 418 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 419 | CLANG_CXX_LIBRARY = "libc++"; 420 | CLANG_ENABLE_MODULES = YES; 421 | CLANG_ENABLE_OBJC_ARC = YES; 422 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 423 | CLANG_WARN_BOOL_CONVERSION = YES; 424 | CLANG_WARN_COMMA = YES; 425 | CLANG_WARN_CONSTANT_CONVERSION = YES; 426 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 427 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 428 | CLANG_WARN_EMPTY_BODY = YES; 429 | CLANG_WARN_ENUM_CONVERSION = YES; 430 | CLANG_WARN_INFINITE_RECURSION = YES; 431 | CLANG_WARN_INT_CONVERSION = YES; 432 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 433 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 434 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 435 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 436 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 437 | CLANG_WARN_STRICT_PROTOTYPES = YES; 438 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 439 | CLANG_WARN_UNREACHABLE_CODE = YES; 440 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 441 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 442 | COPY_PHASE_STRIP = NO; 443 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 444 | ENABLE_STRICT_OBJC_MSGSEND = YES; 445 | ENABLE_TESTABILITY = YES; 446 | GCC_C_LANGUAGE_STANDARD = gnu99; 447 | GCC_DYNAMIC_NO_PIC = NO; 448 | GCC_NO_COMMON_BLOCKS = YES; 449 | GCC_OPTIMIZATION_LEVEL = 0; 450 | GCC_PREPROCESSOR_DEFINITIONS = ( 451 | "DEBUG=1", 452 | "$(inherited)", 453 | ); 454 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 455 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 456 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 457 | GCC_WARN_UNDECLARED_SELECTOR = YES; 458 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 459 | GCC_WARN_UNUSED_FUNCTION = YES; 460 | GCC_WARN_UNUSED_VARIABLE = YES; 461 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 462 | MTL_ENABLE_DEBUG_INFO = YES; 463 | ONLY_ACTIVE_ARCH = YES; 464 | SDKROOT = iphoneos; 465 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 466 | SWIFT_VERSION = 4.2; 467 | }; 468 | name = Debug; 469 | }; 470 | 607FACEE1AFB9204008FA782 /* Release */ = { 471 | isa = XCBuildConfiguration; 472 | buildSettings = { 473 | ALWAYS_SEARCH_USER_PATHS = NO; 474 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 475 | CLANG_CXX_LIBRARY = "libc++"; 476 | CLANG_ENABLE_MODULES = YES; 477 | CLANG_ENABLE_OBJC_ARC = YES; 478 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 479 | CLANG_WARN_BOOL_CONVERSION = YES; 480 | CLANG_WARN_COMMA = YES; 481 | CLANG_WARN_CONSTANT_CONVERSION = YES; 482 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 483 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 484 | CLANG_WARN_EMPTY_BODY = YES; 485 | CLANG_WARN_ENUM_CONVERSION = YES; 486 | CLANG_WARN_INFINITE_RECURSION = YES; 487 | CLANG_WARN_INT_CONVERSION = YES; 488 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 489 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 490 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 491 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 492 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 493 | CLANG_WARN_STRICT_PROTOTYPES = YES; 494 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 495 | CLANG_WARN_UNREACHABLE_CODE = YES; 496 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 497 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 498 | COPY_PHASE_STRIP = NO; 499 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 500 | ENABLE_NS_ASSERTIONS = NO; 501 | ENABLE_STRICT_OBJC_MSGSEND = YES; 502 | GCC_C_LANGUAGE_STANDARD = gnu99; 503 | GCC_NO_COMMON_BLOCKS = YES; 504 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 505 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 506 | GCC_WARN_UNDECLARED_SELECTOR = YES; 507 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 508 | GCC_WARN_UNUSED_FUNCTION = YES; 509 | GCC_WARN_UNUSED_VARIABLE = YES; 510 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 511 | MTL_ENABLE_DEBUG_INFO = NO; 512 | SDKROOT = iphoneos; 513 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 514 | SWIFT_VERSION = 4.2; 515 | VALIDATE_PRODUCT = YES; 516 | }; 517 | name = Release; 518 | }; 519 | 607FACF01AFB9204008FA782 /* Debug */ = { 520 | isa = XCBuildConfiguration; 521 | baseConfigurationReference = ED34CAE00F1E0583F8416DB8 /* Pods-EasyRealm_Example.debug.xcconfig */; 522 | buildSettings = { 523 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 524 | CODE_SIGN_STYLE = Manual; 525 | DEVELOPMENT_TEAM = ""; 526 | INFOPLIST_FILE = EasyRealm/Info.plist; 527 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 528 | MODULE_NAME = ExampleApp; 529 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 530 | PRODUCT_NAME = "$(TARGET_NAME)"; 531 | PROVISIONING_PROFILE_SPECIFIER = ""; 532 | SWIFT_VERSION = 4.2; 533 | }; 534 | name = Debug; 535 | }; 536 | 607FACF11AFB9204008FA782 /* Release */ = { 537 | isa = XCBuildConfiguration; 538 | baseConfigurationReference = 061E59C21F2F2720DFCDC799 /* Pods-EasyRealm_Example.release.xcconfig */; 539 | buildSettings = { 540 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 541 | CODE_SIGN_STYLE = Manual; 542 | DEVELOPMENT_TEAM = ""; 543 | INFOPLIST_FILE = EasyRealm/Info.plist; 544 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 545 | MODULE_NAME = ExampleApp; 546 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 547 | PRODUCT_NAME = "$(TARGET_NAME)"; 548 | PROVISIONING_PROFILE_SPECIFIER = ""; 549 | SWIFT_VERSION = 4.2; 550 | }; 551 | name = Release; 552 | }; 553 | 607FACF31AFB9204008FA782 /* Debug */ = { 554 | isa = XCBuildConfiguration; 555 | baseConfigurationReference = 5AC0DD2B71C5BD7C3E4B045D /* Pods-EasyRealm_Tests.debug.xcconfig */; 556 | buildSettings = { 557 | CODE_SIGN_IDENTITY = "iPhone Developer"; 558 | CODE_SIGN_STYLE = Manual; 559 | DEVELOPMENT_TEAM = ""; 560 | GCC_PREPROCESSOR_DEFINITIONS = ( 561 | "DEBUG=1", 562 | "$(inherited)", 563 | ); 564 | INFOPLIST_FILE = Tests/Info.plist; 565 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 566 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 567 | PRODUCT_NAME = "$(TARGET_NAME)"; 568 | PROVISIONING_PROFILE_SPECIFIER = ""; 569 | SWIFT_VERSION = 4.2; 570 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EasyRealm_Example.app/EasyRealm_Example"; 571 | }; 572 | name = Debug; 573 | }; 574 | 607FACF41AFB9204008FA782 /* Release */ = { 575 | isa = XCBuildConfiguration; 576 | baseConfigurationReference = B6C45787A877C3285FE205B0 /* Pods-EasyRealm_Tests.release.xcconfig */; 577 | buildSettings = { 578 | CODE_SIGN_STYLE = Manual; 579 | DEVELOPMENT_TEAM = ""; 580 | INFOPLIST_FILE = Tests/Info.plist; 581 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 582 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 583 | PRODUCT_NAME = "$(TARGET_NAME)"; 584 | PROVISIONING_PROFILE_SPECIFIER = ""; 585 | SWIFT_VERSION = 4.2; 586 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EasyRealm_Example.app/EasyRealm_Example"; 587 | }; 588 | name = Release; 589 | }; 590 | /* End XCBuildConfiguration section */ 591 | 592 | /* Begin XCConfigurationList section */ 593 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "EasyRealm" */ = { 594 | isa = XCConfigurationList; 595 | buildConfigurations = ( 596 | 607FACED1AFB9204008FA782 /* Debug */, 597 | 607FACEE1AFB9204008FA782 /* Release */, 598 | ); 599 | defaultConfigurationIsVisible = 0; 600 | defaultConfigurationName = Release; 601 | }; 602 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "EasyRealm_Example" */ = { 603 | isa = XCConfigurationList; 604 | buildConfigurations = ( 605 | 607FACF01AFB9204008FA782 /* Debug */, 606 | 607FACF11AFB9204008FA782 /* Release */, 607 | ); 608 | defaultConfigurationIsVisible = 0; 609 | defaultConfigurationName = Release; 610 | }; 611 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "EasyRealm_Tests" */ = { 612 | isa = XCConfigurationList; 613 | buildConfigurations = ( 614 | 607FACF31AFB9204008FA782 /* Debug */, 615 | 607FACF41AFB9204008FA782 /* Release */, 616 | ); 617 | defaultConfigurationIsVisible = 0; 618 | defaultConfigurationName = Release; 619 | }; 620 | /* End XCConfigurationList section */ 621 | }; 622 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 623 | } 624 | -------------------------------------------------------------------------------- /Example/EasyRealm.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/EasyRealm.xcodeproj/xcshareddata/xcschemes/EasyRealm-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 79 | 81 | 87 | 88 | 89 | 90 | 91 | 92 | 98 | 100 | 106 | 107 | 108 | 109 | 111 | 112 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /Example/EasyRealm.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/EasyRealm.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/EasyRealm/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 03/13/2017. 6 | // Copyright (c) 2017 Allan Vialatte. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | return true 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Example/EasyRealm/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/EasyRealm/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/EasyRealm/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/EasyRealm/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/EasyRealm/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 03/13/2017. 6 | // Copyright (c) 2017 Allan Vialatte. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | platform :ios, '10.0' 3 | 4 | target 'EasyRealm_Example' do 5 | pod 'EasyRealm', :path => '../' 6 | 7 | target 'EasyRealm_Tests' do 8 | inherit! :search_paths 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - EasyRealm (3.4.0): 3 | - RealmSwift (~> 3.10) 4 | - Realm (3.13.1): 5 | - Realm/Headers (= 3.13.1) 6 | - Realm/Headers (3.13.1) 7 | - RealmSwift (3.13.1): 8 | - Realm (= 3.13.1) 9 | 10 | DEPENDENCIES: 11 | - EasyRealm (from `../`) 12 | 13 | SPEC REPOS: 14 | https://github.com/cocoapods/specs.git: 15 | - Realm 16 | - RealmSwift 17 | 18 | EXTERNAL SOURCES: 19 | EasyRealm: 20 | :path: "../" 21 | 22 | SPEC CHECKSUMS: 23 | EasyRealm: 033b9add2c5f7f65dfe017a50d5a8d9f0ba07c2f 24 | Realm: 50071da38fe079e0735e47c9f2eae738c68c5996 25 | RealmSwift: 8a1e6a02b7a08cd17a31e3115143fb69fe5f3fb9 26 | 27 | PODFILE CHECKSUM: 73d2683af2c7ac771647afb875fecd5c780c7a9f 28 | 29 | COCOAPODS: 1.5.3 30 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/Pokedex.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Pokedex.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 22/04/2017. 6 | // Copyright © 2017 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import RealmSwift 11 | 12 | final class Pokedex:Object { 13 | @objc dynamic var identifier = UUID().uuidString 14 | 15 | override static func primaryKey() -> String? { 16 | return "identifier" 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Example/Tests/Pokemon.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Pokemon.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 10/03/2017. 6 | // 7 | 8 | 9 | import Foundation 10 | import RealmSwift 11 | 12 | final class Pokeball:Object { 13 | @objc dynamic var identifier = UUID().uuidString 14 | @objc dynamic var level = 1 15 | @objc dynamic var branding = "" 16 | 17 | override static func primaryKey() -> String? { 18 | return "identifier" 19 | } 20 | 21 | static func create() -> Pokeball { 22 | let ball = Pokeball() 23 | ball.level = Int(arc4random()) % 5 24 | return ball 25 | } 26 | 27 | } 28 | 29 | final class Pokemon: Object { 30 | @objc dynamic var name: String? 31 | @objc dynamic var level: Int = 1 32 | @objc dynamic var pokeball:Pokeball? 33 | let specialBoost = RealmOptional() 34 | 35 | override static func primaryKey() -> String? { 36 | return "name" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/Tests/PokemonHelp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PokemonHelp.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 10/03/2017. 6 | // 7 | 8 | 9 | import Foundation 10 | 11 | 12 | struct HelpPokemon { 13 | 14 | static func pokemons(with names:[String]) -> [Pokemon] { 15 | return names.compactMap { 16 | let pokemon = Pokemon() 17 | pokemon.name = $0 18 | pokemon.level = Int(arc4random()) % 100 19 | return pokemon 20 | } 21 | } 22 | 23 | static func generateRandomPokemon() -> Pokemon { 24 | let pokemon = Pokemon() 25 | pokemon.name = allPokemonName[Int(arc4random()) % allPokemonName.count] 26 | pokemon.level = Int(arc4random()) % 100 27 | return pokemon 28 | } 29 | 30 | static func generateCapturedRandomPokemon() -> Pokemon { 31 | let pokemon = Pokemon() 32 | pokemon.name = allPokemonName[Int(arc4random()) % allPokemonName.count] 33 | pokemon.level = Int(arc4random()) % 100 34 | pokemon.pokeball = Pokeball.create() 35 | return pokemon 36 | } 37 | 38 | static func allPokedex() -> [Pokemon] { 39 | return allPokemonName.compactMap { 40 | let pokemon = Pokemon() 41 | pokemon.name = $0 42 | pokemon.level = Int(arc4random()) % 100 43 | return pokemon 44 | } 45 | } 46 | 47 | 48 | static let allPokemonName = [ 49 | "Bulbasaur", 50 | "Ivysaur", 51 | "Venusaur", 52 | "Charmander", 53 | "Charmeleon", 54 | "Charizard", 55 | "Squirtle", 56 | "Wartortle", 57 | "Blastoise", 58 | "Caterpie", 59 | "Metapod", 60 | "Butterfree", 61 | "Weedle", 62 | "Kakuna", 63 | "Beedrill", 64 | "Pidgey", 65 | "Pidgeotto", 66 | "Pidgeot", 67 | "Rattata", 68 | "Raticate", 69 | "Spearow", 70 | "Fearow", 71 | "Ekans", 72 | "Arbok", 73 | "Pikachu", 74 | "Raichu", 75 | "Sandshrew", 76 | "Sandslash", 77 | "Nidoran♀", 78 | "Nidorina", 79 | "Nidoqueen", 80 | "Nidoran♂", 81 | "Nidorino", 82 | "Nidoking", 83 | "Clefairy", 84 | "Clefable", 85 | "Vulpix", 86 | "Ninetales", 87 | "Jigglypuff", 88 | "Wigglytuff", 89 | "Zubat", 90 | "Golbat", 91 | "Oddish", 92 | "Gloom", 93 | "Vileplume", 94 | "Paras", 95 | "Parasect", 96 | "Venonat", 97 | "Venomoth", 98 | "Diglett", 99 | "Dugtrio", 100 | "Meowth", 101 | "Persian", 102 | "Psyduck", 103 | "Golduck", 104 | "Mankey", 105 | "Primeape", 106 | "Growlithe", 107 | "Arcanine", 108 | "Poliwag", 109 | "Poliwhirl", 110 | "Poliwrath", 111 | "Abra", 112 | "Kadabra", 113 | "Alakazam", 114 | "Machop", 115 | "Machoke", 116 | "Machamp", 117 | "Bellsprout", 118 | "Weepinbell", 119 | "Victreebel", 120 | "Tentacool", 121 | "Tentacruel", 122 | "Geodude", 123 | "Graveler", 124 | "Golem", 125 | "Ponyta", 126 | "Rapidash", 127 | "Slowpoke", 128 | "Slowbro", 129 | "Magnemite", 130 | "Magneton", 131 | "Farfetch’d", 132 | "Doduo", 133 | "Dodrio", 134 | "Seel", 135 | "Dewgong", 136 | "Grimer", 137 | "Muk", 138 | "Shellder", 139 | "Cloyster", 140 | "Gastly", 141 | "Haunter", 142 | "Gengar", 143 | "Onix", 144 | "Drowzee", 145 | "Hypno", 146 | "Krabby", 147 | "Kingler", 148 | "Voltorb", 149 | "Electrode", 150 | "Exeggcute", 151 | "Exeggutor", 152 | "Cubone", 153 | "Marowak", 154 | "Hitmonlee", 155 | "Hitmonchan", 156 | "Lickitung", 157 | "Koffing", 158 | "Weezing", 159 | "Rhyhorn", 160 | "Rhydon", 161 | "Chansey", 162 | "Tangela", 163 | "Kangaskhan", 164 | "Horsea", 165 | "Seadra", 166 | "Goldeen", 167 | "Seaking", 168 | "Staryu", 169 | "Starmie", 170 | "er. Mime", 171 | "Scyther", 172 | "Jynx", 173 | "Electabuzz", 174 | "Magmar", 175 | "Pinsir", 176 | "Tauros", 177 | "Magikarp", 178 | "Gyarados", 179 | "Lapras", 180 | "Ditto", 181 | "Eevee", 182 | "Vaporeon", 183 | "Jolteon", 184 | "Flareon", 185 | "Porygon", 186 | "Omanyte", 187 | "Omastar", 188 | "Kabuto", 189 | "Kabutops", 190 | "Aerodactyl", 191 | "Snorlax", 192 | "Articuno", 193 | "Zapdos", 194 | "Moltres", 195 | "Dratini", 196 | "Dragonair", 197 | "Dragonite", 198 | "Mewtwo", 199 | "Mew", 200 | "Chikorita", 201 | "Bayleef", 202 | "Meganium", 203 | "Cyndaquil", 204 | "Quilava", 205 | "Typhlosion", 206 | "Totodile", 207 | "Croconaw", 208 | "Feraligatr", 209 | "Sentret", 210 | "Furret", 211 | "Hoothoot", 212 | "Noctowl", 213 | "Ledyba", 214 | "Ledian", 215 | "Spinarak", 216 | "Ariados", 217 | "Crobat", 218 | "Chinchou", 219 | "Lanturn", 220 | "Pichu", 221 | "Cleffa", 222 | "Igglybuff", 223 | "Togepi", 224 | "Togetic", 225 | "Natu", 226 | "Xatu", 227 | "Mareep", 228 | "Flaaffy", 229 | "Ampharos", 230 | "Bellossom", 231 | "Marill", 232 | "Azumarill", 233 | "Sudowoodo", 234 | "Politoed", 235 | "Hoppip", 236 | "Skiploom", 237 | "Jumpluff", 238 | "Aipom", 239 | "Sunkern", 240 | "Sunflora", 241 | "Yanma", 242 | "Wooper", 243 | "Quagsire", 244 | "Espeon", 245 | "Umbreon", 246 | "Murkrow", 247 | "Slowking", 248 | "Misdreavus", 249 | "Unown", 250 | "Wobbuffet", 251 | "Girafarig", 252 | "Pineco", 253 | "Forretress", 254 | "Dunsparce", 255 | "Gligar", 256 | "Steelix", 257 | "Snubbull", 258 | "Granbull", 259 | "Qwilfish", 260 | "Scizor", 261 | "Shuckle", 262 | "Heracross", 263 | "Sneasel", 264 | "Teddiursa", 265 | "Ursaring", 266 | "Slugma", 267 | "Magcargo", 268 | "Swinub", 269 | "Piloswine", 270 | "Corsola", 271 | "Remoraid", 272 | "Octillery", 273 | "Delibird", 274 | "Mantine", 275 | "Skarmory", 276 | "Houndour", 277 | "Houndoom", 278 | "Kingdra", 279 | "Phanpy", 280 | "Donphan", 281 | "Porygon2", 282 | "Stantler", 283 | "Smeargle", 284 | "Tyrogue", 285 | "Hitmontop", 286 | "Smoochum", 287 | "Elekid", 288 | "Magby", 289 | "Miltank", 290 | "Blissey", 291 | "Raikou", 292 | "Entei", 293 | "Suicune", 294 | "Larvitar", 295 | "Pupitar", 296 | "Tyranitar", 297 | "Lugia", 298 | "Ho-Oh", 299 | "Celebi", 300 | "Treecko", 301 | "Grovyle", 302 | "Sceptile", 303 | "Torchic", 304 | "Combusken", 305 | "Blaziken", 306 | "Mudkip", 307 | "Marshtomp", 308 | "Swampert", 309 | "Poochyena", 310 | "Mightyena", 311 | "Zigzagoon", 312 | "Linoone", 313 | "Wurmple", 314 | "Silcoon", 315 | "Beautifly", 316 | "Cascoon", 317 | "Dustox", 318 | "Lotad", 319 | "Lombre", 320 | "Ludicolo", 321 | "Seedot", 322 | "Nuzleaf", 323 | "Shiftry", 324 | "Taillow", 325 | "Swellow", 326 | "Wingull", 327 | "Pelipper", 328 | "Ralts", 329 | "Kirlia", 330 | "Gardevoir", 331 | "Surskit", 332 | "Masquerain", 333 | "Shroomish", 334 | "Breloom", 335 | "Slakoth", 336 | "Vigoroth", 337 | "Slaking", 338 | "Nincada", 339 | "Ninjask", 340 | "Shedinja", 341 | "Whismur", 342 | "Loudred", 343 | "Exploud", 344 | "Makuhita", 345 | "Hariyama", 346 | "Azurill", 347 | "Nosepass", 348 | "Skitty", 349 | "Delcatty", 350 | "Sableye", 351 | "Mawile", 352 | "Aron", 353 | "Lairon", 354 | "Aggron", 355 | "Meditite", 356 | "Medicham", 357 | "Electrike", 358 | "Manectric", 359 | "Plusle", 360 | "Minun", 361 | "Volbeat", 362 | "Illumise", 363 | "Roselia", 364 | "Gulpin", 365 | "Swalot", 366 | "Carvanha", 367 | "Sharpedo", 368 | "Wailmer", 369 | "Wailord", 370 | "Numel", 371 | "Camerupt", 372 | "Torkoal", 373 | "Spoink", 374 | "Grumpig", 375 | "Spinda", 376 | "Trapinch", 377 | "Vibrava", 378 | "Flygon", 379 | "Cacnea", 380 | "Cacturne", 381 | "Swablu", 382 | "Altaria", 383 | "Zangoose", 384 | "Seviper", 385 | "Lunatone", 386 | "Solrock", 387 | "Barboach", 388 | "Whiscash", 389 | "Corphish", 390 | "Crawdaunt", 391 | "Baltoy", 392 | "Claydol", 393 | "Lileep", 394 | "Cradily", 395 | "Anorith", 396 | "Armaldo", 397 | "Feebas", 398 | "Milotic", 399 | "Castform", 400 | "Kecleon", 401 | "Shuppet", 402 | "Banette", 403 | "Duskull", 404 | "Dusclops", 405 | "Tropius", 406 | "Chimecho", 407 | "Absol", 408 | "Wynaut", 409 | "Snorunt", 410 | "Glalie", 411 | "Spheal", 412 | "Sealeo", 413 | "Walrein", 414 | "Clamperl", 415 | "Huntail", 416 | "Gorebyss", 417 | "Relicanth", 418 | "Luvdisc", 419 | "Bagon", 420 | "Shelgon", 421 | "Salamence", 422 | "Beldum", 423 | "Metang", 424 | "Metagross", 425 | "Regirock", 426 | "Regice", 427 | "Registeel", 428 | "Latias", 429 | "Latios", 430 | "Kyogre", 431 | "Groudon", 432 | "Rayquaza", 433 | "Jirachi", 434 | "Deoxys", 435 | "Turtwig", 436 | "Grotle", 437 | "Torterra", 438 | "Chimchar", 439 | "Monferno", 440 | "Infernape", 441 | "Piplup", 442 | "Prinplup", 443 | "Empoleon", 444 | "Starly", 445 | "Staravia", 446 | "Staraptor", 447 | "Bidoof", 448 | "Bibarel", 449 | "Kricketot", 450 | "Kricketune", 451 | "Shinx", 452 | "Luxio", 453 | "Luxray", 454 | "Budew", 455 | "Roserade", 456 | "Cranidos", 457 | "Rampardos", 458 | "Shieldon", 459 | "Bastiodon", 460 | "Burmy", 461 | "Wormadam", 462 | "Mothim", 463 | "Combee", 464 | "Vespiquen", 465 | "Pachirisu", 466 | "Buizel", 467 | "Floatzel", 468 | "Cherubi", 469 | "Cherrim", 470 | "Shellos", 471 | "Gastrodon", 472 | "Ambipom", 473 | "Drifloon", 474 | "Drifblim", 475 | "Buneary", 476 | "Lopunny", 477 | "Mismagius", 478 | "Honchkrow", 479 | "Glameow", 480 | "Purugly", 481 | "Chingling", 482 | "Stunky", 483 | "Skuntank", 484 | "Bronzor", 485 | "Bronzong", 486 | "Bonsly", 487 | "Mime Jr.", 488 | "Happiny", 489 | "Chatot", 490 | "Spiritomb", 491 | "Gible", 492 | "Gabite", 493 | "Garchomp", 494 | "Munchlax", 495 | "Riolu", 496 | "Lucario", 497 | "Hippopotas", 498 | "Hippowdon", 499 | "Skorupi", 500 | "Drapion", 501 | "Croagunk", 502 | "Toxicroak", 503 | "Carnivine", 504 | "Finneon", 505 | "Lumineon", 506 | "Mantyke", 507 | "Snover", 508 | "Abomasnow", 509 | "Weavile", 510 | "Magnezone", 511 | "Lickilicky", 512 | "Rhyperior", 513 | "Tangrowth", 514 | "Electivire", 515 | "Magmortar", 516 | "Togekiss", 517 | "Yanmega", 518 | "Leafeon", 519 | "Glaceon", 520 | "Gliscor", 521 | "Mamoswine", 522 | "Porygon-Z", 523 | "Gallade", 524 | "Probopass", 525 | "Dusknoir", 526 | "Froslass", 527 | "Rotom", 528 | "Uxie", 529 | "Mesprit", 530 | "Azelf", 531 | "Dialga", 532 | "Palkia", 533 | "Heatran", 534 | "Regigigas", 535 | "Giratina", 536 | "Cresselia", 537 | "Phione", 538 | "Manaphy", 539 | "Darkrai", 540 | "Shaymin", 541 | "Arceus", 542 | "Victini", 543 | "Snivy", 544 | "Servine", 545 | "Serperior", 546 | "Tepig", 547 | "Pignite", 548 | "Emboar", 549 | "Oshawott", 550 | "Dewott", 551 | "Samurott", 552 | "Patrat", 553 | "Watchog", 554 | "Lillipup", 555 | "Herdier", 556 | "Stoutland", 557 | "Purrloin", 558 | "Liepard", 559 | "Pansage", 560 | "Simisage", 561 | "Pansear", 562 | "Simisear", 563 | "Panpour", 564 | "Simipour", 565 | "Munna", 566 | "Musharna", 567 | "Pidove", 568 | "Tranquill", 569 | "Unfezant", 570 | "Blitzle", 571 | "Zebstrika", 572 | "Roggenrola", 573 | "Boldore", 574 | "Gigalith", 575 | "Woobat", 576 | "Swoobat", 577 | "Drilbur", 578 | "Excadrill", 579 | "Audino", 580 | "Timburr", 581 | "Gurdurr", 582 | "Conkeldurr", 583 | "Tympole", 584 | "Palpitoad", 585 | "Seismitoad", 586 | "Throh", 587 | "Sawk", 588 | "Sewaddle", 589 | "Swadloon", 590 | "Leavanny", 591 | "Venipede", 592 | "Whirlipede", 593 | "Scolipede", 594 | "Cottonee", 595 | "Whimsicott", 596 | "Petilil", 597 | "Lilligant", 598 | "Basculin", 599 | "Sandile", 600 | "Krokorok", 601 | "Krookodile", 602 | "Darumaka", 603 | "Darmanitan", 604 | "Maractus", 605 | "Dwebble", 606 | "Crustle", 607 | "Scraggy", 608 | "Scrafty", 609 | "Sigilyph", 610 | "Yamask", 611 | "Cofagrigus", 612 | "Tirtouga", 613 | "Carracosta", 614 | "Archen", 615 | "Archeops", 616 | "Trubbish", 617 | "Garbodor", 618 | "Zorua", 619 | "Zoroark", 620 | "Minccino", 621 | "Cinccino", 622 | "Gothita", 623 | "Gothorita", 624 | "Gothitelle", 625 | "Solosis", 626 | "Duosion", 627 | "Reuniclus", 628 | "Ducklett", 629 | "Swanna", 630 | "Vanillite", 631 | "Vanillish", 632 | "Vanilluxe", 633 | "Deerling", 634 | "Sawsbuck", 635 | "Emolga", 636 | "Karrablast", 637 | "Escavalier", 638 | "Foongus", 639 | "Amoonguss", 640 | "Frillish", 641 | "Jellicent", 642 | "Alomomola", 643 | "Joltik", 644 | "Galvantula", 645 | "Ferroseed", 646 | "Ferrothorn", 647 | "Klink", 648 | "Klang", 649 | "Klinklang", 650 | "Tynamo", 651 | "Eelektrik", 652 | "Eelektross", 653 | "Elgyem", 654 | "Beheeyem", 655 | "Litwick", 656 | "Lampent", 657 | "Chandelure", 658 | "Axew", 659 | "Fraxure", 660 | "Haxorus", 661 | "Cubchoo", 662 | "Beartic", 663 | "Cryogonal", 664 | "Shelmet", 665 | "Accelgor", 666 | "Stunfisk", 667 | "Mienfoo", 668 | "Mienshao", 669 | "Druddigon", 670 | "Golett", 671 | "Golurk", 672 | "Pawniard", 673 | "Bisharp", 674 | "Bouffalant", 675 | "Rufflet", 676 | "Braviary", 677 | "Vullaby", 678 | "Mandibuzz", 679 | "Heatmor", 680 | "Durant", 681 | "Deino", 682 | "Zweilous", 683 | "Hydreigon", 684 | "Larvesta", 685 | "Volcarona", 686 | "Cobalion", 687 | "Terrakion", 688 | "Virizion", 689 | "Tornadus", 690 | "Thundurus", 691 | "Reshiram", 692 | "Zekrom ", 693 | "Landorus", 694 | "Kyurem", 695 | "Keldeo", 696 | "Meloetta", 697 | "Genesect", 698 | "Chespin", 699 | "Quilladin", 700 | "Chesnaught", 701 | "Fennekin", 702 | "Braixen", 703 | "Delphox", 704 | "Froakie", 705 | "Frogadier", 706 | "Greninja", 707 | "Bunnelby", 708 | "Diggersby", 709 | "Fletchling", 710 | "Fletchinder", 711 | "Talonflame", 712 | "Scatterbug", 713 | "Spewpa", 714 | "Vivillon", 715 | "Litleo", 716 | "Pyroar", 717 | "Flabebe", 718 | "Floette", 719 | "Florges", 720 | "Skiddo", 721 | "Gogoat", 722 | "Pancham", 723 | "Pangoro", 724 | "Furfrou", 725 | "Espurr", 726 | "Meowstic", 727 | "Honedge", 728 | "Doublade", 729 | "Aegislash", 730 | "Spritzee", 731 | "Aromatisse", 732 | "Swirlix", 733 | "Slurpuff", 734 | "Inkay", 735 | "Malamar", 736 | "Binacle", 737 | "Barbaracle", 738 | "Skrelp", 739 | "Dragalge", 740 | "Clauncher", 741 | "Clawitzer", 742 | "Helioptile", 743 | "Heliolisk", 744 | "Tyrunt", 745 | "Tyrantrum", 746 | "Amaura", 747 | "Aurorus", 748 | "Sylveon", 749 | "Hawlucha", 750 | "Dedenne", 751 | "Carbink", 752 | "Goomy", 753 | "Sliggoo", 754 | "Goodra", 755 | "Klefki", 756 | "Phantump", 757 | "Trevenant", 758 | "Pumpkaboo", 759 | "Gourgeist", 760 | "Bergmite", 761 | "Avalugg", 762 | "Noibat", 763 | "Noivern", 764 | "Xerneas", 765 | "Yveltal", 766 | "Zygarde", 767 | "Diancie", 768 | "Hoopa", 769 | "Volcanion", 770 | "Rowlet", 771 | "Dartrix", 772 | "Decidueye", 773 | "Litten", 774 | "Torracat", 775 | "Incineroar", 776 | "Popplio", 777 | "Brionne", 778 | "Primarina", 779 | "Pikipek", 780 | "Trumbeak", 781 | "Toucannon", 782 | "Yungoos", 783 | "Gumshoos", 784 | "Grubbin", 785 | "Charjabug", 786 | "Vikavolt", 787 | "Crabrawler", 788 | "Crabominable", 789 | "Oricorio", 790 | "Cutiefly", 791 | "Ribombee", 792 | "Rockruff", 793 | "Lycanroc", 794 | "Wishiwashi", 795 | "Mareanie", 796 | "Toxapex", 797 | "Mudbray", 798 | "Mudsdale", 799 | "Dewpider", 800 | "Araquanid", 801 | "Fomantis", 802 | "Lurantis", 803 | "Morelull", 804 | "Shiinotic", 805 | "Salandit", 806 | "Salazzle", 807 | "Stufful", 808 | "Bewear", 809 | "Bounsweet", 810 | "Steenee", 811 | "Tsareena", 812 | "Comfey", 813 | "Oranguru", 814 | "Passimian", 815 | "Wimpod", 816 | "Golisopod", 817 | "Sandygast", 818 | "Palossand", 819 | "Pyukumuku", 820 | "Type: Null", 821 | "Silvally", 822 | "Minior", 823 | "Komala", 824 | "Turtonator", 825 | "Togedemaru", 826 | "Mimikyu", 827 | "Bruxish", 828 | "Drampa", 829 | "Dhelmise", 830 | "Jangmo-o", 831 | "Hakamo-o", 832 | "Kommo-o", 833 | "Tapu Koko", 834 | "Tapu Lele", 835 | "Tapu Bulu", 836 | "Tapu Fini", 837 | "Cosmog", 838 | "Cosmoem", 839 | "Solgaleo", 840 | "Lunala", 841 | "Nihilego", 842 | "Buzzwole", 843 | "Pheromosa", 844 | "Xurkitree", 845 | "Celesteela", 846 | "Kartana", 847 | "Guzzlord", 848 | "Necrozma", 849 | "Magearna", 850 | "Marshadow" 851 | ] 852 | } 853 | -------------------------------------------------------------------------------- /Example/Tests/TestDelete.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Test_Delete.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 10/03/2017. 6 | // 7 | 8 | 9 | import XCTest 10 | import RealmSwift 11 | import EasyRealm 12 | 13 | class TestDelete: XCTestCase { 14 | 15 | let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] 16 | 17 | override func setUp() { 18 | super.setUp() 19 | Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name 20 | } 21 | 22 | override func tearDown() { 23 | super.tearDown() 24 | let realm = try! Realm() 25 | try! realm.write { realm.deleteAll() } 26 | } 27 | 28 | func testDeleteAll() { 29 | HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } 30 | try! Pokemon.er.deleteAll() 31 | let count = try! Pokemon.er.all().count 32 | XCTAssertEqual(count, 0) 33 | } 34 | 35 | 36 | func testDeleteUnmanaged() { 37 | let pokemons = HelpPokemon.pokemons(with: self.testPokemon) 38 | pokemons.forEach { 39 | try! $0.er.save(update: true) 40 | } 41 | pokemons.forEach { pokemon in 42 | XCTAssert(pokemon.realm == nil) 43 | try! pokemon.er.delete() 44 | } 45 | let count = try! Pokemon.er.all().count 46 | XCTAssertEqual(count, 0) 47 | } 48 | 49 | func testDeleteManaged() { 50 | HelpPokemon.pokemons(with: self.testPokemon).forEach { 51 | try! $0.er.save(update: true) 52 | } 53 | 54 | let pokemons = try! Pokemon.er.all() 55 | pokemons.forEach { 56 | XCTAssert($0.realm != nil) 57 | try! $0.er.delete() 58 | } 59 | 60 | let count = try! Pokemon.er.all().count 61 | XCTAssertEqual(count, 0) 62 | } 63 | 64 | func testDeleteCascadeComplexManagedObject() { 65 | let trainer = Trainer() 66 | let pokedex = Pokedex() 67 | trainer.pokemons.append(objectsIn: HelpPokemon.allPokedex()) 68 | trainer.pokedex = pokedex 69 | try! trainer.er.save(update: true) 70 | 71 | 72 | XCTAssertEqual(try! Trainer.er.all().count, 1) 73 | XCTAssertEqual(try! Pokedex.er.all().count, 1) 74 | XCTAssertEqual(try! Pokemon.er.all().count, HelpPokemon.allPokedex().count) 75 | 76 | let managed = trainer.er.managed! 77 | try! managed.er.delete(with: .cascade) 78 | 79 | XCTAssertEqual(try! Trainer.er.all().count, 0) 80 | XCTAssertEqual(try! Pokedex.er.all().count, 0) 81 | XCTAssertEqual(try! Pokemon.er.all().count, 0) 82 | } 83 | 84 | func testDeleteCascadeComplexUnManagedObject() { 85 | let trainer = Trainer() 86 | let pokedex = Pokedex() 87 | trainer.pokemons.append(objectsIn: HelpPokemon.allPokedex()) 88 | trainer.pokedex = pokedex 89 | try! trainer.er.save(update: true) 90 | 91 | 92 | XCTAssertEqual(try! Trainer.er.all().count, 1) 93 | XCTAssertEqual(try! Pokedex.er.all().count, 1) 94 | XCTAssertEqual(try! Pokemon.er.all().count, HelpPokemon.allPokedex().count) 95 | 96 | try! trainer.er.delete(with: .cascade) 97 | 98 | XCTAssertEqual(try! Trainer.er.all().count, 0) 99 | XCTAssertEqual(try! Pokedex.er.all().count, 0) 100 | XCTAssertEqual(try! Pokemon.er.all().count, 0) 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /Example/Tests/TestEdit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Test_Edit.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 12/03/2017. 6 | // 7 | 8 | import XCTest 9 | import RealmSwift 10 | import EasyRealm 11 | 12 | class TestEdit: XCTestCase { 13 | 14 | let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] 15 | 16 | 17 | override func setUp() { 18 | super.setUp() 19 | Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name 20 | } 21 | 22 | override func tearDown() { 23 | super.tearDown() 24 | let realm = try! Realm() 25 | try! realm.write { realm.deleteAll() } 26 | } 27 | 28 | func testEditUnmanaged() { 29 | let pokemons = HelpPokemon.pokemons(with: self.testPokemon) 30 | pokemons.forEach { try! $0.er.edit { $0.level = 42 } } 31 | pokemons.forEach { XCTAssertEqual($0.level, 42) } 32 | } 33 | 34 | func testSaveManaged() { 35 | HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } 36 | let pokemons = try! Pokemon.er.all() 37 | pokemons.forEach { try! $0.er.edit { $0.level = 42 } } 38 | pokemons.forEach { 39 | XCTAssertTrue($0.realm != nil) 40 | XCTAssertEqual($0.level, 42) 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Example/Tests/TestMeasure.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestMeasure.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 01/05/2017. 6 | // Copyright © 2017 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import RealmSwift 11 | import EasyRealm 12 | 13 | class TestMeasure: XCTestCase { 14 | 15 | override func setUp() { 16 | super.setUp() 17 | Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name 18 | } 19 | 20 | override func tearDown() { 21 | super.tearDown() 22 | let realm = try! Realm() 23 | try! realm.write { realm.deleteAll() } 24 | } 25 | 26 | // Traditional Way 27 | 28 | func testCreateAndSave() { 29 | 30 | self.measure { 31 | let realm = try! Realm() 32 | let trainer = Trainer() 33 | let pokedex = Pokedex() 34 | trainer.pokemons.append(HelpPokemon.generateCapturedRandomPokemon()) 35 | trainer.pokedex = pokedex 36 | try! realm.write { 37 | realm.add(trainer, update: true) 38 | } 39 | } 40 | } 41 | 42 | // Easy Realm Way 43 | 44 | func testERCreateAndSave() { 45 | self.measure { 46 | let trainer = Trainer() 47 | let pokedex = Pokedex() 48 | trainer.pokemons.append(HelpPokemon.generateCapturedRandomPokemon()) 49 | trainer.pokedex = pokedex 50 | try! trainer.er.save(update: true) 51 | } 52 | } 53 | 54 | func testExample() { 55 | // This is an example of a functional test case. 56 | // Use XCTAssert and related functions to verify your tests produce the correct results. 57 | } 58 | 59 | func testPerformanceExample() { 60 | // This is an example of a performance test case. 61 | self.measure { 62 | // Put the code you want to measure the time of here. 63 | } 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Example/Tests/TestQuery.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestQuery.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 06/05/2017. 6 | // Copyright © 2017 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import RealmSwift 11 | import EasyRealm 12 | 13 | class TestQuery: XCTestCase { 14 | 15 | override func setUp() { 16 | super.setUp() 17 | Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name 18 | } 19 | 20 | override func tearDown() { 21 | super.tearDown() 22 | let realm = try! Realm() 23 | try! realm.write { realm.deleteAll() } 24 | } 25 | 26 | func testQueryError() { 27 | if let firstPokemonName = HelpPokemon.allPokemonName.first { 28 | do { 29 | _ = try Pokemon.er.fromRealm(with: firstPokemonName) 30 | } catch EasyRealmError.ObjectWithPrimaryKeyNotFound { 31 | XCTAssertTrue(true) 32 | print("ObjectWithPrimaryKeyNotFound") 33 | } catch { 34 | print(error) 35 | XCTAssertTrue(false) 36 | } 37 | } 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Example/Tests/TestSave.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Test_Save.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 10/03/2017. 6 | // 7 | 8 | import XCTest 9 | import RealmSwift 10 | import EasyRealm 11 | 12 | class TestSave: XCTestCase { 13 | 14 | let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] 15 | 16 | override func setUp() { 17 | super.setUp() 18 | Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name 19 | } 20 | 21 | override func tearDown() { 22 | super.tearDown() 23 | let realm = try! Realm() 24 | try! realm.write { realm.deleteAll() } 25 | } 26 | 27 | func testSaveUnmanaged() { 28 | HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } 29 | HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } 30 | try! Pokeball.create().er.save() 31 | try! Pokeball.create().er.save() 32 | let numberOfPokemon = try! Pokemon.er.all() 33 | let numberOfPokeball = try! Pokeball.er.all() 34 | XCTAssertEqual(self.testPokemon.count, numberOfPokemon.count) 35 | XCTAssertEqual(2, numberOfPokeball.count) 36 | } 37 | 38 | func testSaveManaged() { 39 | HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } 40 | let managedPokemon = testPokemon.compactMap { try! Pokemon.er.fromRealm(with: $0) } 41 | managedPokemon.forEach { try! $0.er.save(update: true) } 42 | } 43 | 44 | func testMeasureSaveUnmanaged() { 45 | self.measure { 46 | try! Pokeball.create().er.save() 47 | } 48 | } 49 | 50 | func testMeasureSaveManaged() { 51 | let pokemon = HelpPokemon.pokemons(with: [self.testPokemon[0]]).first! 52 | try! pokemon.er.save(update: true) 53 | self.measure { 54 | try! pokemon.er.save(update: true) 55 | } 56 | } 57 | 58 | 59 | func testSaveLotOfComplexObject() { 60 | for _ in 0...10000 { 61 | try! HelpPokemon.generateCapturedRandomPokemon().er.save(update: true) 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /Example/Tests/TestUpdate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestUpdate.swift 3 | // EasyRealm_Example 4 | // 5 | // Created by Allan Vialatte on 15/02/2019. 6 | // Copyright © 2019 CocoaPods. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import RealmSwift 11 | import EasyRealm 12 | 13 | class TestUpdate: XCTestCase { 14 | 15 | let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] 16 | 17 | override func setUp() { 18 | super.setUp() 19 | Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name 20 | } 21 | 22 | override func tearDown() { 23 | super.tearDown() 24 | let realm = try! Realm() 25 | try! realm.write { realm.deleteAll() } 26 | } 27 | 28 | func testUpdateUnmanaged() { 29 | HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } 30 | HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } 31 | let pokemons = try! Pokemon.er.all() 32 | let unmanaged = Array(pokemons).map { $0.er.unmanaged } 33 | unmanaged.forEach { $0.level = 42 } 34 | unmanaged.forEach { try! $0.er.update() } 35 | 36 | let pikachus = try! Pokemon.er.all() 37 | pikachus.forEach { XCTAssertEqual($0.level, 42) } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Example/Tests/TestVariable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Test_Variable.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 10/03/2017. 6 | // 7 | 8 | 9 | import XCTest 10 | import RealmSwift 11 | import EasyRealm 12 | 13 | class TestVariable: XCTestCase { 14 | 15 | 16 | let testPokemon = ["Bulbasaur", "Ivysaur", "Venusaur","Charmander","Charmeleon","Charizard"] 17 | 18 | override func setUp() { 19 | super.setUp() 20 | Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name 21 | } 22 | 23 | override func tearDown() { 24 | super.tearDown() 25 | let realm = try! Realm() 26 | try! realm.write { realm.deleteAll() } 27 | } 28 | 29 | func testIsManaged() { 30 | HelpPokemon.pokemons(with: self.testPokemon).forEach { try! $0.er.save(update: true) } 31 | var pokemon = HelpPokemon.pokemons(with: [self.testPokemon[0]]).first! 32 | XCTAssertFalse(pokemon.er.isManaged) 33 | if let pok = pokemon.er.managed { 34 | pokemon = pok 35 | } 36 | XCTAssertTrue(pokemon.er.isManaged) 37 | } 38 | 39 | func testManaged() { 40 | let pokemon = HelpPokemon.generateCapturedRandomPokemon() 41 | try! pokemon.er.edit { 42 | $0.pokeball?.branding = "Masterball" 43 | } 44 | try! pokemon.er.save(update: true) 45 | 46 | let managed = pokemon.er.managed 47 | XCTAssertNotNil(managed) 48 | XCTAssertTrue(managed?.er.isManaged ?? false) 49 | XCTAssertEqual(managed?.pokeball?.branding, "Masterball") 50 | 51 | } 52 | 53 | func testUnManaged() { 54 | let pokemon = HelpPokemon.generateCapturedRandomPokemon() 55 | try! pokemon.er.edit { 56 | $0.pokeball?.branding = "Masterball" 57 | } 58 | try! pokemon.er.save(update: true) 59 | 60 | let managed = pokemon.er.managed 61 | XCTAssertNotNil(managed) 62 | XCTAssertTrue(managed?.er.isManaged ?? false) 63 | XCTAssertEqual(managed?.pokeball?.branding, "Masterball") 64 | 65 | let unmnaged = pokemon.er.unmanaged 66 | XCTAssertNotNil(unmnaged) 67 | XCTAssertFalse(unmnaged.er.isManaged) 68 | XCTAssertEqual(unmnaged.pokeball?.branding, "Masterball") 69 | } 70 | 71 | func testComplexObject() { 72 | let trainer = Trainer() 73 | let pokedex = Pokedex() 74 | trainer.pokemons.append(HelpPokemon.generateCapturedRandomPokemon()) 75 | trainer.pokedex = pokedex 76 | 77 | trainer.pokemons.forEach { 78 | $0.specialBoost.value = 42 79 | } 80 | 81 | 82 | try! trainer.er.save(update: true) 83 | let managed = trainer.er.managed! 84 | XCTAssertTrue(managed.er.isManaged) 85 | XCTAssertTrue(managed.pokedex!.er.isManaged) 86 | XCTAssertFalse(managed.pokemons.isEmpty) 87 | managed.pokemons.forEach { 88 | XCTAssertTrue($0.er.isManaged) 89 | XCTAssertEqual($0.specialBoost.value!, 42) 90 | } 91 | 92 | let unmanaged = managed.er.unmanaged 93 | XCTAssertFalse(unmanaged.er.isManaged) 94 | XCTAssertFalse(unmanaged.pokedex!.er.isManaged) 95 | XCTAssertFalse(unmanaged.pokemons.isEmpty) 96 | unmanaged.pokemons.forEach { 97 | XCTAssertFalse($0.er.isManaged) 98 | XCTAssertEqual($0.specialBoost.value!, 42) 99 | } 100 | } 101 | 102 | 103 | } 104 | -------------------------------------------------------------------------------- /Example/Tests/Trainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tainer.swift 3 | // EasyRealm 4 | // 5 | // Created by Allan Vialatte on 22/04/2017. 6 | // Copyright © 2017 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import RealmSwift 11 | 12 | final class Trainer: Object { 13 | @objc dynamic var identifier = UUID().uuidString 14 | @objc dynamic var pokedex:Pokedex? 15 | var pokemons = List() 16 | 17 | override static func primaryKey() -> String? { 18 | return "identifier" 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Vialatte Allan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |

5 | EasyRealm 6 |

7 | 8 | 9 | [![Version](https://img.shields.io/cocoapods/v/EasyRealm.svg?style=flat)](http://cocoapods.org/pods/EasyRealm) 10 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 11 | [![Platform](https://img.shields.io/cocoapods/p/EasyRealm.svg?style=flat)](http://cocoapods.org/pods/EasyRealm) 12 | [![Build Status](https://travis-ci.org/PoissonBallon/EasyRealm.svg?branch=master)](https://travis-ci.org/PoissonBallon/EasyRealm) 13 | [![Swift 4.2](https://img.shields.io/badge/Language-Swift%204.2-orange.svg)](https://developer.apple.com/swift/) 14 | [![codecov](https://codecov.io/gh/PoissonBallon/EasyRealm/branch/master/graph/badge.svg)](https://codecov.io/gh/PoissonBallon/EasyRealm) 15 | [![License](https://img.shields.io/cocoapods/l/EasyRealm.svg?style=flat)](http://cocoapods.org/pods/EasyRealm) 16 | 17 | EasyRealm is a micro-framework (less than 200 LOC) that helps you use Realm. 18 | 19 | ## Versions guides 20 | 21 | | Swift | Realm | EasyRealm | 22 | |-----------|-----------|-----------| 23 | | 3.0 | >= 2.4 | 2.0.1 | 24 | | 3.2 / 4.0 | >= 3.1.0 | >= 3.0.0 | 25 | | 4.2 | >= 3.10 | >= 3.4.0 | 26 | 27 | ## Keys Features 28 | 29 | EasyRealm import many features as : 30 | 31 | * Deep cascade deleting 32 | * Deep unmanaged object 33 | * Get managed object from unmanaged object. 34 | * Multithread Action (save / edit / delete / query) 35 | 36 | ## Promise 37 | 38 | EasyRealm make 4 promises : 39 | 40 | * EasyRealm never transform secretly an unmanaged Object to a managed Object and vice-versa. 41 | * EasyRealm let you use managed and unmanaged objects identically. 42 | * EasyRealm never manipulate thread behind your back, you keep full control of your process flow. 43 | * EasyRealm never handle Error for you. 44 | 45 | ## Examples 46 | 47 | ### Using 48 | 49 | * No inheritance. 50 | * No protocol. 51 | * Import Framework 52 | * Enjoy 53 | 54 | ### Save 55 | 56 | To save an object : 57 | 58 | ```swift 59 | let pokemon = Pokemon() 60 | try pokemon.er.save(update: true) 61 | //OR 62 | let managed = try pokemon.er.saved(update: true) 63 | ``` 64 | 65 | ### Edit 66 | 67 | To edit an object : 68 | 69 | ```swift 70 | let pokemon = Pokemon() 71 | 72 | try pokemon.er.edit { 73 | $0.level = 42 74 | } 75 | ``` 76 | 77 | 78 | ### Delete 79 | 80 | To delete an object : 81 | 82 | ```swift 83 | let pokemon = Pokemon(name: "Pikachu") 84 | 85 | try pokemon.er.delete() 86 | //or 87 | try pokemon.er.delete(with: .simple) 88 | //or 89 | try pokemon.er.delete(with: .cascade) 90 | 91 | ``` 92 | 93 | To delete all objects : 94 | ```swift 95 | try Pokemon.er.deleteAll() 96 | ``` 97 | 98 | ### Queries 99 | 100 | To query all objects of one type : 101 | ```swift 102 | let pokemons = try Pokemon.er.all() 103 | ``` 104 | 105 | To query one object by its primaryKey : 106 | ```swift 107 | let pokemon = Pokemon.er.fromRealm(with: "Pikachu") 108 | ``` 109 | 110 | ### Helping Variables 111 | 112 | * isManaged : 113 | ```swift 114 | pokemon.er.isManaged // Return true if realm != nil and return false if realm == nil 115 | ``` 116 | 117 | * managed : 118 | ```swift 119 | pokemon.er.managed // Return the managed version of the object if one exist in Realm Database 120 | ``` 121 | 122 | * unmanaged : 123 | ```swift 124 | pokemon.er.unmanaged // Return an unmanaged version of the object 125 | ``` 126 | 127 | 128 | ## Installation 129 | 130 | EasyRealm is available through [CocoaPods](http://cocoapods.org). To install 131 | it, simply add the following line to your Podfile: 132 | 133 | #### CocoaPods 134 | ```ruby 135 | use_frameworks! 136 | pod "EasyRealm", '~> 3.2.0' 137 | ``` 138 | 139 | #### Carthage 140 | ```ruby 141 | github 'PoissonBallon/EasyRealm' 142 | ``` 143 | 144 | ## Author 145 | 146 | * PoissonBallon [@poissonballon](https://twitter.com/poissonballon) 147 | 148 | ## License 149 | 150 | EasyRealm is available under the MIT license. See the LICENSE file for more info. 151 | 152 | ## Other 153 | 154 | * Thanks to [@error32](http://savinien.net/) for logo 155 | * Thanks to [@trpl](https://github.com/trpl) for text review 156 | -------------------------------------------------------------------------------- /Ressources/easy_realm_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PoissonBallon/EasyRealm/0e5005ac0f92213f438a6ba8d7d53ce4d4457ecb/Ressources/easy_realm_logo.png -------------------------------------------------------------------------------- /Ressources/easy_realm_logo.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PoissonBallon/EasyRealm/0e5005ac0f92213f438a6ba8d7d53ce4d4457ecb/Ressources/easy_realm_logo.sketch -------------------------------------------------------------------------------- /scripts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | pod trunk push EasyRealm.podspec --verbose 3 | --------------------------------------------------------------------------------