Merge FetchedRecordsController demo in GRDBDemoiOS

This commit is contained in:
Gwendal Roué committed 2016-03-26 18:39:03 +01:00
1 parent 703aa07407
commit d1b21708e6
26 files changed
+518 -1963

No files matched your search

@@ -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 = "<group>"; };
56900E411BBFF7D500B815B5 /* PersonEditionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonEditionViewController.swift; sourceTree = "<group>"; };
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 = "<group>"; };
56B8F4591B4E22B200C24296 /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = "<group>"; };
56B8F45B1B4E22B200C24296 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = "<group>"; };
56B8F45E1B4E22B200C24296 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
56B8F4601B4E22B200C24296 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
56B8F4631B4E22B200C24296 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
56B8F4651B4E22B200C24296 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = "<group>"; };
56B8F4981B4E23AA00C24296 /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = "<group>"; };
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 = "<group>"; };
568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchedRecordsControllerDemoViewController.swift; sourceTree = "<group>"; };
568C7A9E1CA6C63100796484 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
568C7AA01CA6C63100796484 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
568C7AA31CA6C63100796484 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
568C7AA51CA6C63100796484 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = "<group>"; };
568C7ADF1CA6C7BC00796484 /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = "<group>"; };
568C7AE11CA6C97500796484 /* Database.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Database.swift; sourceTree = "<group>"; };
568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonEditionViewController.swift; sourceTree = "<group>"; };
568C7AE51CA6F95300796484 /* DemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = "<group>"; };
568C7AE71CA6FB6600796484 /* PersonsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonsViewController.swift; sourceTree = "<group>"; };
/* 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 = "<group>";
};
568C7A971CA6C63100796484 /* Products */ = {
isa = PBXGroup;
children = (
568C7A961CA6C63100796484 /* GRDBDemoiOS.app */,
);
name = Products;
sourceTree = "<group>";
};
56900E3C1BBFF2C400B815B5 /* Resources */ = {
568C7A981CA6C63100796484 /* GRDBDemoiOS */ = {
isa = PBXGroup;
children = (
56B8F4601B4E22B200C24296 /* Assets.xcassets */,
56B8F4621B4E22B200C24296 /* LaunchScreen.storyboard */,
56B8F45D1B4E22B200C24296 /* Main.storyboard */,
);
name = Resources;
sourceTree = "<group>";
};
56900E3D1BBFF2DB00B815B5 /* Frameworks */ = {
isa = PBXGroup;
children = (
56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */,
);
name = Frameworks;
sourceTree = "<group>";
};
56900E3E1BBFF2E900B815B5 /* Controllers */ = {
isa = PBXGroup;
children = (
56B8F45B1B4E22B200C24296 /* DetailViewController.swift */,
56B8F4591B4E22B200C24296 /* MasterViewController.swift */,
56900E411BBFF7D500B815B5 /* PersonEditionViewController.swift */,
);
name = Controllers;
sourceTree = "<group>";
};
56900E3F1BBFF2F200B815B5 /* Models */ = {
isa = PBXGroup;
children = (
56B8F4981B4E23AA00C24296 /* Person.swift */,
);
name = Models;
sourceTree = "<group>";
};
56900E401BBFF31800B815B5 /* Supporting Files */ = {
isa = PBXGroup;
children = (
56B8F4651B4E22B200C24296 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
56B8F44B1B4E22B200C24296 = {
isa = PBXGroup;
children = (
56B8F4561B4E22B200C24296 /* GRDBDemoiOS */,
56B8F4551B4E22B200C24296 /* Products */,
);
sourceTree = "<group>";
};
56B8F4551B4E22B200C24296 /* Products */ = {
isa = PBXGroup;
children = (
56B8F4541B4E22B200C24296 /* GRDBDemoiOS.app */,
);
name = Products;
sourceTree = "<group>";
};
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 = "<group>";
};
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 = "<group>";
};
568C7AEA1CA6FE6B00796484 /* Controllers */ = {
isa = PBXGroup;
children = (
568C7AE51CA6F95300796484 /* DemoViewController.swift */,
568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */,
568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */,
568C7AE71CA6FB6600796484 /* PersonsViewController.swift */,
);
name = Controllers;
sourceTree = "<group>";
};
/* 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 = "<group>";
};
56B8F4621B4E22B200C24296 /* LaunchScreen.storyboard */ = {
568C7AA21CA6C63100796484 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
56B8F4631B4E22B200C24296 /* Base */,
568C7AA31CA6C63100796484 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
@@ -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 */;
}
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:GRDBDemoiOS.xcodeproj">
</FileRef>
</Workspace>
@@ -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
}
}
@@ -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" : {
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
@@ -16,29 +15,8 @@
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright © 2015 Gwendal Roué. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<rect key="frame" x="20" y="559" width="560" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="GRDBDemoiOS" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="20" y="180" width="560" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
<constraint firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/>
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -1,131 +1,133 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="H1p-Uh-vWS">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="UAh-8N-CM8">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--Master-->
<scene sceneID="pY4-Hu-kfo">
<!--Hall Of Fame-->
<scene sceneID="8jG-C9-QsI">
<objects>
<navigationController title="Master" id="RMx-3f-FxP" sceneMemberID="viewController">
<navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="Pmd-2v-anx">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="7bK-jq-Zjz" kind="relationship" relationship="rootViewController" id="tsl-Nk-0bq"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8fS-aE-onr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-38" y="-630"/>
</scene>
<!--Detail-->
<scene sceneID="yUG-lL-AsK">
<objects>
<viewController title="Detail" id="JEX-9P-axG" customClass="DetailViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="SYR-Wa-9uf"/>
<viewControllerLayoutGuide type="bottom" id="GAO-Cl-Wes"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="svH-Pt-448">
<tableViewController id="cyv-nk-Plb" customClass="PersonsViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="oON-zg-8kO">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Detail view content goes here" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="0XM-y9-sOw">
<rect key="frame" x="20" y="292" width="560" height="17"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" size="system"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="0XM-y9-sOw" firstAttribute="leading" secondItem="svH-Pt-448" secondAttribute="leading" constant="20" symbolic="YES" id="Tsc-yG-G1q"/>
<constraint firstItem="0XM-y9-sOw" firstAttribute="centerY" secondItem="svH-Pt-448" secondAttribute="centerY" id="jWN-iV-94e"/>
<constraint firstAttribute="trailing" secondItem="0XM-y9-sOw" secondAttribute="trailing" constant="20" symbolic="YES" id="tHV-ZD-HQj"/>
</constraints>
</view>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Person" textLabel="XIE-DF-pSO" detailTextLabel="vyz-CH-eMb" style="IBUITableViewCellStyleValue1" id="V5t-oJ-KD9">
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="V5t-oJ-KD9" id="Coo-th-ywF">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="XIE-DF-pSO">
<rect key="frame" x="15" y="12" width="32" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vyz-CH-eMb">
<rect key="frame" x="523" y="12" width="42" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="iNr-Oe-muq" kind="show" identifier="EditPerson" id="czF-1h-sYn"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="cyv-nk-Plb" id="uBb-Bn-Lhg"/>
<outlet property="delegate" destination="cyv-nk-Plb" id="nLb-Ak-ZXS"/>
</connections>
</tableView>
<toolbarItems/>
<navigationItem key="navigationItem" title="Detail" id="mOI-FS-AaM"/>
<navigationItem key="navigationItem" title="Hall Of Fame" id="YLU-iz-PGw"/>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="detailDescriptionLabel" destination="0XM-y9-sOw" id="deQ-Na-JPF"/>
<segue destination="ein-Sr-i8w" kind="presentation" identifier="NewPerson" id="zii-bJ-cOA"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="FJe-Yq-33r" sceneMemberID="firstResponder"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="PrM-ex-2C8" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="709" y="129"/>
<point key="canvasLocation" x="630" y="640"/>
</scene>
<!--Person Edition View Controller-->
<scene sceneID="hZT-8U-F5G">
<scene sceneID="Juk-Ad-tZ2">
<objects>
<tableViewController id="yMU-Wr-YuI" customClass="PersonEditionViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="W7Z-fg-c9y">
<tableViewController id="iNr-Oe-muq" customClass="PersonEditionViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="vlV-lc-eQA">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<sections>
<tableViewSection id="jAm-13-xC3">
<tableViewSection id="Nzq-eO-jT3">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="M9a-av-50p">
<rect key="frame" x="0.0" y="99" width="600" height="44"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="2gb-gB-918">
<rect key="frame" x="0.0" y="64" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="M9a-av-50p" id="z18-Cs-DYr">
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2gb-gB-918" id="iyM-TJ-JB4">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="BDD-vR-uvL">
<rect key="frame" x="106" y="11" width="479" height="21"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4y6-ck-zn3">
<rect key="frame" x="18" y="11" width="45" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no" spellCheckingType="no"/>
<connections>
<outlet property="delegate" destination="yMU-Wr-YuI" id="kl9-oG-bcm"/>
</connections>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="First Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fUF-iv-npM">
<rect key="frame" x="15" y="11" width="83" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.1137254902" green="0.47843137250000001" blue="0.98039215690000003" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Name" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="m5m-Zs-j0z">
<rect key="frame" x="71" y="11" width="511" height="21"/>
<color key="textColor" red="0.11372549019607843" green="0.47843137254901963" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no" spellCheckingType="no" returnKeyType="next"/>
<connections>
<outlet property="delegate" destination="iNr-Oe-muq" id="K2p-7d-teD"/>
</connections>
</textField>
</subviews>
<constraints>
<constraint firstItem="BDD-vR-uvL" firstAttribute="centerY" secondItem="z18-Cs-DYr" secondAttribute="centerY" id="9Rw-U2-gEE"/>
<constraint firstAttribute="trailing" secondItem="BDD-vR-uvL" secondAttribute="trailing" constant="15" id="nQF-Sy-r5l"/>
<constraint firstItem="fUF-iv-npM" firstAttribute="centerY" secondItem="z18-Cs-DYr" secondAttribute="centerY" id="ofb-oL-lAk"/>
<constraint firstItem="BDD-vR-uvL" firstAttribute="leading" secondItem="fUF-iv-npM" secondAttribute="trailing" constant="8" symbolic="YES" id="pL4-Tm-5q7"/>
<constraint firstItem="fUF-iv-npM" firstAttribute="leading" secondItem="z18-Cs-DYr" secondAttribute="leading" constant="15" id="tBn-VL-Q7E"/>
<constraint firstItem="4y6-ck-zn3" firstAttribute="centerY" secondItem="iyM-TJ-JB4" secondAttribute="centerY" id="8x0-x4-9KM"/>
<constraint firstItem="m5m-Zs-j0z" firstAttribute="baseline" secondItem="4y6-ck-zn3" secondAttribute="baseline" id="FzJ-zg-dH0"/>
<constraint firstAttribute="trailingMargin" secondItem="m5m-Zs-j0z" secondAttribute="trailing" constant="10" id="JsE-8v-XAS"/>
<constraint firstItem="m5m-Zs-j0z" firstAttribute="leading" secondItem="4y6-ck-zn3" secondAttribute="trailing" constant="8" symbolic="YES" id="Msf-6H-s72"/>
<constraint firstItem="4y6-ck-zn3" firstAttribute="leading" secondItem="iyM-TJ-JB4" secondAttribute="leadingMargin" constant="10" id="u1M-G3-Ued"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="TEu-C2-7tX">
<rect key="frame" x="0.0" y="143" width="600" height="44"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="vp3-Ft-Gth">
<rect key="frame" x="0.0" y="108" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="TEu-C2-7tX" id="awh-JA-Hz6">
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="vp3-Ft-Gth" id="ccO-0O-u72">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="iqx-ux-kA0">
<rect key="frame" x="105" y="11" width="480" height="21"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" text="Score" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6h8-IF-U4B">
<rect key="frame" x="18" y="11" width="45" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no" spellCheckingType="no"/>
<connections>
<outlet property="delegate" destination="yMU-Wr-YuI" id="pIN-qZ-ntI"/>
</connections>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="Last Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7dD-VT-wdQ">
<rect key="frame" x="15" y="11" width="82" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.1137254902" green="0.47843137250000001" blue="0.98039215690000003" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Score" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="rZ9-Fa-cyr">
<rect key="frame" x="71" y="11" width="511" height="21"/>
<color key="textColor" red="0.11372549019607843" green="0.47843137254901963" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="numberPad" returnKeyType="done"/>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="iqx-ux-kA0" secondAttribute="trailing" constant="15" id="UVH-DD-pHC"/>
<constraint firstItem="7dD-VT-wdQ" firstAttribute="centerY" secondItem="awh-JA-Hz6" secondAttribute="centerY" id="Vwn-I3-e7h"/>
<constraint firstItem="iqx-ux-kA0" firstAttribute="centerY" secondItem="awh-JA-Hz6" secondAttribute="centerY" id="VzL-HK-apN"/>
<constraint firstItem="iqx-ux-kA0" firstAttribute="leading" secondItem="7dD-VT-wdQ" secondAttribute="trailing" constant="8" symbolic="YES" id="fDY-Ju-iSw"/>
<constraint firstItem="7dD-VT-wdQ" firstAttribute="leading" secondItem="awh-JA-Hz6" secondAttribute="leading" constant="15" id="j64-an-fjP"/>
<constraint firstItem="rZ9-Fa-cyr" firstAttribute="leading" secondItem="6h8-IF-U4B" secondAttribute="trailing" constant="8" symbolic="YES" id="1Aw-5A-L3h"/>
<constraint firstAttribute="trailingMargin" secondItem="rZ9-Fa-cyr" secondAttribute="trailing" constant="10" id="Gso-FU-Ct1"/>
<constraint firstItem="6h8-IF-U4B" firstAttribute="centerY" secondItem="ccO-0O-u72" secondAttribute="centerY" id="wnh-aV-u1G"/>
<constraint firstItem="rZ9-Fa-cyr" firstAttribute="baseline" secondItem="6h8-IF-U4B" secondAttribute="baseline" id="ybu-qY-WT7"/>
<constraint firstItem="6h8-IF-U4B" firstAttribute="leading" secondItem="ccO-0O-u72" secondAttribute="leadingMargin" constant="10" id="yr9-Zm-MUx"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
@@ -133,129 +135,195 @@
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="yMU-Wr-YuI" id="fDY-MJ-pJo"/>
<outlet property="delegate" destination="yMU-Wr-YuI" id="Un1-A3-CJp"/>
<outlet property="dataSource" destination="iNr-Oe-muq" id="67O-XE-MeV"/>
<outlet property="delegate" destination="iNr-Oe-muq" id="vLD-QQ-zR2"/>
</connections>
</tableView>
<toolbarItems/>
<navigationItem key="navigationItem" id="Rwz-Rp-lmd">
<barButtonItem key="rightBarButtonItem" style="done" systemItem="done" id="NJu-k4-mIi">
<navigationItem key="navigationItem" id="U4g-xG-W8b">
<barButtonItem key="leftBarButtonItem" systemItem="cancel" id="VIN-Hi-Twt">
<connections>
<segue destination="FMm-Lo-i3b" kind="unwind" identifier="commit" unwindAction="commitPersonEdition:" id="dkC-cp-6iC"/>
<segue destination="lTz-K0-aRY" kind="unwind" unwindAction="cancelPersonEdition:" id="fOs-ol-qJL"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" systemItem="done" id="2um-u5-BhV">
<connections>
<segue destination="lTz-K0-aRY" kind="unwind" identifier="" unwindAction="commitPersonEdition:" id="Y1E-dI-wcl"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="firstNameTableViewCell" destination="M9a-av-50p" id="vXh-ik-bqv"/>
<outlet property="firstNameTextField" destination="BDD-vR-uvL" id="BYU-BL-kha"/>
<outlet property="lastNameTableViewCell" destination="TEu-C2-7tX" id="wDv-if-Gkl"/>
<outlet property="lastNameTextField" destination="iqx-ux-kA0" id="wOu-gU-WlV"/>
<outlet property="cancelBarButtonItem" destination="VIN-Hi-Twt" id="dET-mF-ZXe"/>
<outlet property="commitBarButtonItem" destination="2um-u5-BhV" id="Jym-us-zdP"/>
<outlet property="nameCell" destination="2gb-gB-918" id="ch2-MB-uRm"/>
<outlet property="nameTextField" destination="m5m-Zs-j0z" id="A6a-pw-q8s"/>
<outlet property="scoreCell" destination="vp3-Ft-Gth" id="b8A-42-8Dw"/>
<outlet property="scoreTextField" destination="rZ9-Fa-cyr" id="4kw-gV-uih"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="23u-wY-35e" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="FMm-Lo-i3b" userLabel="Exit" sceneMemberID="exit"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="fNC-Ls-uRw" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="lTz-K0-aRY" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="2301" y="-630"/>
<point key="canvasLocation" x="1450" y="1435"/>
</scene>
<!--GRDB Demo-->
<scene sceneID="XjB-aQ-v94">
<objects>
<tableViewController id="9kw-c5-KTk" customClass="DemoViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="f4Y-o2-7VW">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<sections>
<tableViewSection id="dCg-qU-h2X">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="clL-nG-zPX" style="IBUITableViewCellStyleDefault" id="kJB-sX-YAb">
<rect key="frame" x="0.0" y="64" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="kJB-sX-YAb" id="f5l-ob-3DG">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Simple TableView" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="clL-nG-zPX">
<rect key="frame" x="15" y="0.0" width="550" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="cyv-nk-Plb" kind="show" id="Bgq-9t-jRc"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="I78-c5-0kp" style="IBUITableViewCellStyleDefault" id="q4C-mT-5mi">
<rect key="frame" x="0.0" y="108" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="q4C-mT-5mi" id="2Cu-K1-hiz">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="FetchedRecordsController" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="I78-c5-0kp">
<rect key="frame" x="15" y="0.0" width="550" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="PJp-Eq-ZjA" kind="show" id="1fk-ZR-6XN"/>
</connections>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="9kw-c5-KTk" id="IK7-Os-Odc"/>
<outlet property="delegate" destination="9kw-c5-KTk" id="U7E-yB-s8d"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="GRDB Demo" id="z0z-02-Ucy"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="OhY-4B-BcJ" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-190" y="1435"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="GQC-vK-8JG">
<scene sceneID="2KX-IU-Z5Q">
<objects>
<navigationController id="IJV-AU-xKl" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="y7A-ea-ZFU">
<navigationController id="ein-Sr-i8w" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="zIT-dB-Mfo">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="yMU-Wr-YuI" kind="relationship" relationship="rootViewController" id="1PW-hN-E5f"/>
<segue destination="iNr-Oe-muq" kind="relationship" relationship="rootViewController" id="e5b-3U-9Vz"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4jR-xV-SBm" userLabel="First Responder" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="kNr-vk-I5l" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1481" y="-630"/>
<point key="canvasLocation" x="630" y="1435"/>
</scene>
<!--Split View Controller-->
<scene sceneID="Nki-YV-4Qg">
<!--Navigation Controller-->
<scene sceneID="N1X-4j-Re4">
<objects>
<splitViewController id="H1p-Uh-vWS" sceneMemberID="viewController">
<toolbarItems/>
<navigationController id="UAh-8N-CM8" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="U7d-1C-GnL">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="RMx-3f-FxP" kind="relationship" relationship="masterViewController" id="BlO-5A-QYV"/>
<segue destination="vC3-pB-5Vb" kind="relationship" relationship="detailViewController" id="Tll-UG-LXB"/>
<segue destination="9kw-c5-KTk" kind="relationship" relationship="rootViewController" id="qDW-qI-Hyg"/>
</connections>
</splitViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cZU-Oi-B1e" sceneMemberID="firstResponder"/>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="sVt-e9-ghQ" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-856" y="-330"/>
<point key="canvasLocation" x="-1006" y="1435"/>
</scene>
<!--Master-->
<scene sceneID="smW-Zh-WAh">
<!--Hall Of Fame-->
<scene sceneID="9su-ms-vdJ">
<objects>
<tableViewController title="Master" clearsSelectionOnViewWillAppear="NO" id="7bK-jq-Zjz" customClass="MasterViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="r7i-6Z-zg0">
<tableViewController id="PJp-Eq-ZjA" customClass="FetchedRecordsControllerDemoViewController" customModule="GRDBDemoiOS" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="tX0-ON-WSI">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="Arm-wq-HPj" style="IBUITableViewCellStyleDefault" id="WCw-Qf-5nD">
<rect key="frame" x="0.0" y="86" width="600" height="44"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Person" textLabel="G8y-VE-YRu" detailTextLabel="NNc-J4-xiE" style="IBUITableViewCellStyleValue1" id="bFj-Hd-fwd">
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WCw-Qf-5nD" id="37f-cq-3Eg">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bFj-Hd-fwd" id="kDf-TZ-xhb">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Arm-wq-HPj">
<rect key="frame" x="15" y="0.0" width="570" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="G8y-VE-YRu">
<rect key="frame" x="15" y="12" width="32" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="NNc-J4-xiE">
<rect key="frame" x="523" y="12" width="42" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<segue destination="vC3-pB-5Vb" kind="showDetail" identifier="showPerson" id="vhz-QC-pld"/>
<segue destination="iNr-Oe-muq" kind="show" identifier="EditPerson" id="Lgu-Yd-HSy"/>
</connections>
</tableViewCell>
</prototypes>
<sections/>
<connections>
<outlet property="dataSource" destination="7bK-jq-Zjz" id="Gho-Na-rnu"/>
<outlet property="delegate" destination="7bK-jq-Zjz" id="RA6-mI-bju"/>
<outlet property="dataSource" destination="PJp-Eq-ZjA" id="MkQ-WQ-sTh"/>
<outlet property="delegate" destination="PJp-Eq-ZjA" id="quj-Sp-DuL"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Master" id="Zdf-7t-Un8">
<barButtonItem key="rightBarButtonItem" systemItem="add" id="q2y-Jp-QNL">
<connections>
<segue destination="IJV-AU-xKl" kind="popoverPresentation" identifier="editNewPerson" popoverAnchorBarButtonItem="q2y-Jp-QNL" id="KcV-Yc-DEu">
<popoverArrowDirection key="popoverArrowDirection" up="YES" down="YES" left="YES" right="YES"/>
</segue>
</connections>
</barButtonItem>
<toolbarItems>
<barButtonItem title="Item" id="hMF-Rv-dAe"/>
</toolbarItems>
<navigationItem key="navigationItem" title="Hall Of Fame" id="QIv-M6-kT1">
<barButtonItem key="rightBarButtonItem" systemItem="add" id="2bK-Fl-55Q"/>
</navigationItem>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Rux-fX-hf1" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="709" y="-630"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="r7l-gg-dq7">
<objects>
<navigationController id="vC3-pB-5Vb" sceneMemberID="viewController">
<navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="DjV-YW-jjY">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<segue destination="JEX-9P-axG" kind="relationship" relationship="rootViewController" id="GKi-kA-LjT"/>
<segue destination="ein-Sr-i8w" kind="presentation" identifier="NewPerson" id="7PC-xN-zD4"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="SLD-UC-DBI" userLabel="First Responder" sceneMemberID="firstResponder"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="af5-Qo-AkD" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-45" y="129"/>
<point key="canvasLocation" x="630" y="2254"/>
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="vhz-QC-pld"/>
<segue reference="7PC-xN-zD4"/>
<segue reference="Lgu-Yd-HSy"/>
</inferredMetricsTieBreakers>
</document>
+11 -44
View File
@@ -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)
}
@@ -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()
}
}
@@ -30,28 +30,9 @@
<array>
<string>armv7</string>
</array>
<key>UIStatusBarTintParameters</key>
<dict>
<key>UINavigationBar</key>
<dict>
<key>Style</key>
<string>UIBarStyleDefault</string>
<key>Translucent</key>
<false/>
</dict>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
@@ -1,165 +0,0 @@
import UIKit
import GRDB
class MasterViewController: UITableViewController, FetchedRecordsControllerDelegate {
var fetchedRecordsController: FetchedRecordsController<Person>!
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<T>(controller: FetchedRecordsController<T>) {
tableView.beginUpdates()
}
func controller<T>(controller: FetchedRecordsController<T>, 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<T>(controller: FetchedRecordsController<T>) {
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..<count - 1 {
let j = Int(arc4random_uniform(UInt32(count - i))) + i
guard i != j else { continue }
swap(&self[i], &self[j])
}
}
}
+13 -36
View File
@@ -1,23 +1,17 @@
import GRDB
class Person : Record {
var id: Int64!
var firstName: String?
var lastName: String?
var fullName: String {
return [firstName, lastName].flatMap { $0 }.filter { !$0.isEmpty }.joinWithSeparator(" ")
}
var visible: Bool = true
var position: Int64 = 0
class Person: Record {
var id: Int64?
var name: String
var score: Int
init(firstName: String? = nil, lastName: String? = nil) {
self.firstName = firstName
self.lastName = lastName
init(name: String, score: Int) {
self.name = name
self.score = score
super.init()
}
// MARK: - Record
// MARK: Record overrides
override class func databaseTableName() -> 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)
}
}
@@ -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)
}
}
-35
View File
@@ -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.
@@ -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 = "<group>"; };
568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchedRecordsControllerDemoViewController.swift; sourceTree = "<group>"; };
568C7A9E1CA6C63100796484 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
568C7AA01CA6C63100796484 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
568C7AA31CA6C63100796484 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
568C7AA51CA6C63100796484 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
568C7AC51CA6C6BF00796484 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = "<group>"; };
568C7ADF1CA6C7BC00796484 /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = "<group>"; };
568C7AE11CA6C97500796484 /* Database.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Database.swift; sourceTree = "<group>"; };
568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonEditionViewController.swift; sourceTree = "<group>"; };
568C7AE51CA6F95300796484 /* DemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = "<group>"; };
568C7AE71CA6FB6600796484 /* PersonsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PersonsViewController.swift; sourceTree = "<group>"; };
/* 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 = "<group>";
};
568C7A971CA6C63100796484 /* Products */ = {
isa = PBXGroup;
children = (
568C7A961CA6C63100796484 /* GRDBFetchedRecordsControllerDemo.app */,
);
name = Products;
sourceTree = "<group>";
};
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 = "<group>";
};
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 = "<group>";
};
568C7AEA1CA6FE6B00796484 /* Controllers */ = {
isa = PBXGroup;
children = (
568C7AE51CA6F95300796484 /* DemoViewController.swift */,
568C7A9B1CA6C63100796484 /* FetchedRecordsControllerDemoViewController.swift */,
568C7AE31CA6CEBE00796484 /* PersonEditionViewController.swift */,
568C7AE71CA6FB6600796484 /* PersonsViewController.swift */,
);
name = Controllers;
sourceTree = "<group>";
};
/* 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 = "<group>";
};
568C7AA21CA6C63100796484 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
568C7AA31CA6C63100796484 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* 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 */;
}
@@ -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)
}
}
}
@@ -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"
}
}
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
@@ -1,329 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="UAh-8N-CM8">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--Hall Of Fame-->
<scene sceneID="8jG-C9-QsI">
<objects>
<tableViewController id="cyv-nk-Plb" customClass="PersonsViewController" customModule="GRDBFetchedRecordsControllerDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="oON-zg-8kO">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Person" textLabel="XIE-DF-pSO" detailTextLabel="vyz-CH-eMb" style="IBUITableViewCellStyleValue1" id="V5t-oJ-KD9">
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="V5t-oJ-KD9" id="Coo-th-ywF">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="XIE-DF-pSO">
<rect key="frame" x="15" y="12" width="32" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="vyz-CH-eMb">
<rect key="frame" x="523" y="12" width="42" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="iNr-Oe-muq" kind="show" identifier="EditPerson" id="czF-1h-sYn"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="cyv-nk-Plb" id="uBb-Bn-Lhg"/>
<outlet property="delegate" destination="cyv-nk-Plb" id="nLb-Ak-ZXS"/>
</connections>
</tableView>
<toolbarItems/>
<navigationItem key="navigationItem" title="Hall Of Fame" id="YLU-iz-PGw"/>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<segue destination="ein-Sr-i8w" kind="presentation" identifier="NewPerson" id="zii-bJ-cOA"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="PrM-ex-2C8" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="630" y="640"/>
</scene>
<!--Person Edition View Controller-->
<scene sceneID="Juk-Ad-tZ2">
<objects>
<tableViewController id="iNr-Oe-muq" customClass="PersonEditionViewController" customModule="GRDBFetchedRecordsControllerDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="vlV-lc-eQA">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<sections>
<tableViewSection id="Nzq-eO-jT3">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="2gb-gB-918">
<rect key="frame" x="0.0" y="64" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2gb-gB-918" id="iyM-TJ-JB4">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4y6-ck-zn3">
<rect key="frame" x="18" y="11" width="45" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Name" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="m5m-Zs-j0z">
<rect key="frame" x="71" y="11" width="511" height="21"/>
<color key="textColor" red="0.11372549019607843" green="0.47843137254901963" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="no" spellCheckingType="no" returnKeyType="next"/>
<connections>
<outlet property="delegate" destination="iNr-Oe-muq" id="K2p-7d-teD"/>
</connections>
</textField>
</subviews>
<constraints>
<constraint firstItem="4y6-ck-zn3" firstAttribute="centerY" secondItem="iyM-TJ-JB4" secondAttribute="centerY" id="8x0-x4-9KM"/>
<constraint firstItem="m5m-Zs-j0z" firstAttribute="baseline" secondItem="4y6-ck-zn3" secondAttribute="baseline" id="FzJ-zg-dH0"/>
<constraint firstAttribute="trailingMargin" secondItem="m5m-Zs-j0z" secondAttribute="trailing" constant="10" id="JsE-8v-XAS"/>
<constraint firstItem="m5m-Zs-j0z" firstAttribute="leading" secondItem="4y6-ck-zn3" secondAttribute="trailing" constant="8" symbolic="YES" id="Msf-6H-s72"/>
<constraint firstItem="4y6-ck-zn3" firstAttribute="leading" secondItem="iyM-TJ-JB4" secondAttribute="leadingMargin" constant="10" id="u1M-G3-Ued"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="vp3-Ft-Gth">
<rect key="frame" x="0.0" y="108" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="vp3-Ft-Gth" id="ccO-0O-u72">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" text="Score" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6h8-IF-U4B">
<rect key="frame" x="18" y="11" width="45" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="250" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Score" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="rZ9-Fa-cyr">
<rect key="frame" x="71" y="11" width="511" height="21"/>
<color key="textColor" red="0.11372549019607843" green="0.47843137254901963" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="numberPad" returnKeyType="done"/>
</textField>
</subviews>
<constraints>
<constraint firstItem="rZ9-Fa-cyr" firstAttribute="leading" secondItem="6h8-IF-U4B" secondAttribute="trailing" constant="8" symbolic="YES" id="1Aw-5A-L3h"/>
<constraint firstAttribute="trailingMargin" secondItem="rZ9-Fa-cyr" secondAttribute="trailing" constant="10" id="Gso-FU-Ct1"/>
<constraint firstItem="6h8-IF-U4B" firstAttribute="centerY" secondItem="ccO-0O-u72" secondAttribute="centerY" id="wnh-aV-u1G"/>
<constraint firstItem="rZ9-Fa-cyr" firstAttribute="baseline" secondItem="6h8-IF-U4B" secondAttribute="baseline" id="ybu-qY-WT7"/>
<constraint firstItem="6h8-IF-U4B" firstAttribute="leading" secondItem="ccO-0O-u72" secondAttribute="leadingMargin" constant="10" id="yr9-Zm-MUx"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="iNr-Oe-muq" id="67O-XE-MeV"/>
<outlet property="delegate" destination="iNr-Oe-muq" id="vLD-QQ-zR2"/>
</connections>
</tableView>
<toolbarItems/>
<navigationItem key="navigationItem" id="U4g-xG-W8b">
<barButtonItem key="leftBarButtonItem" systemItem="cancel" id="VIN-Hi-Twt">
<connections>
<segue destination="lTz-K0-aRY" kind="unwind" unwindAction="cancelPersonEdition:" id="fOs-ol-qJL"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" systemItem="done" id="2um-u5-BhV">
<connections>
<segue destination="lTz-K0-aRY" kind="unwind" identifier="" unwindAction="commitPersonEdition:" id="Y1E-dI-wcl"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="cancelBarButtonItem" destination="VIN-Hi-Twt" id="dET-mF-ZXe"/>
<outlet property="commitBarButtonItem" destination="2um-u5-BhV" id="Jym-us-zdP"/>
<outlet property="nameCell" destination="2gb-gB-918" id="ch2-MB-uRm"/>
<outlet property="nameTextField" destination="m5m-Zs-j0z" id="A6a-pw-q8s"/>
<outlet property="scoreCell" destination="vp3-Ft-Gth" id="b8A-42-8Dw"/>
<outlet property="scoreTextField" destination="rZ9-Fa-cyr" id="4kw-gV-uih"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="fNC-Ls-uRw" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="lTz-K0-aRY" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="1450" y="1435"/>
</scene>
<!--GRDB Demo-->
<scene sceneID="XjB-aQ-v94">
<objects>
<tableViewController id="9kw-c5-KTk" customClass="DemoViewController" customModule="GRDBFetchedRecordsControllerDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="f4Y-o2-7VW">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<sections>
<tableViewSection id="dCg-qU-h2X">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="clL-nG-zPX" style="IBUITableViewCellStyleDefault" id="kJB-sX-YAb">
<rect key="frame" x="0.0" y="64" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="kJB-sX-YAb" id="f5l-ob-3DG">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Simple TableView" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="clL-nG-zPX">
<rect key="frame" x="15" y="0.0" width="550" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="cyv-nk-Plb" kind="show" id="Bgq-9t-jRc"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="I78-c5-0kp" style="IBUITableViewCellStyleDefault" id="q4C-mT-5mi">
<rect key="frame" x="0.0" y="108" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="q4C-mT-5mi" id="2Cu-K1-hiz">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="FetchedRecordsController" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="I78-c5-0kp">
<rect key="frame" x="15" y="0.0" width="550" height="43"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="PJp-Eq-ZjA" kind="show" id="1fk-ZR-6XN"/>
</connections>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="9kw-c5-KTk" id="IK7-Os-Odc"/>
<outlet property="delegate" destination="9kw-c5-KTk" id="U7E-yB-s8d"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="GRDB Demo" id="z0z-02-Ucy"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="OhY-4B-BcJ" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-190" y="1435"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="2KX-IU-Z5Q">
<objects>
<navigationController id="ein-Sr-i8w" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="zIT-dB-Mfo">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="iNr-Oe-muq" kind="relationship" relationship="rootViewController" id="e5b-3U-9Vz"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kNr-vk-I5l" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="630" y="1435"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="N1X-4j-Re4">
<objects>
<navigationController id="UAh-8N-CM8" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="U7d-1C-GnL">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="9kw-c5-KTk" kind="relationship" relationship="rootViewController" id="qDW-qI-Hyg"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="sVt-e9-ghQ" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1006" y="1435"/>
</scene>
<!--Hall Of Fame-->
<scene sceneID="9su-ms-vdJ">
<objects>
<tableViewController id="PJp-Eq-ZjA" customClass="FetchedRecordsControllerDemoViewController" customModule="GRDBFetchedRecordsControllerDemo" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="tX0-ON-WSI">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Person" textLabel="G8y-VE-YRu" detailTextLabel="NNc-J4-xiE" style="IBUITableViewCellStyleValue1" id="bFj-Hd-fwd">
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="bFj-Hd-fwd" id="kDf-TZ-xhb">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="G8y-VE-YRu">
<rect key="frame" x="15" y="12" width="32" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="NNc-J4-xiE">
<rect key="frame" x="523" y="12" width="42" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="iNr-Oe-muq" kind="show" identifier="EditPerson" id="Lgu-Yd-HSy"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="PJp-Eq-ZjA" id="MkQ-WQ-sTh"/>
<outlet property="delegate" destination="PJp-Eq-ZjA" id="quj-Sp-DuL"/>
</connections>
</tableView>
<toolbarItems>
<barButtonItem title="Item" id="hMF-Rv-dAe"/>
</toolbarItems>
<navigationItem key="navigationItem" title="Hall Of Fame" id="QIv-M6-kT1">
<barButtonItem key="rightBarButtonItem" systemItem="add" id="2bK-Fl-55Q"/>
</navigationItem>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<segue destination="ein-Sr-i8w" kind="presentation" identifier="NewPerson" id="7PC-xN-zD4"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="af5-Qo-AkD" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="630" y="2254"/>
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="7PC-xN-zD4"/>
<segue reference="Lgu-Yd-HSy"/>
</inferredMetricsTieBreakers>
</document>
@@ -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)
}
@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
@@ -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
}
}
@@ -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
}
}
-3
View File
@@ -29,9 +29,6 @@
<FileRef
location = "group:Tests/GRDBProfiling/GRDBProfiling.xcodeproj">
</FileRef>
<FileRef
location = "group:DemoApps/GRDBFetchedRecordsControllerDemo/GRDBFetchedRecordsControllerDemo.xcodeproj">
</FileRef>
<FileRef
location = "group:DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj">
</FileRef>