├── .gitignore ├── .travis.yml ├── Bookshelf.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── Bookshelf.xcscheme ├── Bookshelf.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── Bookshelf ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Author.swift ├── AuthorsTableViewController.swift ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Book.swift ├── Bookshelf.entitlements ├── DetailViewController.swift ├── Info.plist └── MasterViewController.swift ├── BookshelfTests ├── BookshelfTests.swift └── Info.plist ├── BookshelfUITests ├── BookshelfUITests.swift └── Info.plist ├── LICENSE ├── Podfile └── README.md /.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 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 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 | 46 | Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | # Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 61 | # 62 | # fastlane/report.xml 63 | # fastlane/screenshots 64 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: swift 2 | osx_image: xcode9.3 3 | before_install: 4 | - brew update 5 | - brew install tree 6 | - sudo gem install cocoapods 7 | - pod repo update 8 | - tree -L 1 9 | - pod install 10 | - tree -L 1 11 | script: 12 | - xcodebuild test -workspace Bookshelf.xcworkspace -scheme Bookshelf -destination 'platform=iOS Simulator,name=iPhone X,OS=11.3' | xcpretty 13 | -------------------------------------------------------------------------------- /Bookshelf.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1136EF0083A84734590F73CA /* Pods_BookshelfUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46289CF6C26B4F66F6668648 /* Pods_BookshelfUITests.framework */; }; 11 | 5701AB8E1C6916A900D7D9BB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5701AB8D1C6916A900D7D9BB /* AppDelegate.swift */; }; 12 | 5701AB901C6916A900D7D9BB /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5701AB8F1C6916A900D7D9BB /* MasterViewController.swift */; }; 13 | 5701AB921C6916A900D7D9BB /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5701AB911C6916A900D7D9BB /* DetailViewController.swift */; }; 14 | 5701AB951C6916A900D7D9BB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5701AB931C6916A900D7D9BB /* Main.storyboard */; }; 15 | 5701AB971C6916A900D7D9BB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5701AB961C6916A900D7D9BB /* Assets.xcassets */; }; 16 | 5701AB9A1C6916A900D7D9BB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5701AB981C6916A900D7D9BB /* LaunchScreen.storyboard */; }; 17 | 5701ABA51C6916A900D7D9BB /* BookshelfTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5701ABA41C6916A900D7D9BB /* BookshelfTests.swift */; }; 18 | 5701ABB01C6916A900D7D9BB /* BookshelfUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5701ABAF1C6916A900D7D9BB /* BookshelfUITests.swift */; }; 19 | 5701ABC01C69187200D7D9BB /* Book.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5701ABBF1C69187200D7D9BB /* Book.swift */; }; 20 | 576501C61DC7CBBB00898F15 /* KeychainAccess.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 576501C11DC7CBAF00898F15 /* KeychainAccess.framework */; }; 21 | 576501C81DC7CBBB00898F15 /* Kinvey.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 576501C21DC7CBAF00898F15 /* Kinvey.framework */; }; 22 | 576501CA1DC7CBBB00898F15 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 576501C31DC7CBAF00898F15 /* PromiseKit.framework */; }; 23 | 576501CC1DC7CBBB00898F15 /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 576501C41DC7CBAF00898F15 /* Realm.framework */; }; 24 | 576501CE1DC7CBBB00898F15 /* RealmSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 576501C51DC7CBAF00898F15 /* RealmSwift.framework */; }; 25 | 576501D01DC7CBBB00898F15 /* SVProgressHUD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 576501C01DC7CB9E00898F15 /* SVProgressHUD.framework */; }; 26 | 57A5264F1E412AA200B33A51 /* AuthorsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57A5264E1E412AA200B33A51 /* AuthorsTableViewController.swift */; }; 27 | 57A526511E412B0400B33A51 /* Author.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57A526501E412B0400B33A51 /* Author.swift */; }; 28 | 6AA5FF2C8DDE367D1F1A2AFA /* Pods_Bookshelf.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81E110661DC26F87619D83EA /* Pods_Bookshelf.framework */; }; 29 | B761E7BE18671702251B3270 /* Pods_BookshelfTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2F687139D5672BA953CBEC4 /* Pods_BookshelfTests.framework */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | 5701ABA11C6916A900D7D9BB /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 5701AB821C6916A900D7D9BB /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 5701AB891C6916A900D7D9BB; 38 | remoteInfo = Bookshelf; 39 | }; 40 | 5701ABAC1C6916A900D7D9BB /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = 5701AB821C6916A900D7D9BB /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = 5701AB891C6916A900D7D9BB; 45 | remoteInfo = Bookshelf; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXFileReference section */ 50 | 1A4D6D0F7477572A5A2AB7B4 /* Pods-Bookshelf.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bookshelf.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Bookshelf/Pods-Bookshelf.debug.xcconfig"; sourceTree = ""; }; 51 | 319512070CAB898710335BA0 /* Pods-BookshelfTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BookshelfTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BookshelfTests/Pods-BookshelfTests.debug.xcconfig"; sourceTree = ""; }; 52 | 46289CF6C26B4F66F6668648 /* Pods_BookshelfUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BookshelfUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 5701AB8A1C6916A900D7D9BB /* Bookshelf.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Bookshelf.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 5701AB8D1C6916A900D7D9BB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 55 | 5701AB8F1C6916A900D7D9BB /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; }; 56 | 5701AB911C6916A900D7D9BB /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; 57 | 5701AB941C6916A900D7D9BB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 58 | 5701AB961C6916A900D7D9BB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 59 | 5701AB991C6916A900D7D9BB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 60 | 5701AB9B1C6916A900D7D9BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 61 | 5701ABA01C6916A900D7D9BB /* BookshelfTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BookshelfTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | 5701ABA41C6916A900D7D9BB /* BookshelfTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookshelfTests.swift; sourceTree = ""; }; 63 | 5701ABA61C6916A900D7D9BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 64 | 5701ABAB1C6916A900D7D9BB /* BookshelfUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BookshelfUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 65 | 5701ABAF1C6916A900D7D9BB /* BookshelfUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookshelfUITests.swift; sourceTree = ""; }; 66 | 5701ABB11C6916A900D7D9BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 67 | 5701ABBF1C69187200D7D9BB /* Book.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Book.swift; sourceTree = ""; }; 68 | 576501C01DC7CB9E00898F15 /* SVProgressHUD.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SVProgressHUD.framework; path = "/Users/victor/Documents/iOS-Starter/Carthage/Build/iOS/SVProgressHUD.framework"; sourceTree = ""; }; 69 | 576501C11DC7CBAF00898F15 /* KeychainAccess.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KeychainAccess.framework; path = "/Users/victor/Documents/iOS-Starter/Carthage/Build/iOS/KeychainAccess.framework"; sourceTree = ""; }; 70 | 576501C21DC7CBAF00898F15 /* Kinvey.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kinvey.framework; path = "/Users/victor/Documents/iOS-Starter/Carthage/Build/iOS/Kinvey.framework"; sourceTree = ""; }; 71 | 576501C31DC7CBAF00898F15 /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PromiseKit.framework; path = "/Users/victor/Documents/iOS-Starter/Carthage/Build/iOS/PromiseKit.framework"; sourceTree = ""; }; 72 | 576501C41DC7CBAF00898F15 /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Realm.framework; path = "/Users/victor/Documents/iOS-Starter/Carthage/Build/iOS/Realm.framework"; sourceTree = ""; }; 73 | 576501C51DC7CBAF00898F15 /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RealmSwift.framework; path = "/Users/victor/Documents/iOS-Starter/Carthage/Build/iOS/RealmSwift.framework"; sourceTree = ""; }; 74 | 57A5264E1E412AA200B33A51 /* AuthorsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthorsTableViewController.swift; sourceTree = ""; }; 75 | 57A526501E412B0400B33A51 /* Author.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Author.swift; sourceTree = ""; }; 76 | 64448BC1EE73FB33974B0174 /* Pods-BookshelfUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BookshelfUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BookshelfUITests/Pods-BookshelfUITests.debug.xcconfig"; sourceTree = ""; }; 77 | 81E110661DC26F87619D83EA /* Pods_Bookshelf.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Bookshelf.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | 9611F0281D9CB3A30043C7D2 /* Bookshelf.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Bookshelf.entitlements; sourceTree = ""; }; 79 | C072197211DEB11BD54B2BD1 /* Pods-BookshelfTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BookshelfTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-BookshelfTests/Pods-BookshelfTests.release.xcconfig"; sourceTree = ""; }; 80 | C2F687139D5672BA953CBEC4 /* Pods_BookshelfTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BookshelfTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 81 | C68353677CAE56DF5C3A3E68 /* Pods-Bookshelf.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bookshelf.release.xcconfig"; path = "Pods/Target Support Files/Pods-Bookshelf/Pods-Bookshelf.release.xcconfig"; sourceTree = ""; }; 82 | F4886BEC1616C0A9C0469CE6 /* Pods-BookshelfUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BookshelfUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-BookshelfUITests/Pods-BookshelfUITests.release.xcconfig"; sourceTree = ""; }; 83 | /* End PBXFileReference section */ 84 | 85 | /* Begin PBXFrameworksBuildPhase section */ 86 | 5701AB871C6916A900D7D9BB /* Frameworks */ = { 87 | isa = PBXFrameworksBuildPhase; 88 | buildActionMask = 2147483647; 89 | files = ( 90 | 576501D01DC7CBBB00898F15 /* SVProgressHUD.framework in Frameworks */, 91 | 576501CC1DC7CBBB00898F15 /* Realm.framework in Frameworks */, 92 | 576501CE1DC7CBBB00898F15 /* RealmSwift.framework in Frameworks */, 93 | 576501CA1DC7CBBB00898F15 /* PromiseKit.framework in Frameworks */, 94 | 576501C81DC7CBBB00898F15 /* Kinvey.framework in Frameworks */, 95 | 576501C61DC7CBBB00898F15 /* KeychainAccess.framework in Frameworks */, 96 | 6AA5FF2C8DDE367D1F1A2AFA /* Pods_Bookshelf.framework in Frameworks */, 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | 5701AB9D1C6916A900D7D9BB /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | B761E7BE18671702251B3270 /* Pods_BookshelfTests.framework in Frameworks */, 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | 5701ABA81C6916A900D7D9BB /* Frameworks */ = { 109 | isa = PBXFrameworksBuildPhase; 110 | buildActionMask = 2147483647; 111 | files = ( 112 | 1136EF0083A84734590F73CA /* Pods_BookshelfUITests.framework in Frameworks */, 113 | ); 114 | runOnlyForDeploymentPostprocessing = 0; 115 | }; 116 | /* End PBXFrameworksBuildPhase section */ 117 | 118 | /* Begin PBXGroup section */ 119 | 25FD6AAB5C1BE0458C3A2769 /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 81E110661DC26F87619D83EA /* Pods_Bookshelf.framework */, 123 | C2F687139D5672BA953CBEC4 /* Pods_BookshelfTests.framework */, 124 | 46289CF6C26B4F66F6668648 /* Pods_BookshelfUITests.framework */, 125 | ); 126 | name = Frameworks; 127 | sourceTree = ""; 128 | }; 129 | 4367E01D353359C65F4CFF96 /* Pods */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 1A4D6D0F7477572A5A2AB7B4 /* Pods-Bookshelf.debug.xcconfig */, 133 | C68353677CAE56DF5C3A3E68 /* Pods-Bookshelf.release.xcconfig */, 134 | 319512070CAB898710335BA0 /* Pods-BookshelfTests.debug.xcconfig */, 135 | C072197211DEB11BD54B2BD1 /* Pods-BookshelfTests.release.xcconfig */, 136 | 64448BC1EE73FB33974B0174 /* Pods-BookshelfUITests.debug.xcconfig */, 137 | F4886BEC1616C0A9C0469CE6 /* Pods-BookshelfUITests.release.xcconfig */, 138 | ); 139 | name = Pods; 140 | sourceTree = ""; 141 | }; 142 | 5701AB811C6916A900D7D9BB = { 143 | isa = PBXGroup; 144 | children = ( 145 | 5701AB8C1C6916A900D7D9BB /* Bookshelf */, 146 | 5701ABA31C6916A900D7D9BB /* BookshelfTests */, 147 | 5701ABAE1C6916A900D7D9BB /* BookshelfUITests */, 148 | 5701AB8B1C6916A900D7D9BB /* Products */, 149 | 25FD6AAB5C1BE0458C3A2769 /* Frameworks */, 150 | 4367E01D353359C65F4CFF96 /* Pods */, 151 | 575AB72D1FBE4BF700AD84A2 /* Recovered References */, 152 | ); 153 | sourceTree = ""; 154 | }; 155 | 5701AB8B1C6916A900D7D9BB /* Products */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 5701AB8A1C6916A900D7D9BB /* Bookshelf.app */, 159 | 5701ABA01C6916A900D7D9BB /* BookshelfTests.xctest */, 160 | 5701ABAB1C6916A900D7D9BB /* BookshelfUITests.xctest */, 161 | ); 162 | name = Products; 163 | sourceTree = ""; 164 | }; 165 | 5701AB8C1C6916A900D7D9BB /* Bookshelf */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 9611F0281D9CB3A30043C7D2 /* Bookshelf.entitlements */, 169 | 5701AB8D1C6916A900D7D9BB /* AppDelegate.swift */, 170 | 5701AB8F1C6916A900D7D9BB /* MasterViewController.swift */, 171 | 5701AB911C6916A900D7D9BB /* DetailViewController.swift */, 172 | 5701AB931C6916A900D7D9BB /* Main.storyboard */, 173 | 5701AB961C6916A900D7D9BB /* Assets.xcassets */, 174 | 5701AB981C6916A900D7D9BB /* LaunchScreen.storyboard */, 175 | 5701AB9B1C6916A900D7D9BB /* Info.plist */, 176 | 5701ABBF1C69187200D7D9BB /* Book.swift */, 177 | 57A526501E412B0400B33A51 /* Author.swift */, 178 | 57A5264E1E412AA200B33A51 /* AuthorsTableViewController.swift */, 179 | ); 180 | path = Bookshelf; 181 | sourceTree = ""; 182 | }; 183 | 5701ABA31C6916A900D7D9BB /* BookshelfTests */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 5701ABA41C6916A900D7D9BB /* BookshelfTests.swift */, 187 | 5701ABA61C6916A900D7D9BB /* Info.plist */, 188 | ); 189 | path = BookshelfTests; 190 | sourceTree = ""; 191 | }; 192 | 5701ABAE1C6916A900D7D9BB /* BookshelfUITests */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 5701ABAF1C6916A900D7D9BB /* BookshelfUITests.swift */, 196 | 5701ABB11C6916A900D7D9BB /* Info.plist */, 197 | ); 198 | path = BookshelfUITests; 199 | sourceTree = ""; 200 | }; 201 | 575AB72D1FBE4BF700AD84A2 /* Recovered References */ = { 202 | isa = PBXGroup; 203 | children = ( 204 | 576501C01DC7CB9E00898F15 /* SVProgressHUD.framework */, 205 | 576501C41DC7CBAF00898F15 /* Realm.framework */, 206 | 576501C51DC7CBAF00898F15 /* RealmSwift.framework */, 207 | 576501C31DC7CBAF00898F15 /* PromiseKit.framework */, 208 | 576501C21DC7CBAF00898F15 /* Kinvey.framework */, 209 | 576501C11DC7CBAF00898F15 /* KeychainAccess.framework */, 210 | ); 211 | name = "Recovered References"; 212 | sourceTree = ""; 213 | }; 214 | /* End PBXGroup section */ 215 | 216 | /* Begin PBXNativeTarget section */ 217 | 5701AB891C6916A900D7D9BB /* Bookshelf */ = { 218 | isa = PBXNativeTarget; 219 | buildConfigurationList = 5701ABB41C6916A900D7D9BB /* Build configuration list for PBXNativeTarget "Bookshelf" */; 220 | buildPhases = ( 221 | 9E037BE65DB18802DE6F2263 /* [CP] Check Pods Manifest.lock */, 222 | 5701AB861C6916A900D7D9BB /* Sources */, 223 | 5701AB871C6916A900D7D9BB /* Frameworks */, 224 | 5701AB881C6916A900D7D9BB /* Resources */, 225 | 7BB3277FAFB65E2DAA6A60F3 /* [CP] Embed Pods Frameworks */, 226 | ); 227 | buildRules = ( 228 | ); 229 | dependencies = ( 230 | ); 231 | name = Bookshelf; 232 | productName = Bookshelf; 233 | productReference = 5701AB8A1C6916A900D7D9BB /* Bookshelf.app */; 234 | productType = "com.apple.product-type.application"; 235 | }; 236 | 5701AB9F1C6916A900D7D9BB /* BookshelfTests */ = { 237 | isa = PBXNativeTarget; 238 | buildConfigurationList = 5701ABB71C6916A900D7D9BB /* Build configuration list for PBXNativeTarget "BookshelfTests" */; 239 | buildPhases = ( 240 | 738E4D86C61C92C710ACF742 /* [CP] Check Pods Manifest.lock */, 241 | 5701AB9C1C6916A900D7D9BB /* Sources */, 242 | 5701AB9D1C6916A900D7D9BB /* Frameworks */, 243 | 5701AB9E1C6916A900D7D9BB /* Resources */, 244 | ); 245 | buildRules = ( 246 | ); 247 | dependencies = ( 248 | 5701ABA21C6916A900D7D9BB /* PBXTargetDependency */, 249 | ); 250 | name = BookshelfTests; 251 | productName = BookshelfTests; 252 | productReference = 5701ABA01C6916A900D7D9BB /* BookshelfTests.xctest */; 253 | productType = "com.apple.product-type.bundle.unit-test"; 254 | }; 255 | 5701ABAA1C6916A900D7D9BB /* BookshelfUITests */ = { 256 | isa = PBXNativeTarget; 257 | buildConfigurationList = 5701ABBA1C6916A900D7D9BB /* Build configuration list for PBXNativeTarget "BookshelfUITests" */; 258 | buildPhases = ( 259 | C8D6AA6B6C35F0015ADDC946 /* [CP] Check Pods Manifest.lock */, 260 | 5701ABA71C6916A900D7D9BB /* Sources */, 261 | 5701ABA81C6916A900D7D9BB /* Frameworks */, 262 | 5701ABA91C6916A900D7D9BB /* Resources */, 263 | ); 264 | buildRules = ( 265 | ); 266 | dependencies = ( 267 | 5701ABAD1C6916A900D7D9BB /* PBXTargetDependency */, 268 | ); 269 | name = BookshelfUITests; 270 | productName = BookshelfUITests; 271 | productReference = 5701ABAB1C6916A900D7D9BB /* BookshelfUITests.xctest */; 272 | productType = "com.apple.product-type.bundle.ui-testing"; 273 | }; 274 | /* End PBXNativeTarget section */ 275 | 276 | /* Begin PBXProject section */ 277 | 5701AB821C6916A900D7D9BB /* Project object */ = { 278 | isa = PBXProject; 279 | attributes = { 280 | LastSwiftUpdateCheck = 0720; 281 | LastUpgradeCheck = 0930; 282 | ORGANIZATIONNAME = Kinvey; 283 | TargetAttributes = { 284 | 5701AB891C6916A900D7D9BB = { 285 | CreatedOnToolsVersion = 7.2.1; 286 | DevelopmentTeam = 5W7CYNR7UE; 287 | LastSwiftMigration = 0800; 288 | SystemCapabilities = { 289 | com.apple.Keychain = { 290 | enabled = 1; 291 | }; 292 | }; 293 | }; 294 | 5701AB9F1C6916A900D7D9BB = { 295 | CreatedOnToolsVersion = 7.2.1; 296 | LastSwiftMigration = 0800; 297 | TestTargetID = 5701AB891C6916A900D7D9BB; 298 | }; 299 | 5701ABAA1C6916A900D7D9BB = { 300 | CreatedOnToolsVersion = 7.2.1; 301 | LastSwiftMigration = 0800; 302 | TestTargetID = 5701AB891C6916A900D7D9BB; 303 | }; 304 | }; 305 | }; 306 | buildConfigurationList = 5701AB851C6916A900D7D9BB /* Build configuration list for PBXProject "Bookshelf" */; 307 | compatibilityVersion = "Xcode 3.2"; 308 | developmentRegion = English; 309 | hasScannedForEncodings = 0; 310 | knownRegions = ( 311 | en, 312 | Base, 313 | ); 314 | mainGroup = 5701AB811C6916A900D7D9BB; 315 | productRefGroup = 5701AB8B1C6916A900D7D9BB /* Products */; 316 | projectDirPath = ""; 317 | projectRoot = ""; 318 | targets = ( 319 | 5701AB891C6916A900D7D9BB /* Bookshelf */, 320 | 5701AB9F1C6916A900D7D9BB /* BookshelfTests */, 321 | 5701ABAA1C6916A900D7D9BB /* BookshelfUITests */, 322 | ); 323 | }; 324 | /* End PBXProject section */ 325 | 326 | /* Begin PBXResourcesBuildPhase section */ 327 | 5701AB881C6916A900D7D9BB /* Resources */ = { 328 | isa = PBXResourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | 5701AB9A1C6916A900D7D9BB /* LaunchScreen.storyboard in Resources */, 332 | 5701AB971C6916A900D7D9BB /* Assets.xcassets in Resources */, 333 | 5701AB951C6916A900D7D9BB /* Main.storyboard in Resources */, 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | }; 337 | 5701AB9E1C6916A900D7D9BB /* Resources */ = { 338 | isa = PBXResourcesBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | ); 342 | runOnlyForDeploymentPostprocessing = 0; 343 | }; 344 | 5701ABA91C6916A900D7D9BB /* Resources */ = { 345 | isa = PBXResourcesBuildPhase; 346 | buildActionMask = 2147483647; 347 | files = ( 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | /* End PBXResourcesBuildPhase section */ 352 | 353 | /* Begin PBXShellScriptBuildPhase section */ 354 | 738E4D86C61C92C710ACF742 /* [CP] Check Pods Manifest.lock */ = { 355 | isa = PBXShellScriptBuildPhase; 356 | buildActionMask = 2147483647; 357 | files = ( 358 | ); 359 | inputPaths = ( 360 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 361 | "${PODS_ROOT}/Manifest.lock", 362 | ); 363 | name = "[CP] Check Pods Manifest.lock"; 364 | outputPaths = ( 365 | "$(DERIVED_FILE_DIR)/Pods-BookshelfTests-checkManifestLockResult.txt", 366 | ); 367 | runOnlyForDeploymentPostprocessing = 0; 368 | shellPath = /bin/sh; 369 | 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"; 370 | showEnvVarsInLog = 0; 371 | }; 372 | 7BB3277FAFB65E2DAA6A60F3 /* [CP] Embed Pods Frameworks */ = { 373 | isa = PBXShellScriptBuildPhase; 374 | buildActionMask = 2147483647; 375 | files = ( 376 | ); 377 | inputPaths = ( 378 | "${PODS_ROOT}/Target Support Files/Pods-Bookshelf/Pods-Bookshelf-frameworks.sh", 379 | "${BUILT_PRODUCTS_DIR}/KeychainAccess/KeychainAccess.framework", 380 | "${BUILT_PRODUCTS_DIR}/Kinvey/Kinvey.framework", 381 | "${BUILT_PRODUCTS_DIR}/ObjectMapper/ObjectMapper.framework", 382 | "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", 383 | "${BUILT_PRODUCTS_DIR}/PubNub/PubNub.framework", 384 | "${BUILT_PRODUCTS_DIR}/Realm/Realm.framework", 385 | "${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework", 386 | "${BUILT_PRODUCTS_DIR}/SVProgressHUD/SVProgressHUD.framework", 387 | "${BUILT_PRODUCTS_DIR}/SwiftyBeaver/SwiftyBeaver.framework", 388 | ); 389 | name = "[CP] Embed Pods Frameworks"; 390 | outputPaths = ( 391 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainAccess.framework", 392 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Kinvey.framework", 393 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ObjectMapper.framework", 394 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", 395 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PubNub.framework", 396 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework", 397 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework", 398 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SVProgressHUD.framework", 399 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyBeaver.framework", 400 | ); 401 | runOnlyForDeploymentPostprocessing = 0; 402 | shellPath = /bin/sh; 403 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Bookshelf/Pods-Bookshelf-frameworks.sh\"\n"; 404 | showEnvVarsInLog = 0; 405 | }; 406 | 9E037BE65DB18802DE6F2263 /* [CP] Check Pods Manifest.lock */ = { 407 | isa = PBXShellScriptBuildPhase; 408 | buildActionMask = 2147483647; 409 | files = ( 410 | ); 411 | inputPaths = ( 412 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 413 | "${PODS_ROOT}/Manifest.lock", 414 | ); 415 | name = "[CP] Check Pods Manifest.lock"; 416 | outputPaths = ( 417 | "$(DERIVED_FILE_DIR)/Pods-Bookshelf-checkManifestLockResult.txt", 418 | ); 419 | runOnlyForDeploymentPostprocessing = 0; 420 | shellPath = /bin/sh; 421 | 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"; 422 | showEnvVarsInLog = 0; 423 | }; 424 | C8D6AA6B6C35F0015ADDC946 /* [CP] Check Pods Manifest.lock */ = { 425 | isa = PBXShellScriptBuildPhase; 426 | buildActionMask = 2147483647; 427 | files = ( 428 | ); 429 | inputPaths = ( 430 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 431 | "${PODS_ROOT}/Manifest.lock", 432 | ); 433 | name = "[CP] Check Pods Manifest.lock"; 434 | outputPaths = ( 435 | "$(DERIVED_FILE_DIR)/Pods-BookshelfUITests-checkManifestLockResult.txt", 436 | ); 437 | runOnlyForDeploymentPostprocessing = 0; 438 | shellPath = /bin/sh; 439 | 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"; 440 | showEnvVarsInLog = 0; 441 | }; 442 | /* End PBXShellScriptBuildPhase section */ 443 | 444 | /* Begin PBXSourcesBuildPhase section */ 445 | 5701AB861C6916A900D7D9BB /* Sources */ = { 446 | isa = PBXSourcesBuildPhase; 447 | buildActionMask = 2147483647; 448 | files = ( 449 | 57A526511E412B0400B33A51 /* Author.swift in Sources */, 450 | 5701ABC01C69187200D7D9BB /* Book.swift in Sources */, 451 | 5701AB921C6916A900D7D9BB /* DetailViewController.swift in Sources */, 452 | 57A5264F1E412AA200B33A51 /* AuthorsTableViewController.swift in Sources */, 453 | 5701AB901C6916A900D7D9BB /* MasterViewController.swift in Sources */, 454 | 5701AB8E1C6916A900D7D9BB /* AppDelegate.swift in Sources */, 455 | ); 456 | runOnlyForDeploymentPostprocessing = 0; 457 | }; 458 | 5701AB9C1C6916A900D7D9BB /* Sources */ = { 459 | isa = PBXSourcesBuildPhase; 460 | buildActionMask = 2147483647; 461 | files = ( 462 | 5701ABA51C6916A900D7D9BB /* BookshelfTests.swift in Sources */, 463 | ); 464 | runOnlyForDeploymentPostprocessing = 0; 465 | }; 466 | 5701ABA71C6916A900D7D9BB /* Sources */ = { 467 | isa = PBXSourcesBuildPhase; 468 | buildActionMask = 2147483647; 469 | files = ( 470 | 5701ABB01C6916A900D7D9BB /* BookshelfUITests.swift in Sources */, 471 | ); 472 | runOnlyForDeploymentPostprocessing = 0; 473 | }; 474 | /* End PBXSourcesBuildPhase section */ 475 | 476 | /* Begin PBXTargetDependency section */ 477 | 5701ABA21C6916A900D7D9BB /* PBXTargetDependency */ = { 478 | isa = PBXTargetDependency; 479 | target = 5701AB891C6916A900D7D9BB /* Bookshelf */; 480 | targetProxy = 5701ABA11C6916A900D7D9BB /* PBXContainerItemProxy */; 481 | }; 482 | 5701ABAD1C6916A900D7D9BB /* PBXTargetDependency */ = { 483 | isa = PBXTargetDependency; 484 | target = 5701AB891C6916A900D7D9BB /* Bookshelf */; 485 | targetProxy = 5701ABAC1C6916A900D7D9BB /* PBXContainerItemProxy */; 486 | }; 487 | /* End PBXTargetDependency section */ 488 | 489 | /* Begin PBXVariantGroup section */ 490 | 5701AB931C6916A900D7D9BB /* Main.storyboard */ = { 491 | isa = PBXVariantGroup; 492 | children = ( 493 | 5701AB941C6916A900D7D9BB /* Base */, 494 | ); 495 | name = Main.storyboard; 496 | sourceTree = ""; 497 | }; 498 | 5701AB981C6916A900D7D9BB /* LaunchScreen.storyboard */ = { 499 | isa = PBXVariantGroup; 500 | children = ( 501 | 5701AB991C6916A900D7D9BB /* Base */, 502 | ); 503 | name = LaunchScreen.storyboard; 504 | sourceTree = ""; 505 | }; 506 | /* End PBXVariantGroup section */ 507 | 508 | /* Begin XCBuildConfiguration section */ 509 | 5701ABB21C6916A900D7D9BB /* Debug */ = { 510 | isa = XCBuildConfiguration; 511 | buildSettings = { 512 | ALWAYS_SEARCH_USER_PATHS = NO; 513 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 514 | CLANG_CXX_LIBRARY = "libc++"; 515 | CLANG_ENABLE_MODULES = YES; 516 | CLANG_ENABLE_OBJC_ARC = YES; 517 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 518 | CLANG_WARN_BOOL_CONVERSION = YES; 519 | CLANG_WARN_COMMA = YES; 520 | CLANG_WARN_CONSTANT_CONVERSION = YES; 521 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 522 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 523 | CLANG_WARN_EMPTY_BODY = YES; 524 | CLANG_WARN_ENUM_CONVERSION = YES; 525 | CLANG_WARN_INFINITE_RECURSION = YES; 526 | CLANG_WARN_INT_CONVERSION = YES; 527 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 528 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 529 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 530 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 531 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 532 | CLANG_WARN_STRICT_PROTOTYPES = YES; 533 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 534 | CLANG_WARN_UNREACHABLE_CODE = YES; 535 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 536 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 537 | COPY_PHASE_STRIP = NO; 538 | DEBUG_INFORMATION_FORMAT = dwarf; 539 | ENABLE_STRICT_OBJC_MSGSEND = YES; 540 | ENABLE_TESTABILITY = YES; 541 | GCC_C_LANGUAGE_STANDARD = gnu99; 542 | GCC_DYNAMIC_NO_PIC = NO; 543 | GCC_NO_COMMON_BLOCKS = YES; 544 | GCC_OPTIMIZATION_LEVEL = 0; 545 | GCC_PREPROCESSOR_DEFINITIONS = ( 546 | "DEBUG=1", 547 | "$(inherited)", 548 | ); 549 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 550 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 551 | GCC_WARN_UNDECLARED_SELECTOR = YES; 552 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 553 | GCC_WARN_UNUSED_FUNCTION = YES; 554 | GCC_WARN_UNUSED_VARIABLE = YES; 555 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 556 | MTL_ENABLE_DEBUG_INFO = YES; 557 | ONLY_ACTIVE_ARCH = YES; 558 | SDKROOT = iphoneos; 559 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 560 | TARGETED_DEVICE_FAMILY = "1,2"; 561 | }; 562 | name = Debug; 563 | }; 564 | 5701ABB31C6916A900D7D9BB /* Release */ = { 565 | isa = XCBuildConfiguration; 566 | buildSettings = { 567 | ALWAYS_SEARCH_USER_PATHS = NO; 568 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 569 | CLANG_CXX_LIBRARY = "libc++"; 570 | CLANG_ENABLE_MODULES = YES; 571 | CLANG_ENABLE_OBJC_ARC = YES; 572 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 573 | CLANG_WARN_BOOL_CONVERSION = YES; 574 | CLANG_WARN_COMMA = YES; 575 | CLANG_WARN_CONSTANT_CONVERSION = YES; 576 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 577 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 578 | CLANG_WARN_EMPTY_BODY = YES; 579 | CLANG_WARN_ENUM_CONVERSION = YES; 580 | CLANG_WARN_INFINITE_RECURSION = YES; 581 | CLANG_WARN_INT_CONVERSION = YES; 582 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 583 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 584 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 585 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 586 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 587 | CLANG_WARN_STRICT_PROTOTYPES = YES; 588 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 589 | CLANG_WARN_UNREACHABLE_CODE = YES; 590 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 591 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 592 | COPY_PHASE_STRIP = NO; 593 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 594 | ENABLE_NS_ASSERTIONS = NO; 595 | ENABLE_STRICT_OBJC_MSGSEND = YES; 596 | GCC_C_LANGUAGE_STANDARD = gnu99; 597 | GCC_NO_COMMON_BLOCKS = YES; 598 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 599 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 600 | GCC_WARN_UNDECLARED_SELECTOR = YES; 601 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 602 | GCC_WARN_UNUSED_FUNCTION = YES; 603 | GCC_WARN_UNUSED_VARIABLE = YES; 604 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 605 | MTL_ENABLE_DEBUG_INFO = NO; 606 | SDKROOT = iphoneos; 607 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 608 | TARGETED_DEVICE_FAMILY = "1,2"; 609 | VALIDATE_PRODUCT = YES; 610 | }; 611 | name = Release; 612 | }; 613 | 5701ABB51C6916A900D7D9BB /* Debug */ = { 614 | isa = XCBuildConfiguration; 615 | baseConfigurationReference = 1A4D6D0F7477572A5A2AB7B4 /* Pods-Bookshelf.debug.xcconfig */; 616 | buildSettings = { 617 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 618 | CODE_SIGN_ENTITLEMENTS = Bookshelf/Bookshelf.entitlements; 619 | DEVELOPMENT_TEAM = 5W7CYNR7UE; 620 | INFOPLIST_FILE = Bookshelf/Info.plist; 621 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 622 | PRODUCT_BUNDLE_IDENTIFIER = com.kinvey.Bookshelf; 623 | PRODUCT_NAME = "$(TARGET_NAME)"; 624 | SWIFT_VERSION = 4.2; 625 | }; 626 | name = Debug; 627 | }; 628 | 5701ABB61C6916A900D7D9BB /* Release */ = { 629 | isa = XCBuildConfiguration; 630 | baseConfigurationReference = C68353677CAE56DF5C3A3E68 /* Pods-Bookshelf.release.xcconfig */; 631 | buildSettings = { 632 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 633 | CODE_SIGN_ENTITLEMENTS = Bookshelf/Bookshelf.entitlements; 634 | DEVELOPMENT_TEAM = 5W7CYNR7UE; 635 | INFOPLIST_FILE = Bookshelf/Info.plist; 636 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 637 | PRODUCT_BUNDLE_IDENTIFIER = com.kinvey.Bookshelf; 638 | PRODUCT_NAME = "$(TARGET_NAME)"; 639 | SWIFT_VERSION = 4.2; 640 | }; 641 | name = Release; 642 | }; 643 | 5701ABB81C6916A900D7D9BB /* Debug */ = { 644 | isa = XCBuildConfiguration; 645 | baseConfigurationReference = 319512070CAB898710335BA0 /* Pods-BookshelfTests.debug.xcconfig */; 646 | buildSettings = { 647 | BUNDLE_LOADER = "$(TEST_HOST)"; 648 | INFOPLIST_FILE = BookshelfTests/Info.plist; 649 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 650 | PRODUCT_BUNDLE_IDENTIFIER = com.kinvey.BookshelfTests; 651 | PRODUCT_NAME = "$(TARGET_NAME)"; 652 | SWIFT_VERSION = 4.2; 653 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Bookshelf.app/Bookshelf"; 654 | }; 655 | name = Debug; 656 | }; 657 | 5701ABB91C6916A900D7D9BB /* Release */ = { 658 | isa = XCBuildConfiguration; 659 | baseConfigurationReference = C072197211DEB11BD54B2BD1 /* Pods-BookshelfTests.release.xcconfig */; 660 | buildSettings = { 661 | BUNDLE_LOADER = "$(TEST_HOST)"; 662 | INFOPLIST_FILE = BookshelfTests/Info.plist; 663 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 664 | PRODUCT_BUNDLE_IDENTIFIER = com.kinvey.BookshelfTests; 665 | PRODUCT_NAME = "$(TARGET_NAME)"; 666 | SWIFT_VERSION = 4.2; 667 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Bookshelf.app/Bookshelf"; 668 | }; 669 | name = Release; 670 | }; 671 | 5701ABBB1C6916A900D7D9BB /* Debug */ = { 672 | isa = XCBuildConfiguration; 673 | baseConfigurationReference = 64448BC1EE73FB33974B0174 /* Pods-BookshelfUITests.debug.xcconfig */; 674 | buildSettings = { 675 | INFOPLIST_FILE = BookshelfUITests/Info.plist; 676 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 677 | PRODUCT_BUNDLE_IDENTIFIER = com.kinvey.BookshelfUITests; 678 | PRODUCT_NAME = "$(TARGET_NAME)"; 679 | SWIFT_VERSION = 4.2; 680 | TEST_TARGET_NAME = Bookshelf; 681 | USES_XCTRUNNER = YES; 682 | }; 683 | name = Debug; 684 | }; 685 | 5701ABBC1C6916A900D7D9BB /* Release */ = { 686 | isa = XCBuildConfiguration; 687 | baseConfigurationReference = F4886BEC1616C0A9C0469CE6 /* Pods-BookshelfUITests.release.xcconfig */; 688 | buildSettings = { 689 | INFOPLIST_FILE = BookshelfUITests/Info.plist; 690 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 691 | PRODUCT_BUNDLE_IDENTIFIER = com.kinvey.BookshelfUITests; 692 | PRODUCT_NAME = "$(TARGET_NAME)"; 693 | SWIFT_VERSION = 4.2; 694 | TEST_TARGET_NAME = Bookshelf; 695 | USES_XCTRUNNER = YES; 696 | }; 697 | name = Release; 698 | }; 699 | /* End XCBuildConfiguration section */ 700 | 701 | /* Begin XCConfigurationList section */ 702 | 5701AB851C6916A900D7D9BB /* Build configuration list for PBXProject "Bookshelf" */ = { 703 | isa = XCConfigurationList; 704 | buildConfigurations = ( 705 | 5701ABB21C6916A900D7D9BB /* Debug */, 706 | 5701ABB31C6916A900D7D9BB /* Release */, 707 | ); 708 | defaultConfigurationIsVisible = 0; 709 | defaultConfigurationName = Release; 710 | }; 711 | 5701ABB41C6916A900D7D9BB /* Build configuration list for PBXNativeTarget "Bookshelf" */ = { 712 | isa = XCConfigurationList; 713 | buildConfigurations = ( 714 | 5701ABB51C6916A900D7D9BB /* Debug */, 715 | 5701ABB61C6916A900D7D9BB /* Release */, 716 | ); 717 | defaultConfigurationIsVisible = 0; 718 | defaultConfigurationName = Release; 719 | }; 720 | 5701ABB71C6916A900D7D9BB /* Build configuration list for PBXNativeTarget "BookshelfTests" */ = { 721 | isa = XCConfigurationList; 722 | buildConfigurations = ( 723 | 5701ABB81C6916A900D7D9BB /* Debug */, 724 | 5701ABB91C6916A900D7D9BB /* Release */, 725 | ); 726 | defaultConfigurationIsVisible = 0; 727 | defaultConfigurationName = Release; 728 | }; 729 | 5701ABBA1C6916A900D7D9BB /* Build configuration list for PBXNativeTarget "BookshelfUITests" */ = { 730 | isa = XCConfigurationList; 731 | buildConfigurations = ( 732 | 5701ABBB1C6916A900D7D9BB /* Debug */, 733 | 5701ABBC1C6916A900D7D9BB /* Release */, 734 | ); 735 | defaultConfigurationIsVisible = 0; 736 | defaultConfigurationName = Release; 737 | }; 738 | /* End XCConfigurationList section */ 739 | }; 740 | rootObject = 5701AB821C6916A900D7D9BB /* Project object */; 741 | } 742 | -------------------------------------------------------------------------------- /Bookshelf.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Bookshelf.xcodeproj/xcshareddata/xcschemes/Bookshelf.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Bookshelf.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Bookshelf.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Bookshelf/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Bookshelf 4 | // 5 | // Created by Victor Barros on 2016-02-08. 6 | // Copyright © 2016 Kinvey. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Kinvey 11 | import SVProgressHUD 12 | 13 | @UIApplicationMain 14 | class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { 15 | 16 | var window: UIWindow? 17 | lazy var fileStore: FileStore = { 18 | return FileStore() 19 | }() 20 | 21 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 22 | let splitViewController = self.window!.rootViewController as! UISplitViewController 23 | let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController 24 | navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem 25 | splitViewController.delegate = self 26 | 27 | Kinvey.sharedClient.initialize(appKey: "", appSecret: "") { 28 | switch $0 { 29 | case .success(let user): 30 | if user == nil { 31 | self.userExists() 32 | } 33 | case .failure: 34 | SVProgressHUD.show() 35 | self.userExists() 36 | } 37 | } 38 | 39 | return true 40 | } 41 | 42 | private func userExists() { 43 | User.exists(username: "test", options: nil) { 44 | switch $0 { 45 | case .success(let exists): 46 | if exists { 47 | self.userLogin() 48 | } else { 49 | self.userSignup() 50 | } 51 | case .failure(let error): 52 | SVProgressHUD.showError(withStatus: error.localizedDescription) 53 | } 54 | } 55 | } 56 | 57 | private func userLogin() { 58 | User.login(username: "test", password: "test") { 59 | SVProgressHUD.dismiss() 60 | switch $0 { 61 | case .success(let user): 62 | print(user) 63 | case .failure(let error): 64 | SVProgressHUD.showError(withStatus: error.localizedDescription) 65 | } 66 | } 67 | } 68 | 69 | private func userSignup() { 70 | User.signup(username: "test", password: "test", options: nil) { 71 | SVProgressHUD.dismiss() 72 | switch $0 { 73 | case .success(let user): 74 | print(user) 75 | case .failure(let error): 76 | SVProgressHUD.showError(withStatus: error.localizedDescription) 77 | } 78 | } 79 | } 80 | 81 | func applicationWillResignActive(_ application: UIApplication) { 82 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 83 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 84 | } 85 | 86 | func applicationDidEnterBackground(_ application: UIApplication) { 87 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 88 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 89 | } 90 | 91 | func applicationWillEnterForeground(_ application: UIApplication) { 92 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 93 | } 94 | 95 | func applicationDidBecomeActive(_ application: UIApplication) { 96 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 97 | } 98 | 99 | func applicationWillTerminate(_ application: UIApplication) { 100 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 101 | } 102 | 103 | // MARK: - Split view 104 | 105 | func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool { 106 | guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false } 107 | guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false } 108 | if topAsDetailController.book == nil { 109 | // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. 110 | return true 111 | } 112 | return false 113 | } 114 | 115 | } 116 | 117 | -------------------------------------------------------------------------------- /Bookshelf/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Bookshelf/Author.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Person.swift 3 | // Bookshelf 4 | // 5 | // Created by Victor Hugo on 2017-01-31. 6 | // Copyright © 2017 Kinvey. All rights reserved. 7 | // 8 | 9 | import Kinvey 10 | import RealmSwift 11 | import ObjectMapper 12 | 13 | class Author: Object, Codable { 14 | 15 | @objc dynamic var firstName: String? 16 | @objc dynamic var lastName: String? 17 | let books = LinkingObjects(fromType: Book.self, property: "authors") 18 | 19 | enum CodingKeys: String, CodingKey { 20 | case firstName = "first_name" 21 | case lastName = "last_name" 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Bookshelf/AuthorsTableViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AuthorsTableViewController.swift 3 | // Bookshelf 4 | // 5 | // Created by Victor Hugo on 2017-01-31. 6 | // Copyright © 2017 Kinvey. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import RealmSwift 11 | 12 | class AuthorTableViewCell: UITableViewCell, UITextFieldDelegate { 13 | 14 | @IBOutlet weak var textField: UITextField! 15 | 16 | var authorChanged: ((Author?) -> Void)? 17 | var author: Author? { 18 | didSet { 19 | if let author = author, 20 | let firstName = author.firstName, 21 | !firstName.isEmpty, 22 | let lastName = author.lastName, 23 | !lastName.isEmpty 24 | { 25 | textField.text = "\(firstName) \(lastName)" 26 | } else { 27 | textField.text = "" 28 | } 29 | authorChanged?(author) 30 | } 31 | } 32 | 33 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 34 | if let author = author, 35 | let text = textField.text, 36 | !text.isEmpty, 37 | text.contains(" ") 38 | { 39 | var components = text.components(separatedBy: " ") 40 | author.firstName = components.first! 41 | components.removeFirst() 42 | author.lastName = components.joined(separator: " ") 43 | } else { 44 | author = nil 45 | } 46 | textField.resignFirstResponder() 47 | return false 48 | } 49 | 50 | } 51 | 52 | class AuthorsTableViewController: UITableViewController { 53 | 54 | var authors: [Author]! { 55 | didSet { 56 | tableView.reloadData() 57 | } 58 | } 59 | 60 | override func viewDidLoad() { 61 | super.viewDidLoad() 62 | 63 | // Uncomment the following line to preserve selection between presentations 64 | // self.clearsSelectionOnViewWillAppear = false 65 | 66 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 67 | // self.navigationItem.rightBarButtonItem = self.editButtonItem() 68 | } 69 | 70 | override func didReceiveMemoryWarning() { 71 | super.didReceiveMemoryWarning() 72 | // Dispose of any resources that can be recreated. 73 | } 74 | 75 | // MARK: - Table view data source 76 | 77 | override func numberOfSections(in tableView: UITableView) -> Int { 78 | // #warning Incomplete implementation, return the number of sections 79 | return 1 80 | } 81 | 82 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 83 | switch section { 84 | case 0: return authors.count 85 | default: return 0 86 | } 87 | } 88 | 89 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 90 | let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) as! AuthorTableViewCell 91 | 92 | let index = indexPath.row 93 | let author = authors[index] 94 | cell.author = author 95 | cell.authorChanged = { author in 96 | if author == nil { 97 | tableView.beginUpdates() 98 | self.authors.remove(at: index) 99 | tableView.deleteRows(at: [indexPath], with: .automatic) 100 | tableView.endUpdates() 101 | } 102 | } 103 | 104 | return cell 105 | } 106 | 107 | /* 108 | // Override to support conditional editing of the table view. 109 | override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { 110 | // Return false if you do not want the specified item to be editable. 111 | return true 112 | } 113 | */ 114 | 115 | /* 116 | // Override to support editing the table view. 117 | override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { 118 | if editingStyle == .delete { 119 | // Delete the row from the data source 120 | tableView.deleteRows(at: [indexPath], with: .fade) 121 | } else if editingStyle == .insert { 122 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 123 | } 124 | } 125 | */ 126 | 127 | /* 128 | // Override to support rearranging the table view. 129 | override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { 130 | 131 | } 132 | */ 133 | 134 | /* 135 | // Override to support conditional rearranging of the table view. 136 | override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { 137 | // Return false if you do not want the item to be re-orderable. 138 | return true 139 | } 140 | */ 141 | 142 | /* 143 | // MARK: - Navigation 144 | 145 | // In a storyboard-based application, you will often want to do a little preparation before navigation 146 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 147 | // Get the new view controller using segue.destinationViewController. 148 | // Pass the selected object to the new view controller. 149 | } 150 | */ 151 | 152 | } 153 | -------------------------------------------------------------------------------- /Bookshelf/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Bookshelf/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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 47 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 71 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 221 | 228 | 235 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | -------------------------------------------------------------------------------- /Bookshelf/Book.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Book.swift 3 | // Bookshelf 4 | // 5 | // Created by Victor Barros on 2016-02-08. 6 | // Copyright © 2016 Kinvey. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Kinvey 11 | import ObjectMapper 12 | 13 | /* 14 | If you want to save the authors when you save a Book, here is some collection hooks that can help you: 15 | 16 | function onPreSave(request, response, modules) { 17 | var collectionAccess = modules.collectionAccess; 18 | var bluebird = modules.bluebird; 19 | var logger = modules.logger; 20 | var authorCollectionName = 'Author'; 21 | var authorCollection = collectionAccess.collection(authorCollectionName); 22 | var promises = []; 23 | request.body.authors.forEach(function(author, index) { 24 | author._id = collectionAccess.objectID(author._id); 25 | var promise = authorCollection.saveAsync(author); 26 | promise.then(function(author) { 27 | request.body.authors[index] = { 28 | "collection" : authorCollectionName, 29 | "_id" : author._id 30 | } 31 | }); 32 | promises.push(promise); 33 | }); 34 | bluebird.all(promises).then(function() { 35 | response.continue(); 36 | }); 37 | } 38 | 39 | function onPostSave(request, response, modules) { 40 | var collectionAccess = modules.collectionAccess; 41 | var bluebird = modules.bluebird; 42 | var authorCollectionName = 'Author'; 43 | var authorCollection = collectionAccess.collection(authorCollectionName); 44 | var book = response.body; 45 | var authors = []; 46 | var authorsPromises = []; 47 | book.authors.forEach(function(author, authorIndex) { 48 | var query = {'_id' : modules.collectionAccess.objectID(author._id)}; 49 | var promise = authorCollection.findOneAsync(query); 50 | promise.then(function(author) { 51 | authors.push(author); 52 | }); 53 | authorsPromises.push(promise); 54 | }); 55 | bluebird.all(authorsPromises).then(function() { 56 | book.authors = authors; 57 | response.body = book; 58 | response.continue(); 59 | }); 60 | } 61 | 62 | function onPostFetch(request, response, modules) { 63 | var collectionAccess = modules.collectionAccess; 64 | var logger = modules.logger; 65 | var bluebird = modules.bluebird; 66 | var bookCollection = collectionAccess.collection('Book'); 67 | var authorCollection = collectionAccess.collection('Author'); 68 | var query = {}; 69 | bookCollection.findAsync(query).then(function(books) { 70 | var results = []; 71 | var booksPromises = []; 72 | books.forEach(function(book, bookIndex) { 73 | var authors = []; 74 | var authorsPromises = []; 75 | book.authors.forEach(function(author, authorIndex) { 76 | var query = {'_id' : modules.collectionAccess.objectID(author._id)}; 77 | var promise = authorCollection.findOneAsync(query); 78 | promise.then(function(author) { 79 | authors.push(author); 80 | }); 81 | authorsPromises.push(promise); 82 | }); 83 | var promise = bluebird.all(authorsPromises).then(function() { 84 | book.authors = authors; 85 | results.push(book); 86 | }); 87 | booksPromises.push(promise); 88 | }); 89 | bluebird.all(booksPromises).then(function() { 90 | response.body = results; 91 | response.continue(200); 92 | }); 93 | }); 94 | } 95 | 96 | */ 97 | class Book: Entity, Codable { 98 | 99 | @objc dynamic var title: String? 100 | let authors = List() 101 | 102 | override class func collectionName() -> String { 103 | //return the name of the backend collection corresponding to this entity 104 | return "Book" 105 | } 106 | 107 | enum CodingKeys: String, CodingKey { 108 | case title 109 | case authors 110 | } 111 | 112 | required init(from decoder: Decoder) throws { 113 | try super.init(from: decoder) 114 | 115 | let container = try decoder.container(keyedBy: CodingKeys.self) 116 | title = try container.decodeIfPresent(String.self, forKey: .title) 117 | if let authors = try container.decodeIfPresent(List.self, forKey: .authors) { 118 | self.authors.removeAll() 119 | self.authors.append(objectsIn: authors) 120 | } 121 | } 122 | 123 | override func encode(to encoder: Encoder) throws { 124 | try super.encode(to: encoder) 125 | 126 | var container = encoder.container(keyedBy: CodingKeys.self) 127 | try container.encode(title, forKey: .title) 128 | try container.encode(authors, forKey: .authors) 129 | } 130 | 131 | @available(*, deprecated) 132 | required init?(map: Map) { 133 | super.init(map: map) 134 | } 135 | 136 | required init() { 137 | super.init() 138 | } 139 | 140 | } 141 | -------------------------------------------------------------------------------- /Bookshelf/Bookshelf.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | keychain-access-groups 6 | 7 | $(AppIdentifierPrefix)com.kinvey.Bookshelf 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Bookshelf/DetailViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.swift 3 | // Bookshelf 4 | // 5 | // Created by Victor Barros on 2016-02-08. 6 | // Copyright © 2016 Kinvey. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Kinvey 11 | import SVProgressHUD 12 | import MobileCoreServices 13 | import AssetsLibrary 14 | import Photos 15 | 16 | class DetailViewController: UIViewController { 17 | 18 | @IBOutlet weak var pictureImageView: UIImageView! 19 | @IBOutlet weak var titleTextField: UITextField! 20 | @IBOutlet weak var takeChoosePictureButton: UIButton! 21 | 22 | var authorsTVC: AuthorsTableViewController! 23 | 24 | var store: DataStore! 25 | 26 | var book: Book! { 27 | didSet { 28 | // Update the view. 29 | self.configureView() 30 | } 31 | } 32 | 33 | func configureView() { 34 | // Update the user interface for the detail item. 35 | if let book = book, let titleTextField = titleTextField { 36 | titleTextField.text = book.title 37 | } 38 | } 39 | 40 | override func viewDidAppear(_ animated: Bool) { 41 | self.titleTextField.becomeFirstResponder() 42 | } 43 | 44 | override func viewDidLoad() { 45 | super.viewDidLoad() 46 | // Do any additional setup after loading the view, typically from a nib. 47 | self.configureView() 48 | } 49 | 50 | @IBAction func addAuthor(_ sender: Any) { 51 | authorsTVC.tableView.beginUpdates() 52 | authorsTVC.authors.append(Author()) 53 | let indexPath = IndexPath(row: authorsTVC.authors.count - 1, section: 0) 54 | authorsTVC.tableView.insertRows(at: [indexPath], with: .automatic) 55 | authorsTVC.tableView.endUpdates() 56 | let cell = authorsTVC.tableView.cellForRow(at: indexPath) as? AuthorTableViewCell 57 | if let cell = cell { 58 | cell.textField.becomeFirstResponder() 59 | } 60 | } 61 | 62 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 63 | if let identifier = segue.identifier { 64 | switch identifier { 65 | case "authors": 66 | authorsTVC = segue.destination as? AuthorsTableViewController 67 | authorsTVC.authors = book.authors.map { $0 } 68 | default: 69 | break 70 | } 71 | } 72 | } 73 | 74 | override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool { 75 | switch identifier { 76 | case "save": 77 | if book == nil { 78 | book = Book() 79 | } 80 | book.title = titleTextField.text 81 | book.authors.removeAll() 82 | book.authors.append(objectsIn: authorsTVC.authors) 83 | SVProgressHUD.show() 84 | 85 | store.save(book, options: nil) { 86 | SVProgressHUD.dismiss() 87 | switch $0 { 88 | case .success: 89 | self.performSegue(withIdentifier: identifier, sender: sender) 90 | case .failure: 91 | let alert = UIAlertController(title: "Error", message: "Operation not completed", preferredStyle: .alert) 92 | alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) 93 | self.present(alert, animated: true, completion: nil) 94 | } 95 | } 96 | return false 97 | 98 | case "cancel": 99 | if book == nil { 100 | book = Book() 101 | } 102 | 103 | SVProgressHUD.show() 104 | if let bookId = book.entityId { 105 | SVProgressHUD.dismiss() 106 | 107 | //user cancelled, reload book from the cache to disacard any local changes 108 | store.find(bookId, options: nil) { 109 | switch $0 { 110 | case .success(let cachedBook): 111 | self.book = cachedBook 112 | case .failure: 113 | break 114 | } 115 | } 116 | } 117 | 118 | return false 119 | default: 120 | return true 121 | } 122 | } 123 | 124 | override func didReceiveMemoryWarning() { 125 | super.didReceiveMemoryWarning() 126 | // Dispose of any resources that can be recreated. 127 | } 128 | 129 | } 130 | 131 | -------------------------------------------------------------------------------- /Bookshelf/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 | UIStatusBarTintParameters 34 | 35 | UINavigationBar 36 | 37 | Style 38 | UIBarStyleDefault 39 | Translucent 40 | 41 | 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UISupportedInterfaceOrientations~ipad 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationPortraitUpsideDown 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Bookshelf/MasterViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.swift 3 | // Bookshelf 4 | // 5 | // Created by Victor Barros on 2016-02-08. 6 | // Copyright © 2016 Kinvey. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Kinvey 11 | import SVProgressHUD 12 | fileprivate func < (lhs: T?, rhs: T?) -> Bool { 13 | switch (lhs, rhs) { 14 | case let (l?, r?): 15 | return l < r 16 | case (nil, _?): 17 | return true 18 | default: 19 | return false 20 | } 21 | } 22 | 23 | fileprivate func > (lhs: T?, rhs: T?) -> Bool { 24 | switch (lhs, rhs) { 25 | case let (l?, r?): 26 | return l > r 27 | default: 28 | return rhs < lhs 29 | } 30 | } 31 | 32 | 33 | class MasterViewController: UITableViewController, UISearchBarDelegate { 34 | 35 | @IBOutlet weak var searchBar: UISearchBar! 36 | 37 | var detailViewController: DetailViewController? = nil 38 | var books = AnyRandomAccessCollection([]) 39 | var selectedBook: Book? 40 | 41 | lazy var store: DataStore! = { 42 | //Create a DataStore of type "Sync" 43 | return try! DataStore.collection(.sync) 44 | }() 45 | 46 | override func viewDidLoad() { 47 | super.viewDidLoad() 48 | // Do any additional setup after loading the view, typically from a nib. 49 | self.navigationItem.leftBarButtonItem = self.editButtonItem 50 | 51 | let addButton = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(MasterViewController.insertNewBook(_:))) 52 | self.navigationItem.rightBarButtonItem = addButton 53 | if let split = self.splitViewController { 54 | let controllers = split.viewControllers 55 | self.detailViewController = (controllers[controllers.count-1] as! UINavigationController).topViewController as? DetailViewController 56 | } 57 | 58 | reloadData() 59 | } 60 | 61 | func reloadData(_ searchText: String = "") { 62 | SVProgressHUD.show() 63 | var query: Query 64 | if (searchText != "") { 65 | query = Query(format: "title CONTAINS[c] %@", searchText) 66 | } else { 67 | query = Query() 68 | } 69 | store.find(query, options: nil) { (result: Result, Swift.Error>) in 70 | SVProgressHUD.dismiss() 71 | switch result { 72 | case .success(let books): 73 | self.books = books 74 | case .failure(let error): 75 | self.books = AnyRandomAccessCollection([]) 76 | let alert = UIAlertController( 77 | title: "Error", 78 | message: error.localizedDescription, 79 | preferredStyle: .alert 80 | ) 81 | self.present(alert, animated: true) 82 | } 83 | if self.refreshControl?.isRefreshing ?? false { 84 | self.refreshControl?.endRefreshing() 85 | } 86 | self.tableView.reloadData() 87 | } 88 | } 89 | 90 | override func viewWillAppear(_ animated: Bool) { 91 | self.clearsSelectionOnViewWillAppear = self.splitViewController!.isCollapsed 92 | super.viewWillAppear(animated) 93 | } 94 | 95 | override func didReceiveMemoryWarning() { 96 | super.didReceiveMemoryWarning() 97 | // Dispose of any resources that can be recreated. 98 | } 99 | 100 | @objc 101 | func insertNewBook(_ sender: AnyObject) { 102 | selectedBook = Book() 103 | performSegue(withIdentifier: "showDetail", sender: sender) 104 | } 105 | 106 | // MARK: - Segues 107 | 108 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 109 | if segue.identifier == "showDetail" { 110 | if let index = self.tableView.indexPathForSelectedRow { 111 | selectedBook = books[(index as NSIndexPath).row]; 112 | } 113 | let controller = (segue.destination as! UINavigationController).topViewController as! DetailViewController 114 | controller.store = self.store 115 | controller.book = selectedBook 116 | controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem 117 | controller.navigationItem.leftItemsSupplementBackButton = true 118 | } 119 | } 120 | 121 | // MARK: - Table View 122 | 123 | override func numberOfSections(in tableView: UITableView) -> Int { 124 | return 1 125 | } 126 | 127 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 128 | return Int(books.count) 129 | } 130 | 131 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 132 | let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) 133 | 134 | let book = books[(indexPath as NSIndexPath).row] 135 | cell.textLabel!.text = book.title 136 | return cell 137 | } 138 | 139 | override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { 140 | // Return false if you do not want the specified item to be editable. 141 | return true 142 | } 143 | 144 | override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { 145 | if editingStyle == .delete { 146 | let book = books[indexPath.row] 147 | do { 148 | SVProgressHUD.show() 149 | try store.remove(book, options: nil) { 150 | SVProgressHUD.dismiss() 151 | switch $0 { 152 | case .success(let count): 153 | if count > 0, let bookIdToBeRemoved = book.entityId { 154 | self.books = AnyRandomAccessCollection(self.books.lazy.filter({ (book) -> Bool in 155 | return book.entityId != bookIdToBeRemoved 156 | })) 157 | tableView.deleteRows(at: [indexPath], with: .fade) 158 | } 159 | case .failure: 160 | break 161 | } 162 | } 163 | } catch let error { 164 | let alert = UIAlertController( 165 | title: "Error", 166 | message: "\(error)", 167 | preferredStyle: .alert 168 | ) 169 | alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) 170 | self.present(alert, animated: true, completion: nil) 171 | } 172 | } else if editingStyle == .insert { 173 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. 174 | } 175 | } 176 | 177 | @IBAction func unwindToMasterView(_ segue: UIStoryboardSegue) { 178 | reloadData() 179 | } 180 | 181 | @IBAction func refresh(_ sender: AnyObject) { 182 | reloadData() 183 | } 184 | 185 | @IBAction func pull(_ sender: AnyObject) { 186 | SVProgressHUD.show() 187 | 188 | //Pull data from the backend to the sync datastore 189 | store.pull(options: nil) { 190 | SVProgressHUD.dismiss() 191 | switch $0 { 192 | case .success(let books): 193 | self.books = books 194 | self.tableView.reloadData() 195 | case .failure: 196 | break 197 | } 198 | } 199 | } 200 | 201 | @IBAction func push(_ sender: AnyObject) { 202 | SVProgressHUD.show() 203 | 204 | //Push all local changes to the backend 205 | store.push(options: nil) { 206 | SVProgressHUD.dismiss() 207 | switch $0 { 208 | case .success(let count): 209 | print("\(count) items pushed") 210 | case .failure(let errors): 211 | for error in errors { 212 | SVProgressHUD.showError(withStatus: error.localizedDescription) 213 | } 214 | } 215 | self.reloadData() 216 | } 217 | } 218 | 219 | @IBAction func purge(_ sender: AnyObject) { 220 | SVProgressHUD.show() 221 | 222 | //Discard all local changes 223 | store.purge { _ in 224 | SVProgressHUD.dismiss() 225 | self.reloadData() 226 | } 227 | } 228 | 229 | @IBAction func sync(_ sender: AnyObject) { 230 | SVProgressHUD.show() 231 | 232 | //Sync with the backend. 233 | //This will push all local changes to the backend, then 234 | //pull changes from the backend to the app. 235 | store.sync(options: nil) { 236 | SVProgressHUD.dismiss() 237 | switch $0 { 238 | case .success(_, let books): 239 | self.books = books 240 | self.tableView.reloadData(); 241 | case .failure(let errors): 242 | if let error = errors.first { 243 | self.present(error: error) 244 | } 245 | } 246 | } 247 | } 248 | 249 | func present(error: Swift.Error) { 250 | let alert = UIAlertController(title: "Error", message: error.localizedDescription, preferredStyle: .alert) 251 | alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (alertAction) in 252 | alert.dismiss(animated: true, completion: nil) 253 | })) 254 | self.present(alert, animated: true, completion: nil) 255 | } 256 | 257 | func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { 258 | reloadData(searchText) 259 | } 260 | 261 | } 262 | 263 | -------------------------------------------------------------------------------- /BookshelfTests/BookshelfTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BookshelfTests.swift 3 | // BookshelfTests 4 | // 5 | // Created by Victor Barros on 2016-02-08. 6 | // Copyright © 2016 Kinvey. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Bookshelf 11 | 12 | class BookshelfTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /BookshelfTests/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 | -------------------------------------------------------------------------------- /BookshelfUITests/BookshelfUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BookshelfUITests.swift 3 | // BookshelfUITests 4 | // 5 | // Created by Victor Barros on 2016-02-08. 6 | // Copyright © 2016 Kinvey. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class BookshelfUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /BookshelfUITests/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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '12.1' 3 | 4 | target 'Bookshelf' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for Bookshelf 9 | pod 'SVProgressHUD' 10 | pod 'Kinvey' 11 | 12 | target 'BookshelfTests' do 13 | inherit! :search_paths 14 | # Pods for testing 15 | end 16 | 17 | target 'BookshelfUITests' do 18 | inherit! :search_paths 19 | # Pods for testing 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iOS-Starter 2 | Starter app for Kinvey iOS 3.x SDK 3 | 4 | This is a iOS Sample app to illustrate how to use version 3.x of the [Kinvey](http://www.kinvey.com) iOS library. 5 | 6 | ## Concepts illustrated in this sample 7 | * Logging in a user 8 | * Using the 3.x DataStore API to send and retrieve data 9 | * Managing offline data in a "Sync" store and synchronizing it with the backend 10 | 11 | ## Prerequisites 12 | * iOS 9 or later 13 | * XCode 8.1 or above 14 | * Kinvey iOS library v3.3 (bundled in as a developer preview). 15 | * [Kinvey](https://console.kinvey.com) app ID and secret. Before compiling, replace `appKey` and `appSecret` in the `AppDelegate` with values you obtain from the console. 16 | 17 | __Note__: The `master` branch of this starter app uses Swift 3. If you prefer to use Swift 2.3, refer to the Swift 2.3 branch on this repo. Each branch uses the corresponding [Swift-compatible](https://devcenter.kinvey.com/ios/downloads) version of the Kinvey SDK. 18 | 19 | ## License 20 | 21 | Copyright (c) 2016 Kinvey, Inc. 22 | 23 | Licensed under the Apache License, Version 2.0 (the "License"); 24 | you may not use this file except in compliance with the License. 25 | You may obtain a copy of the License at 26 | 27 | http://www.apache.org/licenses/LICENSE-2.0 28 | 29 | Unless required by applicable law or agreed to in writing, software 30 | distributed under the License is distributed on an "AS IS" BASIS, 31 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 32 | See the License for the specific language governing permissions and 33 | limitations under the License. 34 | 35 | --------------------------------------------------------------------------------