diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj b/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj index dbf44a0a2..387739255 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj @@ -3,76 +3,70 @@ archiveVersion = 1; classes = { }; - objectVersion = 47; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ - 56300B8A1C564EC8005A543B /* Database.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56300B891C564EC8005A543B /* Database.swift */; }; - 56900E421BBFF7D500B815B5 /* PersonEditionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56900E411BBFF7D500B815B5 /* PersonEditionViewController.swift */; }; - 56B8F4581B4E22B200C24296 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B8F4571B4E22B200C24296 /* AppDelegate.swift */; }; - 56B8F45A1B4E22B200C24296 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B8F4591B4E22B200C24296 /* MasterViewController.swift */; }; - 56B8F45C1B4E22B200C24296 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B8F45B1B4E22B200C24296 /* DetailViewController.swift */; }; - 56B8F45F1B4E22B200C24296 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 56B8F45D1B4E22B200C24296 /* Main.storyboard */; }; - 56B8F4611B4E22B200C24296 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 56B8F4601B4E22B200C24296 /* Assets.xcassets */; }; - 56B8F4641B4E22B200C24296 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 56B8F4621B4E22B200C24296 /* LaunchScreen.storyboard */; }; - 56B8F4991B4E23AA00C24296 /* Person.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B8F4981B4E23AA00C24296 /* Person.swift */; }; - 56F1DA9C1BDA00C600BCC28E /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 567AA8A91B4E3F120082C3E4 /* GRDB.framework */; }; - 56F1DA9D1BDA00C600BCC28E /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 567AA8A91B4E3F120082C3E4 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 568C7A9A1CA6C63100796484 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7A991CA6C63100796484 /* AppDelegate.swift */; }; + 568C7A9C1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */; }; + 568C7A9F1CA6C63100796484 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 568C7A9D1CA6C63100796484 /* Main.storyboard */; }; + 568C7AA11CA6C63100796484 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 568C7AA01CA6C63100796484 /* Assets.xcassets */; }; + 568C7AA41CA6C63100796484 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 568C7AA21CA6C63100796484 /* LaunchScreen.storyboard */; }; + 568C7ADA1CA6C6D100796484 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 568C7AD71CA6C6BF00796484 /* GRDB.framework */; }; + 568C7ADB1CA6C6D100796484 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 568C7AD71CA6C6BF00796484 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 568C7AE01CA6C7BC00796484 /* Person.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7ADF1CA6C7BC00796484 /* Person.swift */; }; + 568C7AE21CA6C97500796484 /* Database.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7AE11CA6C97500796484 /* Database.swift */; }; + 568C7AE41CA6CEBE00796484 /* PersonEditionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */; }; + 568C7AE61CA6F95300796484 /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7AE51CA6F95300796484 /* DemoViewController.swift */; }; + 568C7AE81CA6FB6600796484 /* PersonsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7AE71CA6FB6600796484 /* PersonsViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 31B0795C1C5120D2003790B7 /* PBXContainerItemProxy */ = { + 568C7ACE1CA6C6BF00796484 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 56553C181C3E906C00522B5C; - remoteInfo = GRDBOSXCrashTests; - }; - 31B0795E1C5120D2003790B7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 560C981A1C0E22D300BF8471; - remoteInfo = GRDBOSXPerformanceTests; - }; - 567AA8A41B4E3F120082C3E4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; proxyType = 2; remoteGlobalIDString = DC3773F319C8CBB3004FCF85; remoteInfo = GRDBOSX; }; - 567AA8A61B4E3F120082C3E4 /* PBXContainerItemProxy */ = { + 568C7AD01CA6C6BF00796484 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 56553C181C3E906C00522B5C; + remoteInfo = GRDBOSXCrashTests; + }; + 568C7AD21CA6C6BF00796484 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; proxyType = 2; remoteGlobalIDString = 56E5D7F91B4D422D00430942; remoteInfo = GRDBOSXTests; }; - 567AA8A81B4E3F120082C3E4 /* PBXContainerItemProxy */ = { + 568C7AD41CA6C6BF00796484 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 560C981A1C0E22D300BF8471; + remoteInfo = GRDBOSXPerformanceTests; + }; + 568C7AD61CA6C6BF00796484 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; proxyType = 2; remoteGlobalIDString = 56E5D7CA1B4D3FED00430942; remoteInfo = GRDBiOS; }; - 567AA8AA1B4E3F120082C3E4 /* PBXContainerItemProxy */ = { + 568C7AD81CA6C6BF00796484 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; proxyType = 2; remoteGlobalIDString = 56E5D7D31B4D3FEE00430942; remoteInfo = GRDBiOSTests; }; - 567AA8AC1B4E41CF0082C3E4 /* PBXContainerItemProxy */ = { + 568C7ADC1CA6C6D100796484 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 56E5D7C91B4D3FED00430942; - remoteInfo = GRDBiOS; - }; - 56F1DA9E1BDA00C700BCC28E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */; + containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; proxyType = 1; remoteGlobalIDString = 56E5D7C91B4D3FED00430942; remoteInfo = GRDBiOS; @@ -80,22 +74,13 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - 56F1DA981BDA009600BCC28E /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 7; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 56F1DAA01BDA00C700BCC28E /* Embed Frameworks */ = { + 568C7ADE1CA6C6D100796484 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - 56F1DA9D1BDA00C600BCC28E /* GRDB.framework in Embed Frameworks */, + 568C7ADB1CA6C6D100796484 /* GRDB.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -103,281 +88,246 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 56300B891C564EC8005A543B /* Database.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Database.swift; sourceTree = ""; }; - 56900E411BBFF7D500B815B5 /* PersonEditionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonEditionViewController.swift; sourceTree = ""; }; - 56B8F4541B4E22B200C24296 /* GRDBDemoiOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBDemoiOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 56B8F4571B4E22B200C24296 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 56B8F4591B4E22B200C24296 /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; }; - 56B8F45B1B4E22B200C24296 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; - 56B8F45E1B4E22B200C24296 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 56B8F4601B4E22B200C24296 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 56B8F4631B4E22B200C24296 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 56B8F4651B4E22B200C24296 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = ""; }; - 56B8F4981B4E23AA00C24296 /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = ""; }; + 568C7A961CA6C63100796484 /* GRDBDemoiOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBDemoiOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 568C7A991CA6C63100796484 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchedRecordsControllerDemoViewController.swift; sourceTree = ""; }; + 568C7A9E1CA6C63100796484 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 568C7AA01CA6C63100796484 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 568C7AA31CA6C63100796484 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 568C7AA51CA6C63100796484 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = ""; }; + 568C7ADF1CA6C7BC00796484 /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = ""; }; + 568C7AE11CA6C97500796484 /* Database.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Database.swift; sourceTree = ""; }; + 568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonEditionViewController.swift; sourceTree = ""; }; + 568C7AE51CA6F95300796484 /* DemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = ""; }; + 568C7AE71CA6FB6600796484 /* PersonsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonsViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 56B8F4511B4E22B200C24296 /* Frameworks */ = { + 568C7A931CA6C63100796484 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 56F1DA9C1BDA00C600BCC28E /* GRDB.framework in Frameworks */, + 568C7ADA1CA6C6D100796484 /* GRDB.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 567AA89E1B4E3F120082C3E4 /* Products */ = { + 568C7A8D1CA6C63100796484 = { isa = PBXGroup; children = ( - 567AA8A51B4E3F120082C3E4 /* GRDB.framework */, - 31B0795D1C5120D2003790B7 /* GRDBOSXCrashTests.xctest */, - 567AA8A71B4E3F120082C3E4 /* GRDBTests.xctest */, - 31B0795F1C5120D2003790B7 /* GRDBOSXPerformanceTests.xctest */, - 567AA8A91B4E3F120082C3E4 /* GRDB.framework */, - 567AA8AB1B4E3F120082C3E4 /* GRDBTests.xctest */, + 568C7A981CA6C63100796484 /* GRDBDemoiOS */, + 568C7A971CA6C63100796484 /* Products */, + ); + sourceTree = ""; + }; + 568C7A971CA6C63100796484 /* Products */ = { + isa = PBXGroup; + children = ( + 568C7A961CA6C63100796484 /* GRDBDemoiOS.app */, ); name = Products; sourceTree = ""; }; - 56900E3C1BBFF2C400B815B5 /* Resources */ = { + 568C7A981CA6C63100796484 /* GRDBDemoiOS */ = { isa = PBXGroup; children = ( - 56B8F4601B4E22B200C24296 /* Assets.xcassets */, - 56B8F4621B4E22B200C24296 /* LaunchScreen.storyboard */, - 56B8F45D1B4E22B200C24296 /* Main.storyboard */, - ); - name = Resources; - sourceTree = ""; - }; - 56900E3D1BBFF2DB00B815B5 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */, - ); - name = Frameworks; - sourceTree = ""; - }; - 56900E3E1BBFF2E900B815B5 /* Controllers */ = { - isa = PBXGroup; - children = ( - 56B8F45B1B4E22B200C24296 /* DetailViewController.swift */, - 56B8F4591B4E22B200C24296 /* MasterViewController.swift */, - 56900E411BBFF7D500B815B5 /* PersonEditionViewController.swift */, - ); - name = Controllers; - sourceTree = ""; - }; - 56900E3F1BBFF2F200B815B5 /* Models */ = { - isa = PBXGroup; - children = ( - 56B8F4981B4E23AA00C24296 /* Person.swift */, - ); - name = Models; - sourceTree = ""; - }; - 56900E401BBFF31800B815B5 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 56B8F4651B4E22B200C24296 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 56B8F44B1B4E22B200C24296 = { - isa = PBXGroup; - children = ( - 56B8F4561B4E22B200C24296 /* GRDBDemoiOS */, - 56B8F4551B4E22B200C24296 /* Products */, - ); - sourceTree = ""; - }; - 56B8F4551B4E22B200C24296 /* Products */ = { - isa = PBXGroup; - children = ( - 56B8F4541B4E22B200C24296 /* GRDBDemoiOS.app */, - ); - name = Products; - sourceTree = ""; - }; - 56B8F4561B4E22B200C24296 /* GRDBDemoiOS */ = { - isa = PBXGroup; - children = ( - 56B8F4571B4E22B200C24296 /* AppDelegate.swift */, - 56300B891C564EC8005A543B /* Database.swift */, - 56900E3E1BBFF2E900B815B5 /* Controllers */, - 56900E3F1BBFF2F200B815B5 /* Models */, - 56900E3C1BBFF2C400B815B5 /* Resources */, - 56900E3D1BBFF2DB00B815B5 /* Frameworks */, - 56900E401BBFF31800B815B5 /* Supporting Files */, + 568C7A991CA6C63100796484 /* AppDelegate.swift */, + 568C7AE11CA6C97500796484 /* Database.swift */, + 568C7ADF1CA6C7BC00796484 /* Person.swift */, + 568C7AEA1CA6FE6B00796484 /* Controllers */, + 568C7A9D1CA6C63100796484 /* Main.storyboard */, + 568C7AA01CA6C63100796484 /* Assets.xcassets */, + 568C7AA21CA6C63100796484 /* LaunchScreen.storyboard */, + 568C7AA51CA6C63100796484 /* Info.plist */, + 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */, ); path = GRDBDemoiOS; sourceTree = ""; }; + 568C7AC61CA6C6BF00796484 /* Products */ = { + isa = PBXGroup; + children = ( + 568C7ACF1CA6C6BF00796484 /* GRDB.framework */, + 568C7AD11CA6C6BF00796484 /* GRDBOSXCrashTests.xctest */, + 568C7AD31CA6C6BF00796484 /* GRDBTests.xctest */, + 568C7AD51CA6C6BF00796484 /* GRDBOSXPerformanceTests.xctest */, + 568C7AD71CA6C6BF00796484 /* GRDB.framework */, + 568C7AD91CA6C6BF00796484 /* GRDBTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 568C7AEA1CA6FE6B00796484 /* Controllers */ = { + isa = PBXGroup; + children = ( + 568C7AE51CA6F95300796484 /* DemoViewController.swift */, + 568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */, + 568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */, + 568C7AE71CA6FB6600796484 /* PersonsViewController.swift */, + ); + name = Controllers; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 56B8F4531B4E22B200C24296 /* GRDBDemoiOS */ = { + 568C7A951CA6C63100796484 /* GRDBDemoiOS */ = { isa = PBXNativeTarget; - buildConfigurationList = 56B8F47E1B4E22B200C24296 /* Build configuration list for PBXNativeTarget "GRDBDemoiOS" */; + buildConfigurationList = 568C7AA81CA6C63100796484 /* Build configuration list for PBXNativeTarget "GRDBDemoiOS" */; buildPhases = ( - 56B8F4501B4E22B200C24296 /* Sources */, - 56B8F4511B4E22B200C24296 /* Frameworks */, - 56B8F4521B4E22B200C24296 /* Resources */, - 56F1DA981BDA009600BCC28E /* CopyFiles */, - 56F1DAA01BDA00C700BCC28E /* Embed Frameworks */, + 568C7A921CA6C63100796484 /* Sources */, + 568C7A931CA6C63100796484 /* Frameworks */, + 568C7A941CA6C63100796484 /* Resources */, + 568C7ADE1CA6C6D100796484 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( - 567AA8AD1B4E41CF0082C3E4 /* PBXTargetDependency */, - 56F1DA9F1BDA00C700BCC28E /* PBXTargetDependency */, + 568C7ADD1CA6C6D100796484 /* PBXTargetDependency */, ); name = GRDBDemoiOS; productName = GRDBDemoiOS; - productReference = 56B8F4541B4E22B200C24296 /* GRDBDemoiOS.app */; + productReference = 568C7A961CA6C63100796484 /* GRDBDemoiOS.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 56B8F44C1B4E22B200C24296 /* Project object */ = { + 568C7A8E1CA6C63100796484 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = "Gwendal Roué"; + LastSwiftUpdateCheck = 0730; + LastUpgradeCheck = 0730; + ORGANIZATIONNAME = Pierlis; TargetAttributes = { - 56B8F4531B4E22B200C24296 = { - CreatedOnToolsVersion = 7.0; + 568C7A951CA6C63100796484 = { + CreatedOnToolsVersion = 7.3; }; }; }; - buildConfigurationList = 56B8F44F1B4E22B200C24296 /* Build configuration list for PBXProject "GRDBDemoiOS" */; - compatibilityVersion = "Xcode 6.3"; + buildConfigurationList = 568C7A911CA6C63100796484 /* Build configuration list for PBXProject "GRDBDemoiOS" */; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = 56B8F44B1B4E22B200C24296; - productRefGroup = 56B8F4551B4E22B200C24296 /* Products */; + mainGroup = 568C7A8D1CA6C63100796484; + productRefGroup = 568C7A971CA6C63100796484 /* Products */; projectDirPath = ""; projectReferences = ( { - ProductGroup = 567AA89E1B4E3F120082C3E4 /* Products */; - ProjectRef = 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */; + ProductGroup = 568C7AC61CA6C6BF00796484 /* Products */; + ProjectRef = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; }, ); projectRoot = ""; targets = ( - 56B8F4531B4E22B200C24296 /* GRDBDemoiOS */, + 568C7A951CA6C63100796484 /* GRDBDemoiOS */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 31B0795D1C5120D2003790B7 /* GRDBOSXCrashTests.xctest */ = { + 568C7ACF1CA6C6BF00796484 /* GRDB.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = GRDB.framework; + remoteRef = 568C7ACE1CA6C6BF00796484 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 568C7AD11CA6C6BF00796484 /* GRDBOSXCrashTests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; path = GRDBOSXCrashTests.xctest; - remoteRef = 31B0795C1C5120D2003790B7 /* PBXContainerItemProxy */; + remoteRef = 568C7AD01CA6C6BF00796484 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 31B0795F1C5120D2003790B7 /* GRDBOSXPerformanceTests.xctest */ = { + 568C7AD31CA6C6BF00796484 /* GRDBTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = GRDBTests.xctest; + remoteRef = 568C7AD21CA6C6BF00796484 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 568C7AD51CA6C6BF00796484 /* GRDBOSXPerformanceTests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; path = GRDBOSXPerformanceTests.xctest; - remoteRef = 31B0795E1C5120D2003790B7 /* PBXContainerItemProxy */; + remoteRef = 568C7AD41CA6C6BF00796484 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 567AA8A51B4E3F120082C3E4 /* GRDB.framework */ = { + 568C7AD71CA6C6BF00796484 /* GRDB.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = GRDB.framework; - remoteRef = 567AA8A41B4E3F120082C3E4 /* PBXContainerItemProxy */; + remoteRef = 568C7AD61CA6C6BF00796484 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 567AA8A71B4E3F120082C3E4 /* GRDBTests.xctest */ = { + 568C7AD91CA6C6BF00796484 /* GRDBTests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; path = GRDBTests.xctest; - remoteRef = 567AA8A61B4E3F120082C3E4 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 567AA8A91B4E3F120082C3E4 /* GRDB.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = GRDB.framework; - remoteRef = 567AA8A81B4E3F120082C3E4 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 567AA8AB1B4E3F120082C3E4 /* GRDBTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = GRDBTests.xctest; - remoteRef = 567AA8AA1B4E3F120082C3E4 /* PBXContainerItemProxy */; + remoteRef = 568C7AD81CA6C6BF00796484 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ - 56B8F4521B4E22B200C24296 /* Resources */ = { + 568C7A941CA6C63100796484 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 56B8F4641B4E22B200C24296 /* LaunchScreen.storyboard in Resources */, - 56B8F4611B4E22B200C24296 /* Assets.xcassets in Resources */, - 56B8F45F1B4E22B200C24296 /* Main.storyboard in Resources */, + 568C7AA41CA6C63100796484 /* LaunchScreen.storyboard in Resources */, + 568C7AA11CA6C63100796484 /* Assets.xcassets in Resources */, + 568C7A9F1CA6C63100796484 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 56B8F4501B4E22B200C24296 /* Sources */ = { + 568C7A921CA6C63100796484 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 56300B8A1C564EC8005A543B /* Database.swift in Sources */, - 56B8F45C1B4E22B200C24296 /* DetailViewController.swift in Sources */, - 56B8F45A1B4E22B200C24296 /* MasterViewController.swift in Sources */, - 56B8F4991B4E23AA00C24296 /* Person.swift in Sources */, - 56900E421BBFF7D500B815B5 /* PersonEditionViewController.swift in Sources */, - 56B8F4581B4E22B200C24296 /* AppDelegate.swift in Sources */, + 568C7AE01CA6C7BC00796484 /* Person.swift in Sources */, + 568C7AE81CA6FB6600796484 /* PersonsViewController.swift in Sources */, + 568C7A9C1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift in Sources */, + 568C7AE21CA6C97500796484 /* Database.swift in Sources */, + 568C7AE61CA6F95300796484 /* DemoViewController.swift in Sources */, + 568C7AE41CA6CEBE00796484 /* PersonEditionViewController.swift in Sources */, + 568C7A9A1CA6C63100796484 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 567AA8AD1B4E41CF0082C3E4 /* PBXTargetDependency */ = { + 568C7ADD1CA6C6D100796484 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = GRDBiOS; - targetProxy = 567AA8AC1B4E41CF0082C3E4 /* PBXContainerItemProxy */; - }; - 56F1DA9F1BDA00C700BCC28E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = GRDBiOS; - targetProxy = 56F1DA9E1BDA00C700BCC28E /* PBXContainerItemProxy */; + targetProxy = 568C7ADC1CA6C6D100796484 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 56B8F45D1B4E22B200C24296 /* Main.storyboard */ = { + 568C7A9D1CA6C63100796484 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - 56B8F45E1B4E22B200C24296 /* Base */, + 568C7A9E1CA6C63100796484 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; - 56B8F4621B4E22B200C24296 /* LaunchScreen.storyboard */ = { + 568C7AA21CA6C63100796484 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - 56B8F4631B4E22B200C24296 /* Base */, + 568C7AA31CA6C63100796484 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -385,10 +335,11 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 56B8F47C1B4E22B200C24296 /* Debug */ = { + 568C7AA61CA6C63100796484 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -421,19 +372,19 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - 56B8F47D1B4E22B200C24296 /* Release */ = { + 568C7AA71CA6C63100796484 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -460,32 +411,33 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; - 56B8F47F1B4E22B200C24296 /* Debug */ = { + 568C7AA91CA6C63100796484 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; INFOPLIST_FILE = GRDBDemoiOS/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; - 56B8F4801B4E22B200C24296 /* Release */ = { + 568C7AAA1CA6C63100796484 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; INFOPLIST_FILE = GRDBDemoiOS/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -495,25 +447,24 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 56B8F44F1B4E22B200C24296 /* Build configuration list for PBXProject "GRDBDemoiOS" */ = { + 568C7A911CA6C63100796484 /* Build configuration list for PBXProject "GRDBDemoiOS" */ = { isa = XCConfigurationList; buildConfigurations = ( - 56B8F47C1B4E22B200C24296 /* Debug */, - 56B8F47D1B4E22B200C24296 /* Release */, + 568C7AA61CA6C63100796484 /* Debug */, + 568C7AA71CA6C63100796484 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 56B8F47E1B4E22B200C24296 /* Build configuration list for PBXNativeTarget "GRDBDemoiOS" */ = { + 568C7AA81CA6C63100796484 /* Build configuration list for PBXNativeTarget "GRDBDemoiOS" */ = { isa = XCConfigurationList; buildConfigurations = ( - 56B8F47F1B4E22B200C24296 /* Debug */, - 56B8F4801B4E22B200C24296 /* Release */, + 568C7AA91CA6C63100796484 /* Debug */, + 568C7AAA1CA6C63100796484 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 56B8F44C1B4E22B200C24296 /* Project object */; + rootObject = 568C7A8E1CA6C63100796484 /* Project object */; } diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 94647a844..000000000 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift index 4bf67794e..d220f95cf 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift @@ -1,20 +1,12 @@ import UIKit @UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { +class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - - // Set up database + // Setup database setupDatabase() - - // Set up view controllers - let splitViewController = self.window!.rootViewController as! UISplitViewController - let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController - navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem() - splitViewController.delegate = self - return true } @@ -33,17 +25,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele application.endBackgroundTask(task) } } - - // MARK: - Split view - - func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController:UIViewController, ontoPrimaryViewController primaryViewController:UIViewController) -> Bool { - guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false } - guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false } - if topAsDetailController.person == nil { - // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. - return true - } - return false - } - } diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Assets.xcassets/AppIcon.appiconset/Contents.json index 36d2c80d8..118c98f74 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -29,36 +29,6 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" } ], "info" : { diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/LaunchScreen.storyboard b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/LaunchScreen.storyboard index 4b9623a74..2e721e183 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/LaunchScreen.storyboard +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,7 @@ - + - - + @@ -16,29 +15,8 @@ - - - - + - - - - - - - - diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/Main.storyboard b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/Main.storyboard index e231aefc8..eb917899f 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/Main.storyboard +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/Main.storyboard @@ -1,131 +1,133 @@ - + + + - - + + - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + + - + - - + + - + - + - - + + - + - + - - + + - + - - + - + + + + + + + + + - - - - - + + + + + - - + + - + - - + - + + + + + + - - - - - + + + + + @@ -133,129 +135,195 @@ - - + + - - + + - + + + + + + - - - - + + + + + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - + - + - - + + - - + + + + + - - + - - + + - + - - + + - - + + - - + + - - + + - - - + - - - + + - - - - - - - - + + + + + - - - - - - - - - - - - + - + - - + + - + - + + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Database.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Database.swift index 427b675a8..3b1c8f33e 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Database.swift +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Database.swift @@ -1,28 +1,14 @@ import GRDB -// The columns for the GRDB Query Interface -// -// See https://github.com/groue/GRDB.swift/#the-query-interface - -struct Col { - static let id = SQLColumn("id") - static let firstName = SQLColumn("firstName") - static let lastName = SQLColumn("lastName") - static let position = SQLColumn("position") - static let visible = SQLColumn("visible") -} - - -// The shared database queue, stored in a global. -// It is initialized in setupDatabase() - +/// The shared database queue, stored in a global. +/// It is initialized in setupDatabase() var dbQueue: DatabaseQueue! func setupDatabase() { // Connect to the database // - // See https://github.com/groue/GRDB.swift/#database-queues + // See https://github.com/groue/GRDB.swift/#database-connections let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).first! as NSString let databasePath = documentsPath.stringByAppendingPathComponent("db.sqlite") @@ -49,36 +35,17 @@ func setupDatabase() { try db.execute( "CREATE TABLE persons (" + "id INTEGER PRIMARY KEY, " + - "firstName TEXT, " + - "lastName TEXT ," + - "visible BOOLEAN DEFAULT TRUE ," + - "position INTEGER " + + "name TEXT NOT NULL COLLATE localized_case_insensitive, " + + "score INTEGER NOT NULL " + ")") } migrator.registerMigration("addPersons") { db in - try Person(firstName: "Arthur", lastName: "Miller").insert(db) - try Person(firstName: "Barbra", lastName: "Streisand").insert(db) - try Person(firstName: "Cinderella").insert(db) - try Person(firstName: "John", lastName: "Appleseed").insert(db) - try Person(firstName: "Kate", lastName: "Bell").insert(db) - try Person(firstName: "Anna", lastName: "Haro").insert(db) - try Person(firstName: "Daniel", lastName: "Higgins").insert(db) - try Person(firstName: "David", lastName: "Taylor").insert(db) - try Person(firstName: "Hank", lastName: "Zakroff").insert(db) - try Person(firstName: "Steve", lastName: "Jobs").insert(db) - try Person(firstName: "Bill", lastName: "Gates").insert(db) - try Person(firstName: "Zlatan", lastName: "Ibrahimovic").insert(db) - try Person(firstName: "Barack", lastName: "Obama").insert(db) - try Person(firstName: "François", lastName: "Hollande").insert(db) - try Person(firstName: "Britney", lastName: "Spears").insert(db) - try Person(firstName: "Andre", lastName: "Agassi").insert(db) - try Person(firstName: "Roger", lastName: "Federer").insert(db) - try Person(firstName: "Rafael", lastName: "Nadal").insert(db) - try Person(firstName: "Gael", lastName: "Monfils").insert(db) - try Person(firstName: "Jo Wilfried", lastName: "Tsonga").insert(db) - try Person(firstName: "Serena", lastName: "Williams").insert(db) - try Person(firstName: "Venus", lastName: "Williams").insert(db) - try Person(firstName: "Amélie", lastName: "Poulain").insert(db) + try Person(name: "Alice", score: 150).insert(db) + try Person(name: "Bob", score: 70).insert(db) + try Person(name: "Craig", score: 220).insert(db) + try Person(name: "David", score: 80).insert(db) + try Person(name: "Elise", score: 100).insert(db) + try Person(name: "Fiona", score: 40).insert(db) } try! migrator.migrate(dbQueue) } \ No newline at end of file diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/DemoViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/DemoViewController.swift similarity index 100% rename from DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/DemoViewController.swift rename to DemoApps/GRDBDemoiOS/GRDBDemoiOS/DemoViewController.swift diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/DetailViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/DetailViewController.swift deleted file mode 100644 index 146978879..000000000 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/DetailViewController.swift +++ /dev/null @@ -1,27 +0,0 @@ -import UIKit - -class DetailViewController: UIViewController { - @IBOutlet weak var detailDescriptionLabel: UILabel! - - var person: Person! { - didSet { - self.configureView() - } - } - - func configureView() { - guard isViewLoaded() else { - return - } - guard person != nil else { - return - } - detailDescriptionLabel.text = person.fullName - } - - override func viewWillAppear(animated: Bool) { - super.viewWillAppear(animated) - configureView() - } -} - diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/FetchedRecordsControllerDemoViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/FetchedRecordsControllerDemoViewController.swift similarity index 100% rename from DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/FetchedRecordsControllerDemoViewController.swift rename to DemoApps/GRDBDemoiOS/GRDBDemoiOS/FetchedRecordsControllerDemoViewController.swift diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Info.plist b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Info.plist index fd1ab7c38..6c48029d6 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Info.plist +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Info.plist @@ -30,28 +30,9 @@ armv7 - UIStatusBarTintParameters - - UINavigationBar - - Style - UIBarStyleDefault - Translucent - - - UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/MasterViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/MasterViewController.swift deleted file mode 100644 index f68126573..000000000 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/MasterViewController.swift +++ /dev/null @@ -1,165 +0,0 @@ -import UIKit -import GRDB - -class MasterViewController: UITableViewController, FetchedRecordsControllerDelegate { - var fetchedRecordsController: FetchedRecordsController! - - override func viewDidLoad() { - super.viewDidLoad() - self.navigationItem.leftBarButtonItem = self.editButtonItem() - configureToolbar() - - let request = Person.filter(Col.visible).order(Col.position, Col.firstName, Col.lastName) - fetchedRecordsController = FetchedRecordsController(dbQueue, request: request, compareRecordsByPrimaryKey: true) - fetchedRecordsController.delegate = self - fetchedRecordsController.performFetch() - } - - override func viewWillAppear(animated: Bool) { - self.clearsSelectionOnViewWillAppear = self.splitViewController!.collapsed - super.viewWillAppear(animated) - } - - - // MARK: - Navigation - - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - if segue.identifier == "showPerson" { - let person = fetchedRecordsController.recordAtIndexPath(self.tableView.indexPathForSelectedRow!) - let detailViewController = (segue.destinationViewController as! UINavigationController).topViewController as! DetailViewController - detailViewController.person = person - detailViewController.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem() - detailViewController.navigationItem.leftItemsSupplementBackButton = true - } - else if segue.identifier == "editNewPerson" { - let personEditionViewController = (segue.destinationViewController as! UINavigationController).topViewController as! PersonEditionViewController - personEditionViewController.person = Person() - } - } - - // Unwind action: commit person edition - @IBAction func commitPersonEdition(segue: UIStoryboardSegue) { - let personEditionViewController = segue.sourceViewController as! PersonEditionViewController - let person = personEditionViewController.person - - // Ignore person with no name - guard (person.firstName ?? "").characters.count > 0 || (person.lastName ?? "").characters.count > 0 else { - return - } - - // Save person - try! person.save(dbQueue) - } - - - // MARK: - UITableViewDataSource> - - override func numberOfSectionsInTableView(tableView: UITableView) -> Int { - return fetchedRecordsController.sections.count - } - - override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return fetchedRecordsController.sections[section].numberOfRecords - } - - override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) - configureCell(cell, atIndexPath: indexPath) - return cell - } - - private func configureCell(cell: UITableViewCell, atIndexPath indexPath:NSIndexPath) { - let person = fetchedRecordsController.recordAtIndexPath(indexPath) - cell.textLabel!.text = "\(person.position) - \(person.fullName)" - } - - override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { - // Delete the person - let person = fetchedRecordsController.recordAtIndexPath(indexPath) - try! person.delete(dbQueue) - } - - - // MARK: - FetchedRecordsControllerDelegate - - func controllerWillChangeRecords(controller: FetchedRecordsController) { - tableView.beginUpdates() - } - - func controller(controller: FetchedRecordsController, didChangeRecord record: T, withEvent event:FetchedRecordsEvent) { - switch event { - case .Insertion(let indexPath): - tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) - - case .Deletion(let indexPath): - tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) - - case .Update(let indexPath, _): - if let cell = tableView.cellForRowAtIndexPath(indexPath) { - configureCell(cell, atIndexPath: indexPath) - } - - case .Move(let indexPath, let newIndexPath, _): -// // Technique 1 (replace) -// tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) -// tableView.insertRowsAtIndexPaths([newIndexPath], withRowAnimation: .Fade) - - // Technique 2 (move) - let cell = tableView.cellForRowAtIndexPath(indexPath) - tableView.moveRowAtIndexPath(indexPath, toIndexPath: newIndexPath) - if let cell = cell { - configureCell(cell, atIndexPath: newIndexPath) - } - } - } - - func controllerDidChangeRecords(controller: FetchedRecordsController) { - tableView.endUpdates() - } - - - // MARK: - Private - - func swapNames() { - let person = Person.filter(Col.visible).order(sql: "RANDOM()").fetchOne(dbQueue)! - (person.lastName, person.firstName) = (person.firstName, person.lastName) - try! person.save(dbQueue) - } - - func shufflePersons() { - try! dbQueue.inTransaction { db in - var persons = Person.fetchAll(db) - persons.shuffleInPlace() - for (i, p) in persons.enumerate() { - p.position = Int64(i) - p.visible = (Int(arc4random_uniform(2)) == 0) - try p.save(db) - } - return .Commit - } - } - - private func configureToolbar() { - toolbarItems = [ - UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil), - UIBarButtonItem(title: "Swap Names", style: UIBarButtonItemStyle.Done, target: self, action: #selector(MasterViewController.swapNames)), - UIBarButtonItem(title: "Shuffle", style: UIBarButtonItemStyle.Done, target: self, action: #selector(MasterViewController.shufflePersons)), - UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil) - ] - self.navigationController?.toolbarHidden = false - } -} - -extension MutableCollectionType where Index == Int { - /// Shuffle the elements of `self` in-place. - mutating func shuffleInPlace() { - // empty and single-element collections don't shuffle - if count < 2 { return } - - for i in 0.. String { return "persons" @@ -25,36 +19,19 @@ class Person : Record { required init(_ row: Row) { id = row.value(named: "id") - firstName = row.value(named: "firstName") - lastName = row.value(named: "lastName") - visible = row.value(named: "visible") - position = row.value(named: "position") + name = row.value(named: "name") + score = row.value(named: "score") super.init(row) - } - override var persistentDictionary: [String: DatabaseValueConvertible?] { + override var persistentDictionary: [String : DatabaseValueConvertible?] { return [ "id": id, - "firstName": firstName, - "lastName": lastName, - "visible": visible, - "position": position] + "name": name, + "score": score] } override func didInsertWithRowID(rowID: Int64, forColumn column: String?) { id = rowID } - - override func insert(db: DatabaseWriter) throws { - - // Basic Ordering - if self.position == 0 { - if let maxPosition = Int.fetchOne(db, "SELECT MAX(position) from persons") { - self.position = maxPosition + 1 - } - } - - try super.insert(db) - } } diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonEditionViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonEditionViewController.swift index 2d45d20af..115847d2d 100644 --- a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonEditionViewController.swift +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonEditionViewController.swift @@ -1,61 +1,104 @@ import UIKit -class PersonEditionViewController: UITableViewController, UITextFieldDelegate { - @IBOutlet weak var firstNameTableViewCell: UITableViewCell! - @IBOutlet weak var firstNameTextField: UITextField! - @IBOutlet weak var lastNameTableViewCell: UITableViewCell! - @IBOutlet weak var lastNameTextField: UITextField! +protocol PersonEditionViewControllerDelegate: class { + func personEditionControllerDidComplete(controller: PersonEditionViewController) +} + +class PersonEditionViewController: UITableViewController { + weak var delegate: PersonEditionViewControllerDelegate? + var person: Person! { didSet { configureView() } } + var cancelButtonHidden: Bool = false { didSet { configureView() } } + var commitButtonHidden: Bool = false { didSet { configureView() } } + + @IBOutlet private weak var cancelBarButtonItem: UIBarButtonItem! + @IBOutlet private weak var commitBarButtonItem: UIBarButtonItem! + @IBOutlet private weak var nameCell: UITableViewCell! + @IBOutlet private weak var nameTextField: UITextField! + @IBOutlet private weak var scoreCell: UITableViewCell! + @IBOutlet private weak var scoreTextField: UITextField! - // The edited person - var person: Person! - - override func viewDidLoad() { - super.viewDidLoad() - - // Initializes textFields with the person's names - firstNameTextField.text = person.firstName - lastNameTextField.text = person.lastName + func applyChanges() { + if let name = nameTextField.text where !name.isEmpty { + person.name = name + } + person.score = scoreTextField.text.flatMap { Int($0) } ?? 0 } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) - - // Auto focus firstName - firstNameTextField.becomeFirstResponder() + configureView() + nameTextField.becomeFirstResponder() } + private func configureView() { + guard isViewLoaded() else { return } + + nameTextField.text = person.name + if person.score == 0 && person.id == nil { + scoreTextField.text = "" + } else { + scoreTextField.text = "\(person.score)" + } + + if cancelButtonHidden { + navigationItem.leftBarButtonItem = nil + } else { + navigationItem.leftBarButtonItem = cancelBarButtonItem + } + + if cancelButtonHidden { + navigationItem.rightBarButtonItem = nil + } else { + navigationItem.rightBarButtonItem = commitBarButtonItem + } + } +} + + +// MARK: - Navigation + +extension PersonEditionViewController { + + override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { + // Force keyboard to dismiss early + view.endEditing(true) + return true + } + + override func willMoveToParentViewController(parent: UIViewController?) { + super.willMoveToParentViewController(parent) + + if parent == nil { + // Self is popping from its navigation controller + delegate?.personEditionControllerDidComplete(self) + } + } + +} + + +// MARK: - Form + +extension PersonEditionViewController: UITextFieldDelegate { + override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { - // Tapping a cell selects its text fields. - if indexPath == tableView.indexPathForCell(firstNameTableViewCell) { - firstNameTextField.becomeFirstResponder() - } else if indexPath == tableView.indexPathForCell(lastNameTableViewCell) { - lastNameTextField.becomeFirstResponder() + tableView.deselectRowAtIndexPath(indexPath, animated: false) + + guard let cell = tableView.cellForRowAtIndexPath(indexPath) else { + return + } + + if cell == nameCell { + nameTextField.becomeFirstResponder() + } else if cell == scoreCell { + scoreTextField.becomeFirstResponder() } } func textFieldShouldReturn(textField: UITextField) -> Bool { - // Tapping Return key focuses next text field. - if textField == firstNameTextField { - lastNameTextField.becomeFirstResponder() - } else { - textField.resignFirstResponder() + if textField == nameTextField { + scoreTextField.becomeFirstResponder() } return false } - - func textFieldDidEndEditing(textField: UITextField) { - // Update person when text field ends editing. - if textField == firstNameTextField { - person.firstName = textField.text - } else if textField == lastNameTextField { - person.lastName = textField.text - } - } - - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - // About to cancel or commit: end editing. - // This dismisses the keyboard early, and apply pending changes through - // textFieldDidEndEditing(_). - view.endEditing(true) - } } diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/PersonsViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonsViewController.swift similarity index 100% rename from DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/PersonsViewController.swift rename to DemoApps/GRDBDemoiOS/GRDBDemoiOS/PersonsViewController.swift diff --git a/DemoApps/GRDBDemoiOS/README.md b/DemoApps/GRDBDemoiOS/README.md deleted file mode 100644 index 1fd65d1b8..000000000 --- a/DemoApps/GRDBDemoiOS/README.md +++ /dev/null @@ -1,35 +0,0 @@ -GRDBDemoiOS -=========== - -This application runs an universal (iPhone + iPad) application that displays an editable list of persons. - -**To manually integrate GRDB as a Framework in your iOS application:** - -1. Drag the [GRDB project](../../GRDB.xcodeproj) in your own project. - -2. In the **Build Phase** tab of your target, add `GRDBiOS` in the **Target Dependencies** section. - -3. In the **Embedded Binaries** section of the **General** tab of your target, add GRDB.xcodeproj/Products/GRDB.framework (iOS). - -4. Run. - - -**To see usage of GRDB, check the following files:** - -- [Database.swift](GRDBDemoiOS/Database.swift) - - The setupDatabase() function sets up a global dbQueue that is accessible in the whole application. It is called by the [AppDelegate](GRDBDemoiOS/AppDelegate.swift) when application starts up. - - It uses [migrations](https://github.com/groue/GRDB.swift#migrations) to initialize the database, and [custom string comparison](https://github.com/groue/GRDB.swift#string-comparison) in order to let the database perform the localized sorting of persons by name. - -- [MasterViewController.swift](GRDBDemoiOS/MasterViewController.swift) - - MasterViewController is responsible for displaying the list of persons in a table view, deleting persons, and present a person edition form. - -- [Person.swift](GRDBDemoiOS/Person.swift) - - Person is a simple [Record](https://github.com/groue/GRDB.swift#records) subclass. - -- [DetailViewController.swift](GRDBDemoiOS/DetailViewController.swift) and [PersonEditionViewController.swift](GRDBDemoiOS/PersonEditionViewController.swift) - - Those two view controllers display and edit a Person, in total isolation from the database. diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo.xcodeproj/project.pbxproj b/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo.xcodeproj/project.pbxproj deleted file mode 100644 index edf8b6c7b..000000000 --- a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo.xcodeproj/project.pbxproj +++ /dev/null @@ -1,470 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 568C7A9A1CA6C63100796484 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7A991CA6C63100796484 /* AppDelegate.swift */; }; - 568C7A9C1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */; }; - 568C7A9F1CA6C63100796484 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 568C7A9D1CA6C63100796484 /* Main.storyboard */; }; - 568C7AA11CA6C63100796484 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 568C7AA01CA6C63100796484 /* Assets.xcassets */; }; - 568C7AA41CA6C63100796484 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 568C7AA21CA6C63100796484 /* LaunchScreen.storyboard */; }; - 568C7ADA1CA6C6D100796484 /* GRDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 568C7AD71CA6C6BF00796484 /* GRDB.framework */; }; - 568C7ADB1CA6C6D100796484 /* GRDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 568C7AD71CA6C6BF00796484 /* GRDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 568C7AE01CA6C7BC00796484 /* Person.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7ADF1CA6C7BC00796484 /* Person.swift */; }; - 568C7AE21CA6C97500796484 /* Database.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7AE11CA6C97500796484 /* Database.swift */; }; - 568C7AE41CA6CEBE00796484 /* PersonEditionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */; }; - 568C7AE61CA6F95300796484 /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7AE51CA6F95300796484 /* DemoViewController.swift */; }; - 568C7AE81CA6FB6600796484 /* PersonsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568C7AE71CA6FB6600796484 /* PersonsViewController.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 568C7ACE1CA6C6BF00796484 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = DC3773F319C8CBB3004FCF85; - remoteInfo = GRDBOSX; - }; - 568C7AD01CA6C6BF00796484 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 56553C181C3E906C00522B5C; - remoteInfo = GRDBOSXCrashTests; - }; - 568C7AD21CA6C6BF00796484 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 56E5D7F91B4D422D00430942; - remoteInfo = GRDBOSXTests; - }; - 568C7AD41CA6C6BF00796484 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 560C981A1C0E22D300BF8471; - remoteInfo = GRDBOSXPerformanceTests; - }; - 568C7AD61CA6C6BF00796484 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 56E5D7CA1B4D3FED00430942; - remoteInfo = GRDBiOS; - }; - 568C7AD81CA6C6BF00796484 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 56E5D7D31B4D3FEE00430942; - remoteInfo = GRDBiOSTests; - }; - 568C7ADC1CA6C6D100796484 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 56E5D7C91B4D3FED00430942; - remoteInfo = GRDBiOS; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 568C7ADE1CA6C6D100796484 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 568C7ADB1CA6C6D100796484 /* GRDB.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 568C7A961CA6C63100796484 /* GRDBFetchedRecordsControllerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBFetchedRecordsControllerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 568C7A991CA6C63100796484 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchedRecordsControllerDemoViewController.swift; sourceTree = ""; }; - 568C7A9E1CA6C63100796484 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 568C7AA01CA6C63100796484 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 568C7AA31CA6C63100796484 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 568C7AA51CA6C63100796484 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = ""; }; - 568C7ADF1CA6C7BC00796484 /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = ""; }; - 568C7AE11CA6C97500796484 /* Database.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Database.swift; sourceTree = ""; }; - 568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonEditionViewController.swift; sourceTree = ""; }; - 568C7AE51CA6F95300796484 /* DemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = ""; }; - 568C7AE71CA6FB6600796484 /* PersonsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonsViewController.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 568C7A931CA6C63100796484 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 568C7ADA1CA6C6D100796484 /* GRDB.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 568C7A8D1CA6C63100796484 = { - isa = PBXGroup; - children = ( - 568C7A981CA6C63100796484 /* GRDBFetchedRecordsControllerDemo */, - 568C7A971CA6C63100796484 /* Products */, - ); - sourceTree = ""; - }; - 568C7A971CA6C63100796484 /* Products */ = { - isa = PBXGroup; - children = ( - 568C7A961CA6C63100796484 /* GRDBFetchedRecordsControllerDemo.app */, - ); - name = Products; - sourceTree = ""; - }; - 568C7A981CA6C63100796484 /* GRDBFetchedRecordsControllerDemo */ = { - isa = PBXGroup; - children = ( - 568C7A991CA6C63100796484 /* AppDelegate.swift */, - 568C7AE11CA6C97500796484 /* Database.swift */, - 568C7ADF1CA6C7BC00796484 /* Person.swift */, - 568C7AEA1CA6FE6B00796484 /* Controllers */, - 568C7A9D1CA6C63100796484 /* Main.storyboard */, - 568C7AA01CA6C63100796484 /* Assets.xcassets */, - 568C7AA21CA6C63100796484 /* LaunchScreen.storyboard */, - 568C7AA51CA6C63100796484 /* Info.plist */, - 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */, - ); - path = GRDBFetchedRecordsControllerDemo; - sourceTree = ""; - }; - 568C7AC61CA6C6BF00796484 /* Products */ = { - isa = PBXGroup; - children = ( - 568C7ACF1CA6C6BF00796484 /* GRDB.framework */, - 568C7AD11CA6C6BF00796484 /* GRDBOSXCrashTests.xctest */, - 568C7AD31CA6C6BF00796484 /* GRDBTests.xctest */, - 568C7AD51CA6C6BF00796484 /* GRDBOSXPerformanceTests.xctest */, - 568C7AD71CA6C6BF00796484 /* GRDB.framework */, - 568C7AD91CA6C6BF00796484 /* GRDBTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 568C7AEA1CA6FE6B00796484 /* Controllers */ = { - isa = PBXGroup; - children = ( - 568C7AE51CA6F95300796484 /* DemoViewController.swift */, - 568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */, - 568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */, - 568C7AE71CA6FB6600796484 /* PersonsViewController.swift */, - ); - name = Controllers; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 568C7A951CA6C63100796484 /* GRDBFetchedRecordsControllerDemo */ = { - isa = PBXNativeTarget; - buildConfigurationList = 568C7AA81CA6C63100796484 /* Build configuration list for PBXNativeTarget "GRDBFetchedRecordsControllerDemo" */; - buildPhases = ( - 568C7A921CA6C63100796484 /* Sources */, - 568C7A931CA6C63100796484 /* Frameworks */, - 568C7A941CA6C63100796484 /* Resources */, - 568C7ADE1CA6C6D100796484 /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 568C7ADD1CA6C6D100796484 /* PBXTargetDependency */, - ); - name = GRDBFetchedRecordsControllerDemo; - productName = GRDBFetchedRecordsControllerDemo; - productReference = 568C7A961CA6C63100796484 /* GRDBFetchedRecordsControllerDemo.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 568C7A8E1CA6C63100796484 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0730; - ORGANIZATIONNAME = Pierlis; - TargetAttributes = { - 568C7A951CA6C63100796484 = { - CreatedOnToolsVersion = 7.3; - }; - }; - }; - buildConfigurationList = 568C7A911CA6C63100796484 /* Build configuration list for PBXProject "GRDBFetchedRecordsControllerDemo" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 568C7A8D1CA6C63100796484; - productRefGroup = 568C7A971CA6C63100796484 /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 568C7AC61CA6C6BF00796484 /* Products */; - ProjectRef = 568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 568C7A951CA6C63100796484 /* GRDBFetchedRecordsControllerDemo */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 568C7ACF1CA6C6BF00796484 /* GRDB.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = GRDB.framework; - remoteRef = 568C7ACE1CA6C6BF00796484 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 568C7AD11CA6C6BF00796484 /* GRDBOSXCrashTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = GRDBOSXCrashTests.xctest; - remoteRef = 568C7AD01CA6C6BF00796484 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 568C7AD31CA6C6BF00796484 /* GRDBTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = GRDBTests.xctest; - remoteRef = 568C7AD21CA6C6BF00796484 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 568C7AD51CA6C6BF00796484 /* GRDBOSXPerformanceTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = GRDBOSXPerformanceTests.xctest; - remoteRef = 568C7AD41CA6C6BF00796484 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 568C7AD71CA6C6BF00796484 /* GRDB.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = GRDB.framework; - remoteRef = 568C7AD61CA6C6BF00796484 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 568C7AD91CA6C6BF00796484 /* GRDBTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = GRDBTests.xctest; - remoteRef = 568C7AD81CA6C6BF00796484 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 568C7A941CA6C63100796484 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 568C7AA41CA6C63100796484 /* LaunchScreen.storyboard in Resources */, - 568C7AA11CA6C63100796484 /* Assets.xcassets in Resources */, - 568C7A9F1CA6C63100796484 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 568C7A921CA6C63100796484 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 568C7AE01CA6C7BC00796484 /* Person.swift in Sources */, - 568C7AE81CA6FB6600796484 /* PersonsViewController.swift in Sources */, - 568C7A9C1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift in Sources */, - 568C7AE21CA6C97500796484 /* Database.swift in Sources */, - 568C7AE61CA6F95300796484 /* DemoViewController.swift in Sources */, - 568C7AE41CA6CEBE00796484 /* PersonEditionViewController.swift in Sources */, - 568C7A9A1CA6C63100796484 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 568C7ADD1CA6C6D100796484 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = GRDBiOS; - targetProxy = 568C7ADC1CA6C6D100796484 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 568C7A9D1CA6C63100796484 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 568C7A9E1CA6C63100796484 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 568C7AA21CA6C63100796484 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 568C7AA31CA6C63100796484 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 568C7AA61CA6C63100796484 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 568C7AA71CA6C63100796484 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 568C7AA91CA6C63100796484 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - INFOPLIST_FILE = GRDBFetchedRecordsControllerDemo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBFetchedRecordsControllerDemo; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 568C7AAA1CA6C63100796484 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - INFOPLIST_FILE = GRDBFetchedRecordsControllerDemo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBFetchedRecordsControllerDemo; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 568C7A911CA6C63100796484 /* Build configuration list for PBXProject "GRDBFetchedRecordsControllerDemo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 568C7AA61CA6C63100796484 /* Debug */, - 568C7AA71CA6C63100796484 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 568C7AA81CA6C63100796484 /* Build configuration list for PBXNativeTarget "GRDBFetchedRecordsControllerDemo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 568C7AA91CA6C63100796484 /* Debug */, - 568C7AAA1CA6C63100796484 /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; -/* End XCConfigurationList section */ - }; - rootObject = 568C7A8E1CA6C63100796484 /* Project object */; -} diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/AppDelegate.swift b/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/AppDelegate.swift deleted file mode 100644 index d220f95cf..000000000 --- a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/AppDelegate.swift +++ /dev/null @@ -1,28 +0,0 @@ -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Setup database - setupDatabase() - return true - } - - func applicationDidReceiveMemoryWarning(application: UIApplication) { - // Release as much memory as possible. - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)) { - dbQueue.releaseMemory() - } - } - - func applicationDidEnterBackground(application: UIApplication) { - let task = application.beginBackgroundTaskWithExpirationHandler(nil) - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { - // Release as much memory as possible. - dbQueue.releaseMemory() - application.endBackgroundTask(task) - } - } -} diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 118c98f74..000000000 --- a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Base.lproj/LaunchScreen.storyboard b/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e183..000000000 --- a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Base.lproj/Main.storyboard b/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Base.lproj/Main.storyboard deleted file mode 100644 index fa91d0432..000000000 --- a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Base.lproj/Main.storyboard +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Database.swift b/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Database.swift deleted file mode 100644 index 3b1c8f33e..000000000 --- a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Database.swift +++ /dev/null @@ -1,51 +0,0 @@ -import GRDB - -/// The shared database queue, stored in a global. -/// It is initialized in setupDatabase() -var dbQueue: DatabaseQueue! - -func setupDatabase() { - - // Connect to the database - // - // See https://github.com/groue/GRDB.swift/#database-connections - - let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).first! as NSString - let databasePath = documentsPath.stringByAppendingPathComponent("db.sqlite") - dbQueue = try! DatabaseQueue(path: databasePath) - - - // SQLite does not support Unicode: let's add a custom collation which will - // allow us to sort persons by name. - // - // See https://github.com/groue/GRDB.swift/#string-comparison - - let collation = DatabaseCollation("localized_case_insensitive") { (lhs, rhs) in - return (lhs as NSString).localizedCaseInsensitiveCompare(rhs) - } - dbQueue.addCollation(collation) - - - // Use DatabaseMigrator to setup the database - // - // See https://github.com/groue/GRDB.swift/#migrations - - var migrator = DatabaseMigrator() - migrator.registerMigration("createPersons") { db in - try db.execute( - "CREATE TABLE persons (" + - "id INTEGER PRIMARY KEY, " + - "name TEXT NOT NULL COLLATE localized_case_insensitive, " + - "score INTEGER NOT NULL " + - ")") - } - migrator.registerMigration("addPersons") { db in - try Person(name: "Alice", score: 150).insert(db) - try Person(name: "Bob", score: 70).insert(db) - try Person(name: "Craig", score: 220).insert(db) - try Person(name: "David", score: 80).insert(db) - try Person(name: "Elise", score: 100).insert(db) - try Person(name: "Fiona", score: 40).insert(db) - } - try! migrator.migrate(dbQueue) -} \ No newline at end of file diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Info.plist b/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Info.plist deleted file mode 100644 index 6c48029d6..000000000 --- a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Info.plist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - - diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Person.swift b/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Person.swift deleted file mode 100644 index 85a320586..000000000 --- a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/Person.swift +++ /dev/null @@ -1,37 +0,0 @@ -import GRDB - -class Person: Record { - var id: Int64? - var name: String - var score: Int - - init(name: String, score: Int) { - self.name = name - self.score = score - super.init() - } - - // MARK: Record overrides - - override class func databaseTableName() -> String { - return "persons" - } - - required init(_ row: Row) { - id = row.value(named: "id") - name = row.value(named: "name") - score = row.value(named: "score") - super.init(row) - } - - override var persistentDictionary: [String : DatabaseValueConvertible?] { - return [ - "id": id, - "name": name, - "score": score] - } - - override func didInsertWithRowID(rowID: Int64, forColumn column: String?) { - id = rowID - } -} diff --git a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/PersonEditionViewController.swift b/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/PersonEditionViewController.swift deleted file mode 100644 index 115847d2d..000000000 --- a/DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo/PersonEditionViewController.swift +++ /dev/null @@ -1,104 +0,0 @@ -import UIKit - -protocol PersonEditionViewControllerDelegate: class { - func personEditionControllerDidComplete(controller: PersonEditionViewController) -} - -class PersonEditionViewController: UITableViewController { - weak var delegate: PersonEditionViewControllerDelegate? - var person: Person! { didSet { configureView() } } - var cancelButtonHidden: Bool = false { didSet { configureView() } } - var commitButtonHidden: Bool = false { didSet { configureView() } } - - @IBOutlet private weak var cancelBarButtonItem: UIBarButtonItem! - @IBOutlet private weak var commitBarButtonItem: UIBarButtonItem! - @IBOutlet private weak var nameCell: UITableViewCell! - @IBOutlet private weak var nameTextField: UITextField! - @IBOutlet private weak var scoreCell: UITableViewCell! - @IBOutlet private weak var scoreTextField: UITextField! - - func applyChanges() { - if let name = nameTextField.text where !name.isEmpty { - person.name = name - } - person.score = scoreTextField.text.flatMap { Int($0) } ?? 0 - } - - override func viewWillAppear(animated: Bool) { - super.viewWillAppear(animated) - configureView() - nameTextField.becomeFirstResponder() - } - - private func configureView() { - guard isViewLoaded() else { return } - - nameTextField.text = person.name - if person.score == 0 && person.id == nil { - scoreTextField.text = "" - } else { - scoreTextField.text = "\(person.score)" - } - - if cancelButtonHidden { - navigationItem.leftBarButtonItem = nil - } else { - navigationItem.leftBarButtonItem = cancelBarButtonItem - } - - if cancelButtonHidden { - navigationItem.rightBarButtonItem = nil - } else { - navigationItem.rightBarButtonItem = commitBarButtonItem - } - } -} - - -// MARK: - Navigation - -extension PersonEditionViewController { - - override func shouldPerformSegueWithIdentifier(identifier: String, sender: AnyObject?) -> Bool { - // Force keyboard to dismiss early - view.endEditing(true) - return true - } - - override func willMoveToParentViewController(parent: UIViewController?) { - super.willMoveToParentViewController(parent) - - if parent == nil { - // Self is popping from its navigation controller - delegate?.personEditionControllerDidComplete(self) - } - } - -} - - -// MARK: - Form - -extension PersonEditionViewController: UITextFieldDelegate { - - override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { - tableView.deselectRowAtIndexPath(indexPath, animated: false) - - guard let cell = tableView.cellForRowAtIndexPath(indexPath) else { - return - } - - if cell == nameCell { - nameTextField.becomeFirstResponder() - } else if cell == scoreCell { - scoreTextField.becomeFirstResponder() - } - } - - func textFieldShouldReturn(textField: UITextField) -> Bool { - if textField == nameTextField { - scoreTextField.becomeFirstResponder() - } - return false - } -} diff --git a/GRDB.xcworkspace/contents.xcworkspacedata b/GRDB.xcworkspace/contents.xcworkspacedata index c10b2e11b..a4181869b 100644 --- a/GRDB.xcworkspace/contents.xcworkspacedata +++ b/GRDB.xcworkspace/contents.xcworkspacedata @@ -29,9 +29,6 @@ - -