From bf722b5b09de98c49adcdbb45efdc72c538c5d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 9 Jul 2015 05:51:31 +0200 Subject: [PATCH] DemoApps/GRDBDemoiOS --- .../GRDBDemoiOS.xcodeproj/project.pbxproj | 519 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift | 56 ++ .../AppIcon.appiconset/Contents.json | 68 +++ .../Base.lproj/LaunchScreen.storyboard | 49 ++ .../GRDBDemoiOS/Base.lproj/Main.storyboard | 135 +++++ .../GRDBDemoiOS/DetailViewController.swift | 34 ++ DemoApps/GRDBDemoiOS/GRDBDemoiOS/Info.plist | 57 ++ .../GRDBDemoiOS/MasterViewController.swift | 80 +++ DemoApps/GRDBDemoiOS/GRDBDemoiOS/Person.swift | 51 ++ .../GRDBDemoiOSTests/GRDBDemoiOSTests.swift | 35 ++ .../GRDBDemoiOS/GRDBDemoiOSTests/Info.plist | 24 + .../GRDBDemoiOSUITests.swift | 35 ++ .../GRDBDemoiOS/GRDBDemoiOSUITests/Info.plist | 24 + GRDB.xcworkspace/contents.xcworkspacedata | 3 + 15 files changed, 1177 insertions(+) create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/LaunchScreen.storyboard create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/Main.storyboard create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS/DetailViewController.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS/Info.plist create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS/MasterViewController.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOS/Person.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOSTests/GRDBDemoiOSTests.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOSTests/Info.plist create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOSUITests/GRDBDemoiOSUITests.swift create mode 100644 DemoApps/GRDBDemoiOS/GRDBDemoiOSUITests/Info.plist diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj b/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj new file mode 100644 index 000000000..6bf304723 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj @@ -0,0 +1,519 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 47; + objects = { + +/* Begin PBXBuildFile section */ + 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 */; }; + 56B8F46F1B4E22B200C24296 /* GRDBDemoiOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B8F46E1B4E22B200C24296 /* GRDBDemoiOSTests.swift */; }; + 56B8F47A1B4E22B200C24296 /* GRDBDemoiOSUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B8F4791B4E22B200C24296 /* GRDBDemoiOSUITests.swift */; }; + 56B8F4991B4E23AA00C24296 /* Person.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56B8F4981B4E23AA00C24296 /* Person.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 56B8F46B1B4E22B200C24296 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 56B8F44C1B4E22B200C24296 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 56B8F4531B4E22B200C24296; + remoteInfo = GRDBDemoiOS; + }; + 56B8F4761B4E22B200C24296 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 56B8F44C1B4E22B200C24296 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 56B8F4531B4E22B200C24296; + remoteInfo = GRDBDemoiOS; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 56B8F4541B4E22B200C24296 /* GRDBDemoiOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GRDBDemoiOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 56B8F4571B4E22B200C24296 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 56B8F4591B4E22B200C24296 /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; }; + 56B8F45B1B4E22B200C24296 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; + 56B8F45E1B4E22B200C24296 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 56B8F4601B4E22B200C24296 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 56B8F4631B4E22B200C24296 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 56B8F4651B4E22B200C24296 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 56B8F46A1B4E22B200C24296 /* GRDBDemoiOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GRDBDemoiOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 56B8F46E1B4E22B200C24296 /* GRDBDemoiOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GRDBDemoiOSTests.swift; sourceTree = ""; }; + 56B8F4701B4E22B200C24296 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 56B8F4751B4E22B200C24296 /* GRDBDemoiOSUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GRDBDemoiOSUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 56B8F4791B4E22B200C24296 /* GRDBDemoiOSUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GRDBDemoiOSUITests.swift; sourceTree = ""; }; + 56B8F47B1B4E22B200C24296 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GRDB.xcodeproj; path = ../../../GRDB.xcodeproj; sourceTree = ""; }; + 56B8F4981B4E23AA00C24296 /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 56B8F4511B4E22B200C24296 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 56B8F4671B4E22B200C24296 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 56B8F4721B4E22B200C24296 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 56B8F44B1B4E22B200C24296 = { + isa = PBXGroup; + children = ( + 56B8F4561B4E22B200C24296 /* GRDBDemoiOS */, + 56B8F46D1B4E22B200C24296 /* GRDBDemoiOSTests */, + 56B8F4781B4E22B200C24296 /* GRDBDemoiOSUITests */, + 56B8F4551B4E22B200C24296 /* Products */, + ); + sourceTree = ""; + }; + 56B8F4551B4E22B200C24296 /* Products */ = { + isa = PBXGroup; + children = ( + 56B8F4541B4E22B200C24296 /* GRDBDemoiOS.app */, + 56B8F46A1B4E22B200C24296 /* GRDBDemoiOSTests.xctest */, + 56B8F4751B4E22B200C24296 /* GRDBDemoiOSUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 56B8F4561B4E22B200C24296 /* GRDBDemoiOS */ = { + isa = PBXGroup; + children = ( + 56B8F4871B4E235C00C24296 /* GRDB.xcodeproj */, + 56B8F4571B4E22B200C24296 /* AppDelegate.swift */, + 56B8F4591B4E22B200C24296 /* MasterViewController.swift */, + 56B8F45B1B4E22B200C24296 /* DetailViewController.swift */, + 56B8F4981B4E23AA00C24296 /* Person.swift */, + 56B8F45D1B4E22B200C24296 /* Main.storyboard */, + 56B8F4601B4E22B200C24296 /* Assets.xcassets */, + 56B8F4621B4E22B200C24296 /* LaunchScreen.storyboard */, + 56B8F4651B4E22B200C24296 /* Info.plist */, + ); + path = GRDBDemoiOS; + sourceTree = ""; + }; + 56B8F46D1B4E22B200C24296 /* GRDBDemoiOSTests */ = { + isa = PBXGroup; + children = ( + 56B8F46E1B4E22B200C24296 /* GRDBDemoiOSTests.swift */, + 56B8F4701B4E22B200C24296 /* Info.plist */, + ); + path = GRDBDemoiOSTests; + sourceTree = ""; + }; + 56B8F4781B4E22B200C24296 /* GRDBDemoiOSUITests */ = { + isa = PBXGroup; + children = ( + 56B8F4791B4E22B200C24296 /* GRDBDemoiOSUITests.swift */, + 56B8F47B1B4E22B200C24296 /* Info.plist */, + ); + path = GRDBDemoiOSUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 56B8F4531B4E22B200C24296 /* GRDBDemoiOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 56B8F47E1B4E22B200C24296 /* Build configuration list for PBXNativeTarget "GRDBDemoiOS" */; + buildPhases = ( + 56B8F4501B4E22B200C24296 /* Sources */, + 56B8F4511B4E22B200C24296 /* Frameworks */, + 56B8F4521B4E22B200C24296 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GRDBDemoiOS; + productName = GRDBDemoiOS; + productReference = 56B8F4541B4E22B200C24296 /* GRDBDemoiOS.app */; + productType = "com.apple.product-type.application"; + }; + 56B8F4691B4E22B200C24296 /* GRDBDemoiOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 56B8F4811B4E22B200C24296 /* Build configuration list for PBXNativeTarget "GRDBDemoiOSTests" */; + buildPhases = ( + 56B8F4661B4E22B200C24296 /* Sources */, + 56B8F4671B4E22B200C24296 /* Frameworks */, + 56B8F4681B4E22B200C24296 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 56B8F46C1B4E22B200C24296 /* PBXTargetDependency */, + ); + name = GRDBDemoiOSTests; + productName = GRDBDemoiOSTests; + productReference = 56B8F46A1B4E22B200C24296 /* GRDBDemoiOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 56B8F4741B4E22B200C24296 /* GRDBDemoiOSUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 56B8F4841B4E22B200C24296 /* Build configuration list for PBXNativeTarget "GRDBDemoiOSUITests" */; + buildPhases = ( + 56B8F4711B4E22B200C24296 /* Sources */, + 56B8F4721B4E22B200C24296 /* Frameworks */, + 56B8F4731B4E22B200C24296 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 56B8F4771B4E22B200C24296 /* PBXTargetDependency */, + ); + name = GRDBDemoiOSUITests; + productName = GRDBDemoiOSUITests; + productReference = 56B8F4751B4E22B200C24296 /* GRDBDemoiOSUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 56B8F44C1B4E22B200C24296 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0700; + ORGANIZATIONNAME = "Gwendal Roué"; + TargetAttributes = { + 56B8F4531B4E22B200C24296 = { + CreatedOnToolsVersion = 7.0; + }; + 56B8F4691B4E22B200C24296 = { + CreatedOnToolsVersion = 7.0; + TestTargetID = 56B8F4531B4E22B200C24296; + }; + 56B8F4741B4E22B200C24296 = { + CreatedOnToolsVersion = 7.0; + TestTargetID = 56B8F4531B4E22B200C24296; + }; + }; + }; + buildConfigurationList = 56B8F44F1B4E22B200C24296 /* Build configuration list for PBXProject "GRDBDemoiOS" */; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 56B8F44B1B4E22B200C24296; + productRefGroup = 56B8F4551B4E22B200C24296 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 56B8F4531B4E22B200C24296 /* GRDBDemoiOS */, + 56B8F4691B4E22B200C24296 /* GRDBDemoiOSTests */, + 56B8F4741B4E22B200C24296 /* GRDBDemoiOSUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 56B8F4521B4E22B200C24296 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 56B8F4641B4E22B200C24296 /* LaunchScreen.storyboard in Resources */, + 56B8F4611B4E22B200C24296 /* Assets.xcassets in Resources */, + 56B8F45F1B4E22B200C24296 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 56B8F4681B4E22B200C24296 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 56B8F4731B4E22B200C24296 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 56B8F4501B4E22B200C24296 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 56B8F45C1B4E22B200C24296 /* DetailViewController.swift in Sources */, + 56B8F45A1B4E22B200C24296 /* MasterViewController.swift in Sources */, + 56B8F4991B4E23AA00C24296 /* Person.swift in Sources */, + 56B8F4581B4E22B200C24296 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 56B8F4661B4E22B200C24296 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 56B8F46F1B4E22B200C24296 /* GRDBDemoiOSTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 56B8F4711B4E22B200C24296 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 56B8F47A1B4E22B200C24296 /* GRDBDemoiOSUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 56B8F46C1B4E22B200C24296 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 56B8F4531B4E22B200C24296 /* GRDBDemoiOS */; + targetProxy = 56B8F46B1B4E22B200C24296 /* PBXContainerItemProxy */; + }; + 56B8F4771B4E22B200C24296 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 56B8F4531B4E22B200C24296 /* GRDBDemoiOS */; + targetProxy = 56B8F4761B4E22B200C24296 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 56B8F45D1B4E22B200C24296 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 56B8F45E1B4E22B200C24296 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 56B8F4621B4E22B200C24296 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 56B8F4631B4E22B200C24296 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 56B8F47C1B4E22B200C24296 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_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.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 56B8F47D1B4E22B200C24296 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_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.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 56B8F47F1B4E22B200C24296 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = GRDBDemoiOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 56B8F4801B4E22B200C24296 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = GRDBDemoiOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 56B8F4821B4E22B200C24296 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = GRDBDemoiOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemoiOS.app/GRDBDemoiOS"; + }; + name = Debug; + }; + 56B8F4831B4E22B200C24296 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = GRDBDemoiOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemoiOS.app/GRDBDemoiOS"; + }; + name = Release; + }; + 56B8F4851B4E22B200C24296 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = GRDBDemoiOSUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOSUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = GRDBDemoiOS; + USES_XCTRUNNER = YES; + }; + name = Debug; + }; + 56B8F4861B4E22B200C24296 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = GRDBDemoiOSUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoiOSUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = GRDBDemoiOS; + USES_XCTRUNNER = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 56B8F44F1B4E22B200C24296 /* Build configuration list for PBXProject "GRDBDemoiOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 56B8F47C1B4E22B200C24296 /* Debug */, + 56B8F47D1B4E22B200C24296 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 56B8F47E1B4E22B200C24296 /* Build configuration list for PBXNativeTarget "GRDBDemoiOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 56B8F47F1B4E22B200C24296 /* Debug */, + 56B8F4801B4E22B200C24296 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 56B8F4811B4E22B200C24296 /* Build configuration list for PBXNativeTarget "GRDBDemoiOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 56B8F4821B4E22B200C24296 /* Debug */, + 56B8F4831B4E22B200C24296 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 56B8F4841B4E22B200C24296 /* Build configuration list for PBXNativeTarget "GRDBDemoiOSUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 56B8F4851B4E22B200C24296 /* Debug */, + 56B8F4861B4E22B200C24296 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 56B8F44C1B4E22B200C24296 /* Project object */; +} diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..94647a844 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift new file mode 100644 index 000000000..4df15c297 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/AppDelegate.swift @@ -0,0 +1,56 @@ +// +// AppDelegate.swift +// iOS +// +// Created by Gwendal Roué on 08/07/2015. +// Copyright © 2015 Gwendal Roué. All rights reserved. +// + +import UIKit +import GRDB + +var dbQueue: DatabaseQueue! + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + // Override point for customization after application launch. + 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 + + // Database + dbQueue = DatabaseQueue() + var migrator = DatabaseMigrator() + migrator.registerMigration("createPersons") { db in + try db.execute("CREATE TABLE persons (id INTEGER PRIMARY KEY, firstName TEXT, lastName TEXT)") + } + migrator.registerMigration("addPersons") { db in + try Person(firstName: "Arthur", lastName: "Miller").insert(db) + try Person(firstName: "Barbara", lastName: "Streisand").insert(db) + try Person(firstName: "Cinderella").insert(db) + } + try! migrator.migrate(dbQueue) + + return true + } + + // MARK: - Split view + + func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController:UIViewController, ontoPrimaryViewController primaryViewController:UIViewController) -> Bool { + guard let secondaryAsNavController = secondaryViewController as? UINavigationController else { return false } + guard let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController else { return false } + if topAsDetailController.person == nil { + // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. + return true + } + return false + } + +} + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..36d2c80d8 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "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" + }, + { + "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" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/LaunchScreen.storyboard b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..93d3840bb --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/Main.storyboard b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/Main.storyboard new file mode 100644 index 000000000..b3b5a7877 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Base.lproj/Main.storyboard @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/DetailViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/DetailViewController.swift new file mode 100644 index 000000000..7a2d06ed2 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/DetailViewController.swift @@ -0,0 +1,34 @@ +// +// DetailViewController.swift +// iOS +// +// Created by Gwendal Roué on 08/07/2015. +// Copyright © 2015 Gwendal Roué. All rights reserved. +// + +import UIKit + +class DetailViewController: UIViewController { + + @IBOutlet weak var detailDescriptionLabel: UILabel! + + var person: Person? { + didSet { + self.configureView() + } + } + + func configureView() { + if let person = self.person { + if let label = self.detailDescriptionLabel { + label.text = person.fullName + } + } + } + + override func viewDidLoad() { + super.viewDidLoad() + self.configureView() + } +} + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Info.plist b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Info.plist new file mode 100644 index 000000000..fd1ab7c38 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Info.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/MasterViewController.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/MasterViewController.swift new file mode 100644 index 000000000..ab2635368 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/MasterViewController.swift @@ -0,0 +1,80 @@ +// +// MasterViewController.swift +// iOS +// +// Created by Gwendal Roué on 08/07/2015. +// Copyright © 2015 Gwendal Roué. All rights reserved. +// + +import UIKit + +class MasterViewController: UITableViewController { + + var detailViewController: DetailViewController? = nil + var persons = [Person]() + + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + self.navigationItem.leftBarButtonItem = self.editButtonItem() + + if let split = self.splitViewController { + let controllers = split.viewControllers + self.detailViewController = (controllers[controllers.count-1] as! UINavigationController).topViewController as? DetailViewController + } + } + + override func viewWillAppear(animated: Bool) { + persons = dbQueue.inDatabase { db in + db.fetchAll(Person.self, "SELECT * FROM persons ORDER BY firstName, lastName") + } + self.clearsSelectionOnViewWillAppear = self.splitViewController!.collapsed + super.viewWillAppear(animated) + } + + // MARK: - Segues + + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + if segue.identifier == "showDetail" { + if let indexPath = self.tableView.indexPathForSelectedRow { + let person = persons[indexPath.row] + let controller = (segue.destinationViewController as! UINavigationController).topViewController as! DetailViewController + controller.person = person + controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem() + controller.navigationItem.leftItemsSupplementBackButton = true + } + } + } + + // MARK: - Table View + + override func numberOfSectionsInTableView(tableView: UITableView) -> Int { + return 1 + } + + override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return persons.count + } + + override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) + + let person = persons[indexPath.row] + cell.textLabel!.text = person.fullName + return cell + } + + override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { + let person = persons[indexPath.row] + try! dbQueue.inTransaction { db in + try person.delete(db) + return .Commit + } + persons.removeAtIndex(indexPath.row) + tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) + } + + +} + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Person.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Person.swift new file mode 100644 index 000000000..c0796691f --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOS/Person.swift @@ -0,0 +1,51 @@ +// +// Person.swift +// iOS +// +// Created by Gwendal Roué on 08/07/2015. +// Copyright © 2015 Gwendal Roué. All rights reserved. +// + +import Foundation +import GRDB + +class Person : RowModel { + var id: Int64! + var firstName: String? + var lastName: String? + var fullName: String { + return " ".join([firstName, lastName].filter { $0 != nil }.map { $0! }) + } + + init(firstName: String? = nil, lastName: String? = nil) { + self.firstName = firstName + self.lastName = lastName + super.init() + } + + // MARK: - RowModel + + override class var databaseTable: Table? { + return Table(named: "persons", primaryKey: .RowID("id")) + } + + override func setDatabaseValue(dbv: DatabaseValue, forColumn column: String) { + switch column { + case "id": id = dbv.value() + case "firstName": firstName = dbv.value() + case "lastName": lastName = dbv.value() + default: super.setDatabaseValue(dbv, forColumn: column) + } + } + + override var storedDatabaseDictionary: [String: DatabaseValueConvertible?] { + return [ + "id": id, + "firstName": firstName, + "lastName": lastName] + } + + required init(row: Row) { + super.init(row: row) + } +} diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOSTests/GRDBDemoiOSTests.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOSTests/GRDBDemoiOSTests.swift new file mode 100644 index 000000000..f58373978 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOSTests/GRDBDemoiOSTests.swift @@ -0,0 +1,35 @@ +// +// GRDBDemoiOSTests.swift +// GRDBDemoiOSTests +// +// Created by Gwendal Roué on 09/07/2015. +// Copyright © 2015 Gwendal Roué. All rights reserved. +// + +import XCTest + +class GRDBDemoiOSTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOSTests/Info.plist b/DemoApps/GRDBDemoiOS/GRDBDemoiOSTests/Info.plist new file mode 100644 index 000000000..ba72822e8 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOSTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOSUITests/GRDBDemoiOSUITests.swift b/DemoApps/GRDBDemoiOS/GRDBDemoiOSUITests/GRDBDemoiOSUITests.swift new file mode 100644 index 000000000..211f99e9d --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOSUITests/GRDBDemoiOSUITests.swift @@ -0,0 +1,35 @@ +// +// GRDBDemoiOSUITests.swift +// GRDBDemoiOSUITests +// +// Created by Gwendal Roué on 09/07/2015. +// Copyright © 2015 Gwendal Roué. All rights reserved. +// + +import Foundation +import XCTest + +class GRDBDemoiOSUITests: XCTestCase { + + override func setUp() { + super.setUp() + + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +} diff --git a/DemoApps/GRDBDemoiOS/GRDBDemoiOSUITests/Info.plist b/DemoApps/GRDBDemoiOS/GRDBDemoiOSUITests/Info.plist new file mode 100644 index 000000000..ba72822e8 --- /dev/null +++ b/DemoApps/GRDBDemoiOS/GRDBDemoiOSUITests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/GRDB.xcworkspace/contents.xcworkspacedata b/GRDB.xcworkspace/contents.xcworkspacedata index 0037076d3..5f9c61cf9 100644 --- a/GRDB.xcworkspace/contents.xcworkspacedata +++ b/GRDB.xcworkspace/contents.xcworkspacedata @@ -7,4 +7,7 @@ + +