From 902b8ff043b722445ab8b90557439cbca417c518 Mon Sep 17 00:00:00 2001 From: Miroslav Kutak Date: Thu, 9 Apr 2020 12:42:14 +0200 Subject: [PATCH] Added OCKCatalogSwiftUI target [#355]. --- .../contents.xcworkspacedata | 3 + .../project.pbxproj | 515 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcschemes/OCKCatalogSwiftUI.xcscheme | 91 ++++ .../OCKCatalogSwiftUI/AppDelegate.swift | 51 ++ .../AppIcon.appiconset/Contents.json | 98 ++++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 + .../OCKCatalogSwiftUI/ContentView.swift | 76 +++ .../OCKCatalogSwiftUI/Info.plist | 60 ++ .../OCKCatalogSwiftUI/Localizable.strings | 63 +++ .../OCKCatalogSwiftUI/Localizable.stringsdict | 30 + .../OCKStore+Extensions.swift | 109 ++++ .../OCKViewControllerRepresentable.swift | 268 +++++++++ .../OCKCatalogSwiftUI/SceneDelegate.swift | 49 ++ OCKCatalogSwiftUI/OCKCatalogTests/Info.plist | 22 + .../xcschemes/OCKSampleSwiftUI.xcscheme | 88 +++ .../OCKSampleSwiftUI/ContentView.swift | 2 +- 19 files changed, 1570 insertions(+), 1 deletion(-) create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.pbxproj create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/xcshareddata/xcschemes/OCKCatalogSwiftUI.xcscheme create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/AppDelegate.swift create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/Assets.xcassets/Contents.json create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/Base.lproj/LaunchScreen.storyboard create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/ContentView.swift create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/Info.plist create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/Localizable.strings create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/Localizable.stringsdict create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/OCKStore+Extensions.swift create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/OCKViewControllerRepresentable.swift create mode 100644 OCKCatalogSwiftUI/OCKCatalogSwiftUI/SceneDelegate.swift create mode 100644 OCKCatalogSwiftUI/OCKCatalogTests/Info.plist create mode 100644 OCKSampleSwiftUI/OCKSampleSwiftUI.xcodeproj/xcshareddata/xcschemes/OCKSampleSwiftUI.xcscheme diff --git a/CKWorkspace.xcworkspace/contents.xcworkspacedata b/CKWorkspace.xcworkspace/contents.xcworkspacedata index c2938a89b9..2de15ff647 100644 --- a/CKWorkspace.xcworkspace/contents.xcworkspacedata +++ b/CKWorkspace.xcworkspace/contents.xcworkspacedata @@ -19,4 +19,7 @@ + + diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.pbxproj b/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..757896ec24 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.pbxproj @@ -0,0 +1,515 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 039A9EAA236B97B400158EDD /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 039A9EA9236B97B400158EDD /* SceneDelegate.swift */; }; + 03A2F78E237F51DF00A13638 /* CareKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03A2F771237F51BA00A13638 /* CareKit.framework */; }; + 03A2F78F237F51DF00A13638 /* CareKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 03A2F771237F51BA00A13638 /* CareKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 03A2F790237F51DF00A13638 /* CareKitStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7C8B1F0228A1B34000B68FB /* CareKitStore.framework */; }; + 03A2F791237F51DF00A13638 /* CareKitStore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E7C8B1F0228A1B34000B68FB /* CareKitStore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 03A2F792237F51DF00A13638 /* CareKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03A2F78D237F51DF00A13638 /* CareKitUI.framework */; }; + 03A2F793237F51DF00A13638 /* CareKitUI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 03A2F78D237F51DF00A13638 /* CareKitUI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 03FEBEA2237A0C7E00ACB35E /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 03FEBEA0237A0C7D00ACB35E /* Localizable.stringsdict */; }; + 03FEBEA3237A0C7E00ACB35E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 03FEBEA1237A0C7E00ACB35E /* Localizable.strings */; }; + 51EF57C9229B21AA0071E2F6 /* OCKStore+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51EF57C8229B21AA0071E2F6 /* OCKStore+Extensions.swift */; }; + CE432E1C243E311D0054E7A1 /* OCKViewControllerRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE432E1B243E311D0054E7A1 /* OCKViewControllerRepresentable.swift */; }; + CE432E1E243E380B0054E7A1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE432E1D243E380B0054E7A1 /* ContentView.swift */; }; + E7D010FC222498F400C008DE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7D010FB222498F400C008DE /* AppDelegate.swift */; }; + E7D01103222498F400C008DE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E7D01102222498F400C008DE /* Assets.xcassets */; }; + E7D01106222498F400C008DE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E7D01104222498F400C008DE /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 03A2F770237F51BA00A13638 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 03A2F76B237F51BA00A13638 /* CareKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8605A5BA1C4F04EC00DD65FF; + remoteInfo = CareKit; + }; + 03A2F772237F51BA00A13638 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 03A2F76B237F51BA00A13638 /* CareKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 5196C7F9226F8F8F00F1C2A2; + remoteInfo = CareKitTests; + }; + 5143E1FB22C2832600E32526 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E7D010F0222498F400C008DE /* Project object */; + proxyType = 1; + remoteGlobalIDString = E7D010F7222498F400C008DE; + remoteInfo = OCKCatalog; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 516CD56823543678005E2779 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 03A2F791237F51DF00A13638 /* CareKitStore.framework in Embed Frameworks */, + 03A2F78F237F51DF00A13638 /* CareKit.framework in Embed Frameworks */, + 03A2F793237F51DF00A13638 /* CareKitUI.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 039A9EA9236B97B400158EDD /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 03A2F76B237F51BA00A13638 /* CareKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CareKit.xcodeproj; path = ../CareKit/CareKit.xcodeproj; sourceTree = ""; }; + 03A2F78D237F51DF00A13638 /* CareKitUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CareKitUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 03FEBEA0237A0C7D00ACB35E /* Localizable.stringsdict */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.stringsdict; path = Localizable.stringsdict; sourceTree = ""; }; + 03FEBEA1237A0C7E00ACB35E /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; + 1409475522B0261A005C1D16 /* CareKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CareKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 5143E1F622C2832600E32526 /* OCKCatalogSwiftUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OCKCatalogSwiftUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 5143E1FA22C2832600E32526 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 51D0ECFD2284894E00D24A76 /* CareKitUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CareKitUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 51EF57C8229B21AA0071E2F6 /* OCKStore+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OCKStore+Extensions.swift"; sourceTree = ""; }; + CE432E1B243E311D0054E7A1 /* OCKViewControllerRepresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OCKViewControllerRepresentable.swift; sourceTree = ""; }; + CE432E1D243E380B0054E7A1 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + E7C8B1F0228A1B34000B68FB /* CareKitStore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CareKitStore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E7D010F8222498F400C008DE /* OCKCatalogSwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OCKCatalogSwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E7D010FB222498F400C008DE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + E7D01102222498F400C008DE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + E7D01105222498F400C008DE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + E7D01107222498F400C008DE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5143E1F322C2832600E32526 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E7D010F5222498F400C008DE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 03A2F790237F51DF00A13638 /* CareKitStore.framework in Frameworks */, + 03A2F78E237F51DF00A13638 /* CareKit.framework in Frameworks */, + 03A2F792237F51DF00A13638 /* CareKitUI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 03A2F76C237F51BA00A13638 /* Products */ = { + isa = PBXGroup; + children = ( + 03A2F771237F51BA00A13638 /* CareKit.framework */, + 03A2F773237F51BA00A13638 /* CareKitTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 5143E1F722C2832600E32526 /* OCKCatalogTests */ = { + isa = PBXGroup; + children = ( + 5143E1FA22C2832600E32526 /* Info.plist */, + ); + path = OCKCatalogTests; + sourceTree = ""; + }; + 51D0ECFC2284894E00D24A76 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 03A2F78D237F51DF00A13638 /* CareKitUI.framework */, + 1409475522B0261A005C1D16 /* CareKit.framework */, + E7C8B1F0228A1B34000B68FB /* CareKitStore.framework */, + 51D0ECFD2284894E00D24A76 /* CareKitUI.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + E7D010EF222498F400C008DE = { + isa = PBXGroup; + children = ( + 03A2F76B237F51BA00A13638 /* CareKit.xcodeproj */, + E7D010FA222498F400C008DE /* OCKCatalogSwiftUI */, + 5143E1F722C2832600E32526 /* OCKCatalogTests */, + E7D010F9222498F400C008DE /* Products */, + 51D0ECFC2284894E00D24A76 /* Frameworks */, + ); + sourceTree = ""; + }; + E7D010F9222498F400C008DE /* Products */ = { + isa = PBXGroup; + children = ( + E7D010F8222498F400C008DE /* OCKCatalogSwiftUI.app */, + 5143E1F622C2832600E32526 /* OCKCatalogSwiftUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + E7D010FA222498F400C008DE /* OCKCatalogSwiftUI */ = { + isa = PBXGroup; + children = ( + 51EF57C8229B21AA0071E2F6 /* OCKStore+Extensions.swift */, + CE432E1B243E311D0054E7A1 /* OCKViewControllerRepresentable.swift */, + E7D010FB222498F400C008DE /* AppDelegate.swift */, + 039A9EA9236B97B400158EDD /* SceneDelegate.swift */, + CE432E1D243E380B0054E7A1 /* ContentView.swift */, + E7D01107222498F400C008DE /* Info.plist */, + E7D01104222498F400C008DE /* LaunchScreen.storyboard */, + 03FEBEA1237A0C7E00ACB35E /* Localizable.strings */, + 03FEBEA0237A0C7D00ACB35E /* Localizable.stringsdict */, + E7D01102222498F400C008DE /* Assets.xcassets */, + ); + path = OCKCatalogSwiftUI; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 5143E1F522C2832600E32526 /* OCKCatalogSwiftUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5143E1FF22C2832600E32526 /* Build configuration list for PBXNativeTarget "OCKCatalogSwiftUITests" */; + buildPhases = ( + 5143E1F222C2832600E32526 /* Sources */, + 5143E1F322C2832600E32526 /* Frameworks */, + 5143E1F422C2832600E32526 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 5143E1FC22C2832600E32526 /* PBXTargetDependency */, + ); + name = OCKCatalogSwiftUITests; + productName = OCKCatalogTests; + productReference = 5143E1F622C2832600E32526 /* OCKCatalogSwiftUITests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + E7D010F7222498F400C008DE /* OCKCatalogSwiftUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = E7D0110A222498F400C008DE /* Build configuration list for PBXNativeTarget "OCKCatalogSwiftUI" */; + buildPhases = ( + 0588EAC82357CC4F00F2646B /* Fix SPM */, + E7D010F4222498F400C008DE /* Sources */, + E7D010F5222498F400C008DE /* Frameworks */, + E7D010F6222498F400C008DE /* Resources */, + 51936B1B22418DAA00F7B1DD /* ShellScript */, + 516CD56823543678005E2779 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OCKCatalogSwiftUI; + packageProductDependencies = ( + ); + productName = OCK2SampleApp; + productReference = E7D010F8222498F400C008DE /* OCKCatalogSwiftUI.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E7D010F0222498F400C008DE /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = Apple; + TargetAttributes = { + 5143E1F522C2832600E32526 = { + CreatedOnToolsVersion = 11.0; + TestTargetID = E7D010F7222498F400C008DE; + }; + E7D010F7222498F400C008DE = { + CreatedOnToolsVersion = 10.1; + LastSwiftMigration = 1020; + }; + }; + }; + buildConfigurationList = E7D010F3222498F400C008DE /* Build configuration list for PBXProject "OCKCatalogSwiftUI" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = E7D010EF222498F400C008DE; + productRefGroup = E7D010F9222498F400C008DE /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 03A2F76C237F51BA00A13638 /* Products */; + ProjectRef = 03A2F76B237F51BA00A13638 /* CareKit.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + E7D010F7222498F400C008DE /* OCKCatalogSwiftUI */, + 5143E1F522C2832600E32526 /* OCKCatalogSwiftUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 03A2F771237F51BA00A13638 /* CareKit.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CareKit.framework; + remoteRef = 03A2F770237F51BA00A13638 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 03A2F773237F51BA00A13638 /* CareKitTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = CareKitTests.xctest; + remoteRef = 03A2F772237F51BA00A13638 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 5143E1F422C2832600E32526 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E7D010F6222498F400C008DE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E7D01106222498F400C008DE /* LaunchScreen.storyboard in Resources */, + 03FEBEA3237A0C7E00ACB35E /* Localizable.strings in Resources */, + E7D01103222498F400C008DE /* Assets.xcassets in Resources */, + 03FEBEA2237A0C7E00ACB35E /* Localizable.stringsdict in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 0588EAC82357CC4F00F2646B /* Fix SPM */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Fix SPM"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ -d \"${SYMROOT}/Release${EFFECTIVE_PLATFORM_NAME}/\" ] && [ \"${SYMROOT}/Release${EFFECTIVE_PLATFORM_NAME}/\" != \"${SYMROOT}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}/\" ] \nthen\n cp -f -R \"${SYMROOT}/Release${EFFECTIVE_PLATFORM_NAME}/\" \"${SYMROOT}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}/\"\nfi\n"; + }; + 51936B1B22418DAA00F7B1DD /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5143E1F222C2832600E32526 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E7D010F4222498F400C008DE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E7D010FC222498F400C008DE /* AppDelegate.swift in Sources */, + CE432E1E243E380B0054E7A1 /* ContentView.swift in Sources */, + 51EF57C9229B21AA0071E2F6 /* OCKStore+Extensions.swift in Sources */, + 039A9EAA236B97B400158EDD /* SceneDelegate.swift in Sources */, + CE432E1C243E311D0054E7A1 /* OCKViewControllerRepresentable.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5143E1FC22C2832600E32526 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = E7D010F7222498F400C008DE /* OCKCatalogSwiftUI */; + targetProxy = 5143E1FB22C2832600E32526 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + E7D01104222498F400C008DE /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E7D01105222498F400C008DE /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 5143E1FD22C2832600E32526 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 7JYUG8QGJ3; + INFOPLIST_FILE = OCKCatalogTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = Apple.OCKCatalogTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OCKCatalogSwiftUI.app/OCKCatalogSwiftUI"; + }; + name = Debug; + }; + E7D01108222498F400C008DE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = "$(BUILD_DIR)/Debug-$(PLATFORM_NAME)"; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = YES; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + E7D0110B222498F400C008DE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 17; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "$(SRCROOT)/OCKCatalogSwiftUI/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.carekit-samplecode.OCKCatalog"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5143E1FF22C2832600E32526 /* Build configuration list for PBXNativeTarget "OCKCatalogSwiftUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5143E1FD22C2832600E32526 /* Debug */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + E7D010F3222498F400C008DE /* Build configuration list for PBXProject "OCKCatalogSwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E7D01108222498F400C008DE /* Debug */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + E7D0110A222498F400C008DE /* Build configuration list for PBXNativeTarget "OCKCatalogSwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E7D0110B222498F400C008DE /* Debug */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = E7D010F0222498F400C008DE /* Project object */; +} diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..514821cf12 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/xcshareddata/xcschemes/OCKCatalogSwiftUI.xcscheme b/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/xcshareddata/xcschemes/OCKCatalogSwiftUI.xcscheme new file mode 100644 index 0000000000..57ff7d8e31 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI.xcodeproj/xcshareddata/xcschemes/OCKCatalogSwiftUI.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/AppDelegate.swift b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/AppDelegate.swift new file mode 100644 index 0000000000..f962b0b526 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/AppDelegate.swift @@ -0,0 +1,51 @@ +/* + Copyright (c) 2019, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import CareKit +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + let storeManager: OCKSynchronizedStoreManager = { + let store = OCKStore(name: "carekit-catalog") + store.fillWithDummyData() + return OCKSynchronizedStoreManager(wrapping: store) + }() + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + return true + } + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, + options: UIScene.ConnectionOptions) -> UISceneConfiguration { + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } +} diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..d8db8d65fd --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "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" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "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" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Assets.xcassets/Contents.json b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..da4a164c91 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Base.lproj/LaunchScreen.storyboard b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000000..bfa3612941 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/ContentView.swift b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/ContentView.swift new file mode 100644 index 0000000000..d714ba9557 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/ContentView.swift @@ -0,0 +1,76 @@ +// +/* + Copyright (c) 2020, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import SwiftUI + +fileprivate struct ListItem: View { + + let destination: T + let title: String + + var body: some View { + NavigationLink(destination: destination + .edgesIgnoringSafeArea(Edge.Set.all), + label: { Text(title) }) + } + +} + +struct ContentView: View { + var body: some View { + NavigationView { + List { + Section(header: Text("TASK")) { + ListItem(destination: OCKGridTaskView(), title: "Grid") + ListItem(destination: OCKChecklistTaskView(), title: "Checklist") + ListItem(destination: OCKSimpleTaskView(), title: "Simple") + ListItem(destination: OCKInstructionsTaskView(), title: "Instructions") + ListItem(destination: OCKButtonLogTaskView(), title: "Button Log") + } + Section(header: Text("CONTACT")) { + ListItem(destination: OCKSimpleContactView(), title: "Simple") + ListItem(destination: OCKDetailedContactView(), title: "Detailed") + } + Section(header: Text("CHART")) { + ListItem(destination: OCKCartesianChartView(type: .line), title: "Line") + ListItem(destination: OCKCartesianChartView(type: .scatter), title: "Scatter") + ListItem(destination: OCKCartesianChartView(type: .bar), title: "Bar") + } + Section(header: Text("LIST")) { + ListItem(destination: OCKDailyTasksPageView(), title: "Task") + ListItem(destination: OCKContactsListView(), title: "Contacts") + } + } + .listStyle(GroupedListStyle()) + .navigationBarTitle(Text("CareKit Catalog"), displayMode: .large) + } + } +} diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Info.plist b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Info.plist new file mode 100644 index 0000000000..349341158d --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Info.plist @@ -0,0 +1,60 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + OCKCatalog + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Localizable.strings b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Localizable.strings new file mode 100644 index 0000000000..189f9c9f9b --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Localizable.strings @@ -0,0 +1,63 @@ +/* +Copyright (c) 2019, Apple Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the copyright holder(s) nor the names of any contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. No license is granted to the trademarks of +the copyright holders even if such marks are included in this software. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +"ADDRESS" = "Address"; +"ANNOUNCE_EVENT_DELETED" = "Logged event was deleted"; +"CANCEL" = "Cancel"; +"CALL" = "Call"; +"COMPLETED" = "Completed"; +"CONTACTS" = "Contacts"; +"DELETE" = "Delete"; +"DONE" = "Done"; +"DOUBLE_TAP_MAP" = "Double-tap to open directions in Maps"; +"DOUBLE_TAP_TO_COMPLETE" = "Double-tap to mark as completed"; +"DOUBLE_TAP_TO_INCOMPLETE" = "Double-tap to mark as incomplete"; +"DOUBLE_TAP_TO_RECORD_EVENT" = "Double-tap to record an event"; +"DOUBLE_TAP_TO_REMOVE_EVENT" = "Double-tap to removed logged event"; +"EMAIL" = "E-mail"; +"EVENT" = "Event"; +"GOAL" = "Goal"; +"HIGH" = "High"; +"INCOMPLETE" = "Incomplete"; +"LOG" = "Log"; +"LOG_ENTRY" = "Log Entry"; +"LOGGING" = "Logging"; +"LOW" = "Low"; +"MARK_COMPLETE" = "Mark as Completed"; +"MESSAGE" = "Message"; +"NO_TASKS" = "No Tasks"; +"NO_EVENTS" = "No Events"; +"PROGRESS" = "Progress"; +"SEARCH" = "Search"; +"SELECTED" = "Selected"; +"TASKS" = "Tasks"; +"THREE_FINGER_SWIPE_DAY" = "Three-finger swipe to go to next or previous day"; +"THREE_FINGER_SWIPE_WEEK" = "Three-finger swipe to go to next or previous week"; +"TODAY" = "Today"; diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Localizable.stringsdict b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Localizable.stringsdict new file mode 100644 index 0000000000..d823f17ed7 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/Localizable.stringsdict @@ -0,0 +1,30 @@ + + + + + EVENTS_REMAINING + + NSStringLocalizedFormatKey + %#@events_remaining@ + events_remaining + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + i + zero + 0 remaining + one + 1 remaining + two + + few + + many + + other + %i remaining + + + + diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/OCKStore+Extensions.swift b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/OCKStore+Extensions.swift new file mode 100644 index 0000000000..3bb5c650c0 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/OCKStore+Extensions.swift @@ -0,0 +1,109 @@ +/* + Copyright (c) 2019, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import CareKit +import Foundation + +extension OCKSchedule { + /// Create a schedule that happens at meal times every day of the week. + static func mealTimesEachDay(start: Date, end: Date?) -> OCKSchedule { + let startDate = Calendar.current.startOfDay(for: start) + let breakfast = OCKSchedule.dailyAtTime(hour: 7, minutes: 30, start: startDate, end: end, text: "Breakfast") + let lunch = OCKSchedule.dailyAtTime(hour: 12, minutes: 0, start: startDate, end: end, text: "Lunch") + let dinner = OCKSchedule.dailyAtTime(hour: 17, minutes: 30, start: startDate, end: end, text: "Dinner") + return OCKSchedule(composing: [breakfast, lunch, dinner]) + } +} + +extension OCKStore { + func fillWithDummyData() { + // Note: If the tasks and contacts already exist in the store, these methods will fail. If you have modified the data and would like the + // changes to be reflected in the app, delete and reinstall the catalog app. + let aFewDaysAgo = Calendar.current.startOfDay(for: Calendar.current.date(byAdding: .day, value: -10, to: Date())!) + addTasks(makeTasks(on: aFewDaysAgo), callbackQueue: .main) { result in + switch result { + case .failure(let error): print("[ERROR] \(error.localizedDescription)") + case .success: break + } + } + + addContacts(makeContacts(), callbackQueue: .main) { result in + switch result { + case .failure(let error): print("[ERROR] \(error.localizedDescription)") + case .success: break + } + } + } + + private func makeTasks(on start: Date) -> [OCKTask] { + var task1 = OCKTask(id: "nausea", title: "Nausea", carePlanID: nil, + schedule: .dailyAtTime(hour: 7, minutes: 0, start: start, end: nil, text: nil)) + task1.instructions = "Log any time you experience nausea." + task1.impactsAdherence = false + + var task2 = OCKTask(id: "doxylamine", title: "Doxylamine", carePlanID: nil, + schedule: .mealTimesEachDay(start: start, end: nil)) + task2.instructions = "Take the tablet with a full glass of water." + + return [task1, task2] + } + + private func makeContacts() -> [OCKContact] { + var contact1 = OCKContact(id: "lexi-torres", givenName: "Lexi", familyName: "Torres", carePlanID: nil) + contact1.role = "Dr. Torres is a family practice doctor with over 20 years of experience." + let phoneNumbers1 = [OCKLabeledValue(label: "work", value: "2135558479")] + contact1.phoneNumbers = phoneNumbers1 + contact1.title = "Family Practice" + contact1.messagingNumbers = phoneNumbers1 + contact1.emailAddresses = [OCKLabeledValue(label: "work", value: "lexitorres@icloud.com")] + let address1 = OCKPostalAddress() + address1.street = "26 E Centerline Rd" + address1.city = "Victor" + address1.state = "MI" + address1.postalCode = "48848" + contact1.address = address1 + + var contact2 = OCKContact(id: "matthew-reiff", givenName: "Matthew", familyName: "Reiff", carePlanID: nil) + contact2.role = "Dr. Reiff is a family practice doctor with over 20 years of experience." + contact2.title = "Family Practice" + let phoneNumbers2 = [OCKLabeledValue(label: "work", value: "7745550146")] + contact2.phoneNumbers = phoneNumbers2 + contact2.messagingNumbers = phoneNumbers2 + contact2.emailAddresses = [OCKLabeledValue(label: "work", value: "matthewreiff@icloud.com")] + let address2 = OCKPostalAddress() + address2.street = "9391 Burkshire Avenue" + address2.city = "Cardiff" + address2.state = "CA" + address2.postalCode = "92007" + contact2.address = address2 + + return [contact1, contact2] + } +} diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/OCKViewControllerRepresentable.swift b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/OCKViewControllerRepresentable.swift new file mode 100644 index 0000000000..f8919f0028 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/OCKViewControllerRepresentable.swift @@ -0,0 +1,268 @@ +// +/* + Copyright (c) 2020, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import SwiftUI +import CareKit + +struct OCKListView: View, UIViewControllerRepresentable { + typealias UIViewControllerType = OCKListViewController + + func makeUIViewController(context: Context) -> OCKListViewController { + let listController = OCKListViewController() + return listController + } + + func updateUIViewController(_ uiViewController: OCKListViewController, context: Context) { + + } +} + +struct OCKChecklistTaskView: UIViewControllerRepresentable { + typealias UIViewControllerType = OCKListViewController + + func makeUIViewController(context: Context) -> OCKListViewController { + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let trackedTaskID = "doxylamine" + let viewController = OCKChecklistTaskViewController(taskID: trackedTaskID, eventQuery: .init(for: Date()), storeManager: appDelegate.storeManager) + + let listController = OCKListViewController() + listController.appendViewController(viewController, animated: false) + return listController + } + + func updateUIViewController(_ uiViewController: OCKListViewController, context: Context) { + + } +} + +struct OCKGridTaskView: UIViewControllerRepresentable { + typealias UIViewControllerType = OCKListViewController + + func makeUIViewController(context: Context) -> OCKListViewController { + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let trackedTaskID = "doxylamine" + let viewController = OCKGridTaskViewController(taskID: trackedTaskID, eventQuery: .init(for: Date()), storeManager: appDelegate.storeManager) + + let listController = OCKListViewController() + listController.appendViewController(viewController, animated: false) + return listController + } + + func updateUIViewController(_ uiViewController: OCKListViewController, context: Context) { + + } +} + +struct OCKSimpleTaskView: UIViewControllerRepresentable { + typealias UIViewControllerType = OCKListViewController + + func makeUIViewController(context: Context) -> OCKListViewController { + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let trackedTaskID = "doxylamine" + let viewController = OCKSimpleTaskViewController(taskID: trackedTaskID, eventQuery: .init(for: Date()), storeManager: appDelegate.storeManager) + + let listController = OCKListViewController() + listController.appendViewController(viewController, animated: false) + return listController + } + + func updateUIViewController(_ uiViewController: OCKListViewController, context: Context) { + + } +} + +struct OCKInstructionsTaskView: UIViewControllerRepresentable { + typealias UIViewControllerType = OCKInstructionsTaskViewController + + func makeUIViewController(context: Context) -> OCKInstructionsTaskViewController { + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let trackedTaskID = "doxylamine" + let viewController = OCKInstructionsTaskViewController(taskID: trackedTaskID, eventQuery: .init(for: Date()), storeManager: appDelegate.storeManager) + return viewController + } + + func updateUIViewController(_ uiViewController: OCKInstructionsTaskViewController, context: Context) { + + } +} + +struct OCKButtonLogTaskView: UIViewControllerRepresentable { + typealias UIViewControllerType = OCKListViewController + + func makeUIViewController(context: Context) -> OCKListViewController { + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let trackedTaskID = "doxylamine" + let viewController = OCKButtonLogTaskViewController(taskID: trackedTaskID, eventQuery: .init(for: Date()), storeManager: appDelegate.storeManager) + + let listController = OCKListViewController() + listController.appendViewController(viewController, animated: false) + return listController + } + + func updateUIViewController(_ uiViewController: OCKListViewController, context: Context) { + + } +} + +struct OCKSimpleContactView: UIViewControllerRepresentable { + typealias UIViewControllerType = OCKListViewController + + func makeUIViewController(context: Context) -> OCKListViewController { + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let contactID = "lexi-torres" + let viewController = OCKSimpleContactViewController(contactID: contactID, storeManager: appDelegate.storeManager) + + let listController = OCKListViewController() + listController.appendViewController(viewController, animated: false) + return listController + } + + func updateUIViewController(_ uiViewController: OCKListViewController, context: Context) { + + } +} + +struct OCKDetailedContactView: UIViewControllerRepresentable { + typealias UIViewControllerType = OCKListViewController + + func makeUIViewController(context: Context) -> OCKListViewController { + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let contactID = "lexi-torres" + let viewController = OCKDetailedContactViewController(contactID: contactID, storeManager: appDelegate.storeManager) + + let listController = OCKListViewController() + listController.appendViewController(viewController, animated: false) + return listController + } + + func updateUIViewController(_ uiViewController: OCKListViewController, context: Context) { + + } +} + +struct OCKCartesianChartView: UIViewControllerRepresentable { + typealias UIViewControllerType = OCKListViewController + + let type: OCKCartesianGraphView.PlotType + + func makeUIViewController(context: Context) -> OCKListViewController { + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let viewController = makeChartViewController(withStyle: type, storeManager: appDelegate.storeManager) + + let listController = OCKListViewController() + listController.appendViewController(viewController, animated: false) + return listController + } + + private func makeChartViewController(withStyle style: OCKCartesianGraphView.PlotType, + storeManager: OCKSynchronizedStoreManager) -> UIViewController { + // 8 and 9 + let gradientStart = UIColor { traitCollection -> UIColor in + return traitCollection.userInterfaceStyle == .light ? #colorLiteral(red: 0.9960784314, green: 0.3725490196, blue: 0.368627451, alpha: 1) : #colorLiteral(red: 0.8627432641, green: 0.2630574384, blue: 0.2592858295, alpha: 1) + } + let gradientEnd = UIColor { traitCollection -> UIColor in + return traitCollection.userInterfaceStyle == .light ? #colorLiteral(red: 0.9960784314, green: 0.4732026144, blue: 0.368627451, alpha: 1) : #colorLiteral(red: 0.8627432641, green: 0.3598620686, blue: 0.2592858295, alpha: 1) + } + + let markerSize: CGFloat = style == .bar ? 10 : 2 + let startOfDay = Calendar.current.startOfDay(for: Date()) + + let trackedTaskID = "doxylamine" + + let configurations = [ + OCKDataSeriesConfiguration( + taskID: trackedTaskID, + legendTitle: trackedTaskID.capitalized, + gradientStartColor: gradientStart, + gradientEndColor: gradientEnd, + markerSize: markerSize, + eventAggregator: .countOutcomeValues) + ] + + let chartViewController = OCKCartesianChartViewController(plotType: style, selectedDate: startOfDay, + configurations: configurations, storeManager: storeManager) + chartViewController.controller.fetchAndObserveInsights(forConfigurations: configurations) + chartViewController.chartView.headerView.titleLabel.text = trackedTaskID.capitalized + return chartViewController + } + + func updateUIViewController(_ uiViewController: OCKListViewController, context: Context) { + + } +} + +struct OCKDailyTasksPageView: View, UIViewControllerRepresentable { + typealias UIViewControllerType = OCKDailyTasksPageViewController + + func makeUIViewController(context: Context) -> OCKDailyTasksPageViewController { + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let rootViewController = OCKDailyTasksPageViewController(storeManager: appDelegate.storeManager) + rootViewController.isModalInPresentation = true + return rootViewController + } + + func updateUIViewController(_ uiViewController: OCKDailyTasksPageViewController, context: Context) { + + } +} + +struct OCKContactsListView: View, UIViewControllerRepresentable { + typealias UIViewControllerType = OCKContactsListViewController + + func makeUIViewController(context: Context) -> OCKContactsListViewController { + + let appDelegate = UIApplication.shared.delegate as! AppDelegate + + let rootViewController = OCKContactsListViewController(storeManager: appDelegate.storeManager) + return rootViewController + } + + func updateUIViewController(_ uiViewController: OCKContactsListViewController, context: Context) { + + } +} diff --git a/OCKCatalogSwiftUI/OCKCatalogSwiftUI/SceneDelegate.swift b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/SceneDelegate.swift new file mode 100644 index 0000000000..9b211d487d --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogSwiftUI/SceneDelegate.swift @@ -0,0 +1,49 @@ +/* + Copyright (c) 2019, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import CareKit +import SwiftUI + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + + let vc = UIHostingController(rootView: ContentView()) + + if let windowScene = scene as? UIWindowScene { + window = UIWindow(windowScene: windowScene) + window?.rootViewController = vc + window?.tintColor = UIColor { $0.userInterfaceStyle == .light ? #colorLiteral(red: 0.9960784314, green: 0.3725490196, blue: 0.368627451, alpha: 1) : #colorLiteral(red: 0.8627432641, green: 0.2630574384, blue: 0.2592858295, alpha: 1) } + window?.makeKeyAndVisible() + } + } +} diff --git a/OCKCatalogSwiftUI/OCKCatalogTests/Info.plist b/OCKCatalogSwiftUI/OCKCatalogTests/Info.plist new file mode 100644 index 0000000000..64d65ca495 --- /dev/null +++ b/OCKCatalogSwiftUI/OCKCatalogTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/OCKSampleSwiftUI/OCKSampleSwiftUI.xcodeproj/xcshareddata/xcschemes/OCKSampleSwiftUI.xcscheme b/OCKSampleSwiftUI/OCKSampleSwiftUI.xcodeproj/xcshareddata/xcschemes/OCKSampleSwiftUI.xcscheme new file mode 100644 index 0000000000..72f6950e5c --- /dev/null +++ b/OCKSampleSwiftUI/OCKSampleSwiftUI.xcodeproj/xcshareddata/xcschemes/OCKSampleSwiftUI.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OCKSampleSwiftUI/OCKSampleSwiftUI/ContentView.swift b/OCKSampleSwiftUI/OCKSampleSwiftUI/ContentView.swift index a13c7375f3..650fbfcf24 100644 --- a/OCKSampleSwiftUI/OCKSampleSwiftUI/ContentView.swift +++ b/OCKSampleSwiftUI/OCKSampleSwiftUI/ContentView.swift @@ -42,7 +42,7 @@ struct ContentView: View { CareDailyPageView(storeManager: storeManager) .edgesIgnoringSafeArea(Edge.Set.all) .navigationBarItems( - leading: Button("Today", action: { + leading: Button(loc("TODAY"), action: { NotificationCenter.default.post(name: NSNotification.Name.CareViewController.pressedToday, object: nil) }), trailing: Button("Care Teams", action: { self.isContactListViewPresented = true