diff --git a/.gitignore b/.gitignore index 61f9ecb..5c13bfd 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,6 @@ profile DerivedData *.hmap *.ipa -project.xcworkspace # Bundler .bundle @@ -27,7 +26,7 @@ Carthage # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control -# +# # Note: if you ignore the Pods directory, make sure to uncomment # `pod install` in .travis.yml # diff --git a/.travis.yml b/.travis.yml index 6467470..f532350 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,9 @@ language: objective-c -osx_image: xcode10 +osx_image: xcode11 +before_script: + - carthage bootstrap script: -# Build Travis project and run tests -- xcodebuild -project ShareClient.xcodeproj -scheme ShareClient build -destination name="iPhone SE" test + # Build Travis project and run tests + - xcodebuild -project ShareClient.xcodeproj -scheme Shared build -destination name="iPhone 8" test diff --git a/Cartfile b/Cartfile index 5abe0d1..ba2a5c1 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "LoopKit/LoopKit" ~> 2.0 +github "LoopKit/LoopKit" ~> 3.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index ea5e0dd..924d56e 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "LoopKit/LoopKit" "v2.2.1" +github "LoopKit/LoopKit" "v3.0" diff --git a/ShareClient.xcodeproj/project.pbxproj b/ShareClient.xcodeproj/project.pbxproj index 1d48918..2c5be94 100644 --- a/ShareClient.xcodeproj/project.pbxproj +++ b/ShareClient.xcodeproj/project.pbxproj @@ -6,20 +6,6 @@ objectVersion = 46; objects = { -/* Begin PBXAggregateTarget section */ - 43A8EC75210E653B00A81379 /* Cartfile */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 43A8EC76210E653C00A81379 /* Build configuration list for PBXAggregateTarget "Cartfile" */; - buildPhases = ( - 43A8EC79210E654300A81379 /* Build Carthage Dependencies */, - ); - dependencies = ( - ); - name = Cartfile; - productName = Cartfile; - }; -/* End PBXAggregateTarget section */ - /* Begin PBXBuildFile section */ 4325E9CF210E6A0A00969CE5 /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4325E9CE210E6A0A00969CE5 /* HKUnit.swift */; }; 4325E9D1210E6A3D00969CE5 /* TimeInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4325E9D0210E6A3D00969CE5 /* TimeInterval.swift */; }; @@ -46,26 +32,30 @@ 43AB51362133177800B3D58D /* LocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43AB51352133177800B3D58D /* LocalizedString.swift */; }; 43AB51372133177800B3D58D /* LocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43AB51352133177800B3D58D /* LocalizedString.swift */; }; 43C418AF1CE0488900405B6A /* ShareClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C418AE1CE0488900405B6A /* ShareClient.swift */; }; - C17D3CC52184CBCD003458C8 /* LoopKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 43A8EC7B210E661400A81379 /* LoopKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + A9AD06BC225ECDAC00471B4A /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43A8EC94210E67B000A81379 /* HealthKit.framework */; }; + A9ED4D93225EB4D30080DEBA /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4325E9CE210E6A0A00969CE5 /* HKUnit.swift */; }; + A9ED4D94225EB4D30080DEBA /* TimeInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4325E9D0210E6A3D00969CE5 /* TimeInterval.swift */; }; + A9ED4D95225EB4D30080DEBA /* ShareClientManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43A8EC9C210E68CE00A81379 /* ShareClientManager.swift */; }; + A9ED4D96225EB4D30080DEBA /* LocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43AB51352133177800B3D58D /* LocalizedString.swift */; }; + A9ED4D97225EB4D30080DEBA /* ShareGlucose+GlucoseKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43A8EC9A210E68BA00A81379 /* ShareGlucose+GlucoseKit.swift */; }; + A9ED4D98225EB4D30080DEBA /* ShareClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C418AE1CE0488900405B6A /* ShareClient.swift */; }; + A9ED4D99225EB4D30080DEBA /* ShareService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43A8EC98210E682A00A81379 /* ShareService.swift */; }; + A9ED4D9C225EB4D30080DEBA /* LoopKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43A8EC7B210E661400A81379 /* LoopKit.framework */; }; + A9ED4D9E225EB4D30080DEBA /* ShareClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 432B0E8B1CDFC3C50045347B /* ShareClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A9ED4DA0225EB4D30080DEBA /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 43AB5125213315D300B3D58D /* Localizable.strings */; }; + A9ED4DAF225EB93A0080DEBA /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9ED4DAE225EB9390080DEBA /* HealthKit.framework */; }; C17D3CC62184CC26003458C8 /* LoopKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43A8EC7B210E661400A81379 /* LoopKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 4325E9D6210E714B00969CE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 432B0E7F1CDFC3C50045347B /* Project object */; - proxyType = 1; - remoteGlobalIDString = 43A8EC75210E653B00A81379; - remoteInfo = Cartfile; - }; - 4325E9D8210E715200969CE5 /* PBXContainerItemProxy */ = { + 432B0E941CDFC3C50045347B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 432B0E7F1CDFC3C50045347B /* Project object */; proxyType = 1; - remoteGlobalIDString = 43A8EC75210E653B00A81379; - remoteInfo = Cartfile; + remoteGlobalIDString = 432B0E871CDFC3C50045347B; + remoteInfo = ShareClient; }; - 432B0E941CDFC3C50045347B /* PBXContainerItemProxy */ = { + A9E521F6225E949400EDDEF2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 432B0E7F1CDFC3C50045347B /* Project object */; proxyType = 1; @@ -74,19 +64,6 @@ }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - C17D3CC42184CBB7003458C8 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - C17D3CC52184CBCD003458C8 /* LoopKit.framework in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ 4325E9CE210E6A0A00969CE5 /* HKUnit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HKUnit.swift; sourceTree = ""; }; 4325E9D0210E6A3D00969CE5 /* TimeInterval.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimeInterval.swift; sourceTree = ""; }; @@ -98,11 +75,11 @@ 432B0E921CDFC3C50045347B /* ShareClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ShareClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 432B0E971CDFC3C50045347B /* ShareClientTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareClientTests.swift; sourceTree = ""; }; 432B0E991CDFC3C50045347B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 43A8EC7B210E661400A81379 /* LoopKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LoopKit.framework; path = Carthage/Build/iOS/LoopKit.framework; sourceTree = ""; }; + 43A8EC7B210E661400A81379 /* LoopKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = LoopKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43A8EC82210E664300A81379 /* ShareClientUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ShareClientUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43A8EC84210E664300A81379 /* ShareClientUI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareClientUI.h; sourceTree = ""; }; 43A8EC85210E664300A81379 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 43A8EC8B210E665600A81379 /* LoopKitUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LoopKitUI.framework; path = Carthage/Build/iOS/LoopKitUI.framework; sourceTree = ""; }; + 43A8EC8B210E665600A81379 /* LoopKitUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = LoopKitUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43A8EC8D210E676500A81379 /* ShareClientSetupViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShareClientSetupViewController.swift; sourceTree = ""; }; 43A8EC8E210E676500A81379 /* ShareClientManager+UI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ShareClientManager+UI.swift"; sourceTree = ""; }; 43A8EC8F210E676500A81379 /* ShareClientSettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShareClientSettingsViewController.swift; sourceTree = ""; }; @@ -133,6 +110,22 @@ 43AB51302133161A00B3D58D /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; 43AB51352133177800B3D58D /* LocalizedString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocalizedString.swift; sourceTree = ""; }; 43C418AE1CE0488900405B6A /* ShareClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShareClient.swift; sourceTree = ""; }; + 7D9BF1232336FF88005DCFD6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF1242336FF89005DCFD6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF1252336FF8F005DCFD6 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; + 7D9BF1262336FF8F005DCFD6 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; + 7D9BF1272336FF96005DCFD6 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF1282336FF96005DCFD6 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF1292336FF9C005DCFD6 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF12A2336FF9C005DCFD6 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF12B2336FFA2005DCFD6 /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF12C2336FFA2005DCFD6 /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF12D2336FFA9005DCFD6 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF12E2336FFA9005DCFD6 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF12F2336FFAF005DCFD6 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = ""; }; + 7D9BF1302336FFAF005DCFD6 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = ""; }; + A9ED4DA4225EB4D30080DEBA /* ShareClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ShareClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A9ED4DAE225EB9390080DEBA /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HealthKit.framework; sourceTree = DEVELOPER_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -149,6 +142,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A9AD06BC225ECDAC00471B4A /* HealthKit.framework in Frameworks */, 432B0E931CDFC3C50045347B /* ShareClient.framework in Frameworks */, C17D3CC62184CC26003458C8 /* LoopKit.framework in Frameworks */, ); @@ -164,6 +158,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A9ED4D9A225EB4D30080DEBA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A9ED4DAF225EB93A0080DEBA /* HealthKit.framework in Frameworks */, + A9ED4D9C225EB4D30080DEBA /* LoopKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -185,6 +188,7 @@ 432B0E881CDFC3C50045347B /* ShareClient.framework */, 432B0E921CDFC3C50045347B /* ShareClientTests.xctest */, 43A8EC82210E664300A81379 /* ShareClientUI.framework */, + A9ED4DA4225EB4D30080DEBA /* ShareClient.framework */, ); name = Products; sourceTree = ""; @@ -218,6 +222,7 @@ isa = PBXGroup; children = ( 43A8EC94210E67B000A81379 /* HealthKit.framework */, + A9ED4DAE225EB9390080DEBA /* HealthKit.framework */, 43A8EC8B210E665600A81379 /* LoopKitUI.framework */, 43A8EC7B210E661400A81379 /* LoopKit.framework */, ); @@ -267,6 +272,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A9ED4D9D225EB4D30080DEBA /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A9ED4D9E225EB4D30080DEBA /* ShareClient.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -282,7 +295,6 @@ buildRules = ( ); dependencies = ( - 4325E9D7210E714B00969CE5 /* PBXTargetDependency */, ); name = ShareClient; productName = ShareClient; @@ -296,7 +308,7 @@ 432B0E8E1CDFC3C50045347B /* Sources */, 432B0E8F1CDFC3C50045347B /* Frameworks */, 432B0E901CDFC3C50045347B /* Resources */, - C17D3CC42184CBB7003458C8 /* CopyFiles */, + A9F2C3E0225ECF8800C3B796 /* Copy Frameworks with Carthage */, ); buildRules = ( ); @@ -320,13 +332,31 @@ buildRules = ( ); dependencies = ( - 4325E9D9210E715200969CE5 /* PBXTargetDependency */, + A9E521F7225E949400EDDEF2 /* PBXTargetDependency */, ); name = ShareClientUI; productName = ShareClientUI; productReference = 43A8EC82210E664300A81379 /* ShareClientUI.framework */; productType = "com.apple.product-type.framework"; }; + A9ED4D91225EB4D30080DEBA /* ShareClient-watchOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = A9ED4DA1225EB4D30080DEBA /* Build configuration list for PBXNativeTarget "ShareClient-watchOS" */; + buildPhases = ( + A9ED4D92225EB4D30080DEBA /* Sources */, + A9ED4D9A225EB4D30080DEBA /* Frameworks */, + A9ED4D9D225EB4D30080DEBA /* Headers */, + A9ED4D9F225EB4D30080DEBA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ShareClient-watchOS"; + productName = ShareClient; + productReference = A9ED4DA4225EB4D30080DEBA /* ShareClient.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -334,31 +364,27 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Mark Wilson"; TargetAttributes = { 432B0E871CDFC3C50045347B = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; }; 432B0E911CDFC3C50045347B = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0900; - }; - 43A8EC75210E653B00A81379 = { - CreatedOnToolsVersion = 9.4.1; - ProvisioningStyle = Automatic; + LastSwiftMigration = 1020; }; 43A8EC81210E664300A81379 = { CreatedOnToolsVersion = 9.4.1; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 432B0E821CDFC3C50045347B /* Build configuration list for PBXProject "ShareClient" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -372,6 +398,13 @@ nb, ru, pl, + ja, + "pt-BR", + sv, + vi, + ro, + fi, + da, ); mainGroup = 432B0E7E1CDFC3C50045347B; productRefGroup = 432B0E891CDFC3C50045347B /* Products */; @@ -379,9 +412,9 @@ projectRoot = ""; targets = ( 432B0E871CDFC3C50045347B /* ShareClient */, + A9ED4D91225EB4D30080DEBA /* ShareClient-watchOS */, 432B0E911CDFC3C50045347B /* ShareClientTests */, 43A8EC81210E664300A81379 /* ShareClientUI */, - 43A8EC75210E653B00A81379 /* Cartfile */, ); }; /* End PBXProject section */ @@ -410,22 +443,36 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A9ED4D9F225EB4D30080DEBA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A9ED4DA0225EB4D30080DEBA /* Localizable.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 43A8EC79210E654300A81379 /* Build Carthage Dependencies */ = { + A9F2C3E0225ECF8800C3B796 /* Copy Frameworks with Carthage */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "$(BUILT_PRODUCTS_DIR)/LoopKit.framework", + ); + name = "Copy Frameworks with Carthage"; + outputFileListPaths = ( ); - name = "Build Carthage Dependencies"; outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/LoopKit.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if [ \"$CARTHAGE\" = \"YES\" ]; then\n echo \"Skipping carthage build because we're already in one\"\nelif [ -d $PROJECT_DIR/../../../Loop.xcworkspace ]; then\n echo \"Skipping carthage build because we're in a workspace\"\nelif [ -f $PROJECT_DIR/.gitmodules ]; then\n echo \"Skipping checkout due to presence of .gitmodules file\"\n if [ $ACTION = \"install\" ]; then\n echo \"You're installing: Make sure to keep all submodules up-to-date and run carthage build after changes.\"\n fi\nelse\n unset LLVM_TARGET_TRIPLE_SUFFIX\n echo \"Bootstrapping carthage dependencies\"\n /usr/local/bin/carthage bootstrap --project-directory \"$SRCROOT\" --cache-builds\nfi\n"; + shellScript = "CARTHAGE_BUILD_DIR=\"${SRCROOT}/Carthage/Build\"\nif [ -n \"${IPHONEOS_DEPLOYMENT_TARGET}\" ]; then\n CARTHAGE_BUILD_DIR=\"${CARTHAGE_BUILD_DIR}/iOS\"\nelif [ -n \"${WATCHOS_DEPLOYMENT_TARGET}\" ]; then\n CARTHAGE_BUILD_DIR=\"${CARTHAGE_BUILD_DIR}/watchOS\"\nelse\n echo \"ERROR: Unexpected deployment target type\"\n exit 1\nfi\n\nfor SCRIPT_INPUT_FILE in ${!SCRIPT_INPUT_FILE_*}; do\n CARTHAGE_BUILD_FILE=\"${!SCRIPT_INPUT_FILE/${BUILT_PRODUCTS_DIR}/${CARTHAGE_BUILD_DIR}}\"\n if [ -e \"${CARTHAGE_BUILD_FILE}\" ]; then\n if [ -e \"${SCRIPT_INPUT_FILE}\" ]; then\n echo \"ERROR: Duplicate frameworks found at:\"\n echo \" ${SCRIPT_INPUT_FILE}\"\n echo \" ${CARTHAGE_BUILD_FILE}\"\n exit 1\n fi\n echo \"Substituting \\\"${CARTHAGE_BUILD_FILE}\\\" for \\\"${!SCRIPT_INPUT_FILE}\\\"\"\n export ${SCRIPT_INPUT_FILE}=\"${CARTHAGE_BUILD_FILE}\"\n fi\ndone\n\necho \"Copy Frameworks with Carthage\"\ncarthage copy-frameworks\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -466,24 +513,33 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A9ED4D92225EB4D30080DEBA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A9ED4D93225EB4D30080DEBA /* HKUnit.swift in Sources */, + A9ED4D94225EB4D30080DEBA /* TimeInterval.swift in Sources */, + A9ED4D95225EB4D30080DEBA /* ShareClientManager.swift in Sources */, + A9ED4D96225EB4D30080DEBA /* LocalizedString.swift in Sources */, + A9ED4D97225EB4D30080DEBA /* ShareGlucose+GlucoseKit.swift in Sources */, + A9ED4D98225EB4D30080DEBA /* ShareClient.swift in Sources */, + A9ED4D99225EB4D30080DEBA /* ShareService.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 4325E9D7210E714B00969CE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 43A8EC75210E653B00A81379 /* Cartfile */; - targetProxy = 4325E9D6210E714B00969CE5 /* PBXContainerItemProxy */; - }; - 4325E9D9210E715200969CE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 43A8EC75210E653B00A81379 /* Cartfile */; - targetProxy = 4325E9D8210E715200969CE5 /* PBXContainerItemProxy */; - }; 432B0E951CDFC3C50045347B /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 432B0E871CDFC3C50045347B /* ShareClient */; targetProxy = 432B0E941CDFC3C50045347B /* PBXContainerItemProxy */; }; + A9E521F7225E949400EDDEF2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 432B0E871CDFC3C50045347B /* ShareClient */; + targetProxy = A9E521F6225E949400EDDEF2 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -500,6 +556,13 @@ 43AB512221330D8A00B3D58D /* nb */, 43AB512321330D8E00B3D58D /* ru */, 43AB512421330D9400B3D58D /* pl */, + 7D9BF1242336FF89005DCFD6 /* ja */, + 7D9BF1262336FF8F005DCFD6 /* pt-BR */, + 7D9BF1282336FF96005DCFD6 /* sv */, + 7D9BF12A2336FF9C005DCFD6 /* vi */, + 7D9BF12C2336FFA2005DCFD6 /* ro */, + 7D9BF12E2336FFA9005DCFD6 /* fi */, + 7D9BF1302336FFAF005DCFD6 /* da */, ); name = Localizable.strings; sourceTree = ""; @@ -517,6 +580,13 @@ 43AB512E2133161900B3D58D /* nb */, 43AB512F2133161A00B3D58D /* ru */, 43AB51302133161A00B3D58D /* pl */, + 7D9BF1232336FF88005DCFD6 /* ja */, + 7D9BF1252336FF8F005DCFD6 /* pt-BR */, + 7D9BF1272336FF96005DCFD6 /* sv */, + 7D9BF1292336FF9C005DCFD6 /* vi */, + 7D9BF12B2336FFA2005DCFD6 /* ro */, + 7D9BF12D2336FFA9005DCFD6 /* fi */, + 7D9BF12F2336FFAF005DCFD6 /* da */, ); name = Localizable.strings; sourceTree = ""; @@ -528,10 +598,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CARTHAGE_PLATFORM_PATH_iphoneos = iOS; - CARTHAGE_PLATFORM_PATH_iphonesimulator = iOS; - CARTHAGE_PLATFORM_PATH_watchos = watchOS; - CARTHAGE_PLATFORM_PATH_watchsimulator = watchOS; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -587,6 +653,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -598,10 +665,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CARTHAGE_PLATFORM_PATH_iphoneos = iOS; - CARTHAGE_PLATFORM_PATH_iphonesimulator = iOS; - CARTHAGE_PLATFORM_PATH_watchos = watchOS; - CARTHAGE_PLATFORM_PATH_watchsimulator = watchOS; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -650,6 +713,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -670,7 +734,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/$(CARTHAGE_PLATFORM_PATH_$(PLATFORM_NAME))", + "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = ShareClient/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -678,10 +742,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mddub.ShareClient; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchos watchsimulator"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; - TARGETED_DEVICE_FAMILY = "1,2,4"; }; name = Debug; }; @@ -697,7 +758,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/$(CARTHAGE_PLATFORM_PATH_$(PLATFORM_NAME))", + "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = ShareClient/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -705,9 +766,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mddub.ShareClient; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos watchos watchsimulator"; - SWIFT_VERSION = 4.2; - TARGETED_DEVICE_FAMILY = "1,2,4"; }; name = Release; }; @@ -715,14 +773,13 @@ isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( - "$(inherited),", + "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = ShareClientTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mddub.ShareClientTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -730,30 +787,13 @@ isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( - "$(inherited),", + "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = ShareClientTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mddub.ShareClientTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - }; - name = Release; - }; - 43A8EC77210E653C00A81379 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 43A8EC78210E653C00A81379 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; @@ -786,7 +826,6 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -819,11 +858,65 @@ PRODUCT_BUNDLE_IDENTIFIER = com.loopkit.ShareClientUI; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; + A9ED4DA2225EB4D30080DEBA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 2; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/watchOS", + ); + INFOPLIST_FILE = ShareClient/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.mddub.ShareClient; + PRODUCT_NAME = ShareClient; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "watchos watchsimulator"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = 4; + }; + name = Debug; + }; + A9ED4DA3225EB4D30080DEBA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 2; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/watchOS", + ); + INFOPLIST_FILE = ShareClient/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.mddub.ShareClient; + PRODUCT_NAME = ShareClient; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "watchos watchsimulator"; + TARGETED_DEVICE_FAMILY = 4; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -854,20 +947,20 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 43A8EC76210E653C00A81379 /* Build configuration list for PBXAggregateTarget "Cartfile" */ = { + 43A8EC87210E664300A81379 /* Build configuration list for PBXNativeTarget "ShareClientUI" */ = { isa = XCConfigurationList; buildConfigurations = ( - 43A8EC77210E653C00A81379 /* Debug */, - 43A8EC78210E653C00A81379 /* Release */, + 43A8EC88210E664300A81379 /* Debug */, + 43A8EC89210E664300A81379 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 43A8EC87210E664300A81379 /* Build configuration list for PBXNativeTarget "ShareClientUI" */ = { + A9ED4DA1225EB4D30080DEBA /* Build configuration list for PBXNativeTarget "ShareClient-watchOS" */ = { isa = XCConfigurationList; buildConfigurations = ( - 43A8EC88210E664300A81379 /* Debug */, - 43A8EC89210E664300A81379 /* Release */, + A9ED4DA2225EB4D30080DEBA /* Debug */, + A9ED4DA3225EB4D30080DEBA /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/ShareClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ShareClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ShareClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ShareClient.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ShareClient.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/ShareClient.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/ShareClient.xcodeproj/xcshareddata/xcschemes/ShareClientUI.xcscheme b/ShareClient.xcodeproj/xcshareddata/xcschemes/Shared-watchOS.xcscheme similarity index 80% rename from ShareClient.xcodeproj/xcshareddata/xcschemes/ShareClientUI.xcscheme rename to ShareClient.xcodeproj/xcshareddata/xcschemes/Shared-watchOS.xcscheme index 4892c98..5721ab7 100644 --- a/ShareClient.xcodeproj/xcshareddata/xcschemes/ShareClientUI.xcscheme +++ b/ShareClient.xcodeproj/xcshareddata/xcschemes/Shared-watchOS.xcscheme @@ -1,10 +1,10 @@ + buildImplicitDependencies = "NO"> @@ -45,9 +45,9 @@ @@ -63,9 +63,9 @@ diff --git a/ShareClient.xcodeproj/xcshareddata/xcschemes/ShareClient.xcscheme b/ShareClient.xcodeproj/xcshareddata/xcschemes/Shared.xcscheme similarity index 84% rename from ShareClient.xcodeproj/xcshareddata/xcschemes/ShareClient.xcscheme rename to ShareClient.xcodeproj/xcshareddata/xcschemes/Shared.xcscheme index 13e3884..05e5ea5 100644 --- a/ShareClient.xcodeproj/xcshareddata/xcschemes/ShareClient.xcscheme +++ b/ShareClient.xcodeproj/xcshareddata/xcschemes/Shared.xcscheme @@ -1,10 +1,10 @@ + buildImplicitDependencies = "NO"> + + + + CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) + $(PRODUCT_BUNDLE_IDENTIFIER)-$(PLATFORM_NAME) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.1 + 1.2 CFBundleSignature ???? CFBundleVersion diff --git a/ShareClient/ShareClientManager.swift b/ShareClient/ShareClientManager.swift index d62b30f..8d9d6f9 100644 --- a/ShareClient/ShareClientManager.swift +++ b/ShareClient/ShareClientManager.swift @@ -36,7 +36,25 @@ public class ShareClientManager: CGMManager { public let appURL: URL? = nil - weak public var cgmManagerDelegate: CGMManagerDelegate? + public var cgmManagerDelegate: CGMManagerDelegate? { + get { + return delegate.delegate + } + set { + delegate.delegate = newValue + } + } + + public var delegateQueue: DispatchQueue! { + get { + return delegate.queue + } + set { + delegate.queue = newValue + } + } + + public let delegate = WeakSynchronizedDelegate() public let providesBLEHeartbeat = false @@ -73,7 +91,9 @@ public class ShareClientManager: CGMManager { } // Ignore glucose values that are up to a minute newer than our previous value, to account for possible time shifting in Share data - let startDate = self.cgmManagerDelegate?.startDateToFilterNewData(for: self)?.addingTimeInterval(TimeInterval(minutes: 1)) + let startDate = self.delegate.call { (delegate) -> Date? in + return delegate?.startDateToFilterNewData(for: self)?.addingTimeInterval(TimeInterval(minutes: 1)) + } let newGlucose = glucose.filterDateRange(startDate, nil) let newSamples = newGlucose.filter({ $0.isStateValid }).map { return NewGlucoseSample(date: $0.startDate, quantity: $0.quantity, isDisplayOnly: false, syncIdentifier: "\(Int($0.startDate.timeIntervalSince1970))", device: self.device) diff --git a/ShareClient/da.lproj/Localizable.strings b/ShareClient/da.lproj/Localizable.strings new file mode 100644 index 0000000..8f44a1b Binary files /dev/null and b/ShareClient/da.lproj/Localizable.strings differ diff --git a/ShareClient/fi.lproj/Localizable.strings b/ShareClient/fi.lproj/Localizable.strings new file mode 100644 index 0000000..f369bb8 Binary files /dev/null and b/ShareClient/fi.lproj/Localizable.strings differ diff --git a/ShareClient/ja.lproj/Localizable.strings b/ShareClient/ja.lproj/Localizable.strings new file mode 100644 index 0000000..eafeed5 Binary files /dev/null and b/ShareClient/ja.lproj/Localizable.strings differ diff --git a/ShareClient/pt-BR.lproj/Localizable.strings b/ShareClient/pt-BR.lproj/Localizable.strings new file mode 100644 index 0000000..537041c Binary files /dev/null and b/ShareClient/pt-BR.lproj/Localizable.strings differ diff --git a/ShareClient/ro.lproj/Localizable.strings b/ShareClient/ro.lproj/Localizable.strings new file mode 100644 index 0000000..de1de00 Binary files /dev/null and b/ShareClient/ro.lproj/Localizable.strings differ diff --git a/ShareClient/sv.lproj/Localizable.strings b/ShareClient/sv.lproj/Localizable.strings new file mode 100644 index 0000000..c36bd4b Binary files /dev/null and b/ShareClient/sv.lproj/Localizable.strings differ diff --git a/ShareClient/vi.lproj/Localizable.strings b/ShareClient/vi.lproj/Localizable.strings new file mode 100644 index 0000000..e827c67 Binary files /dev/null and b/ShareClient/vi.lproj/Localizable.strings differ diff --git a/ShareClientTests/Info.plist b/ShareClientTests/Info.plist index 8a2d354..1807254 100644 --- a/ShareClientTests/Info.plist +++ b/ShareClientTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.1 + 1.2 CFBundleSignature ???? CFBundleVersion diff --git a/ShareClientUI/Info.plist b/ShareClientUI/Info.plist index 29dea2b..8c75117 100644 --- a/ShareClientUI/Info.plist +++ b/ShareClientUI/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.1 + 1.2 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/ShareClientUI/ShareClientManager+UI.swift b/ShareClientUI/ShareClientManager+UI.swift index e16b503..dcac4a0 100644 --- a/ShareClientUI/ShareClientManager+UI.swift +++ b/ShareClientUI/ShareClientManager+UI.swift @@ -11,12 +11,14 @@ import ShareClient extension ShareClientManager: CGMManagerUI { - public static func setupViewController() -> (UIViewController & CGMManagerSetupViewController)? { + public static func setupViewController() -> (UIViewController & CGMManagerSetupViewController & CompletionNotifying)? { return ShareClientSetupViewController() } - public func settingsViewController(for glucoseUnit: HKUnit) -> UIViewController { - return ShareClientSettingsViewController(cgmManager: self, glucoseUnit: glucoseUnit, allowsDeletion: true) + public func settingsViewController(for glucoseUnit: HKUnit) -> (UIViewController & CompletionNotifying) { + let settings = ShareClientSettingsViewController(cgmManager: self, glucoseUnit: glucoseUnit, allowsDeletion: true) + let nav = SettingsNavigationViewController(rootViewController: settings) + return nav } public var smallImage: UIImage? { diff --git a/ShareClientUI/ShareClientSettingsViewController.swift b/ShareClientUI/ShareClientSettingsViewController.swift index 9181c0b..cbcf60b 100644 --- a/ShareClientUI/ShareClientSettingsViewController.swift +++ b/ShareClientUI/ShareClientSettingsViewController.swift @@ -45,6 +45,19 @@ public class ShareClientSettingsViewController: UITableViewController { tableView.register(SettingsTableViewCell.self, forCellReuseIdentifier: SettingsTableViewCell.className) tableView.register(TextButtonTableViewCell.self, forCellReuseIdentifier: TextButtonTableViewCell.className) + + let button = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(doneTapped(_:))) + self.navigationItem.setRightBarButton(button, animated: false) + } + + @objc func doneTapped(_ sender: Any) { + complete() + } + + private func complete() { + if let nav = navigationController as? SettingsNavigationViewController { + nav.notifyComplete() + } } // MARK: - UITableViewDataSource @@ -167,8 +180,11 @@ public class ShareClientSettingsViewController: UITableViewController { tableView.deselectRow(at: indexPath, animated: true) case .delete: let confirmVC = UIAlertController(cgmDeletionHandler: { - self.cgmManager.cgmManagerDelegate?.cgmManagerWantsDeletion(self.cgmManager) - self.navigationController?.popViewController(animated: true) + self.cgmManager.notifyDelegateOfDeletion { + DispatchQueue.main.async { + self.complete() + } + } }) present(confirmVC, animated: true) { diff --git a/ShareClientUI/ShareClientSetupViewController.swift b/ShareClientUI/ShareClientSetupViewController.swift index 79ee2fa..b396cbe 100644 --- a/ShareClientUI/ShareClientSetupViewController.swift +++ b/ShareClientUI/ShareClientSetupViewController.swift @@ -11,9 +11,11 @@ import LoopKitUI import ShareClient -class ShareClientSetupViewController: UINavigationController, CGMManagerSetupViewController { +class ShareClientSetupViewController: UINavigationController, CGMManagerSetupViewController, CompletionNotifying { var setupDelegate: CGMManagerSetupViewControllerDelegate? + weak var completionDelegate: CompletionDelegate? + let cgmManager = ShareClientManager() init() { @@ -37,11 +39,11 @@ class ShareClientSetupViewController: UINavigationController, CGMManagerSetupVie } @objc private func cancel() { - setupDelegate?.cgmManagerSetupViewControllerDidCancel(self) + completionDelegate?.completionNotifyingDidComplete(self) } @objc private func save() { setupDelegate?.cgmManagerSetupViewController(self, didSetUpCGMManager: cgmManager) + completionDelegate?.completionNotifyingDidComplete(self) } - } diff --git a/ShareClientUI/da.lproj/Localizable.strings b/ShareClientUI/da.lproj/Localizable.strings new file mode 100644 index 0000000..d9bc556 Binary files /dev/null and b/ShareClientUI/da.lproj/Localizable.strings differ diff --git a/ShareClientUI/de.lproj/Localizable.strings b/ShareClientUI/de.lproj/Localizable.strings index b674fae..428f845 100644 Binary files a/ShareClientUI/de.lproj/Localizable.strings and b/ShareClientUI/de.lproj/Localizable.strings differ diff --git a/ShareClientUI/es.lproj/Localizable.strings b/ShareClientUI/es.lproj/Localizable.strings index 2692614..d58ad77 100644 Binary files a/ShareClientUI/es.lproj/Localizable.strings and b/ShareClientUI/es.lproj/Localizable.strings differ diff --git a/ShareClientUI/fi.lproj/Localizable.strings b/ShareClientUI/fi.lproj/Localizable.strings new file mode 100644 index 0000000..f6abb2e Binary files /dev/null and b/ShareClientUI/fi.lproj/Localizable.strings differ diff --git a/ShareClientUI/fr.lproj/Localizable.strings b/ShareClientUI/fr.lproj/Localizable.strings index 22f3090..39485de 100644 Binary files a/ShareClientUI/fr.lproj/Localizable.strings and b/ShareClientUI/fr.lproj/Localizable.strings differ diff --git a/ShareClientUI/it.lproj/Localizable.strings b/ShareClientUI/it.lproj/Localizable.strings index 0d0428a..e819751 100644 Binary files a/ShareClientUI/it.lproj/Localizable.strings and b/ShareClientUI/it.lproj/Localizable.strings differ diff --git a/ShareClientUI/ja.lproj/Localizable.strings b/ShareClientUI/ja.lproj/Localizable.strings new file mode 100644 index 0000000..7fae84b Binary files /dev/null and b/ShareClientUI/ja.lproj/Localizable.strings differ diff --git a/ShareClientUI/nb.lproj/Localizable.strings b/ShareClientUI/nb.lproj/Localizable.strings index 3b6f0f3..391a6a9 100644 Binary files a/ShareClientUI/nb.lproj/Localizable.strings and b/ShareClientUI/nb.lproj/Localizable.strings differ diff --git a/ShareClientUI/nl.lproj/Localizable.strings b/ShareClientUI/nl.lproj/Localizable.strings index 19cf30d..1692446 100644 Binary files a/ShareClientUI/nl.lproj/Localizable.strings and b/ShareClientUI/nl.lproj/Localizable.strings differ diff --git a/ShareClientUI/pl.lproj/Localizable.strings b/ShareClientUI/pl.lproj/Localizable.strings index 99edf0d..027f7f3 100644 Binary files a/ShareClientUI/pl.lproj/Localizable.strings and b/ShareClientUI/pl.lproj/Localizable.strings differ diff --git a/ShareClientUI/pt-BR.lproj/Localizable.strings b/ShareClientUI/pt-BR.lproj/Localizable.strings new file mode 100644 index 0000000..db3fec2 Binary files /dev/null and b/ShareClientUI/pt-BR.lproj/Localizable.strings differ diff --git a/ShareClientUI/ro.lproj/Localizable.strings b/ShareClientUI/ro.lproj/Localizable.strings new file mode 100644 index 0000000..9717cab Binary files /dev/null and b/ShareClientUI/ro.lproj/Localizable.strings differ diff --git a/ShareClientUI/ru.lproj/Localizable.strings b/ShareClientUI/ru.lproj/Localizable.strings index a1c724d..95dce2f 100644 Binary files a/ShareClientUI/ru.lproj/Localizable.strings and b/ShareClientUI/ru.lproj/Localizable.strings differ diff --git a/ShareClientUI/sv.lproj/Localizable.strings b/ShareClientUI/sv.lproj/Localizable.strings new file mode 100644 index 0000000..ad70818 Binary files /dev/null and b/ShareClientUI/sv.lproj/Localizable.strings differ diff --git a/ShareClientUI/vi.lproj/Localizable.strings b/ShareClientUI/vi.lproj/Localizable.strings new file mode 100644 index 0000000..7a5274b Binary files /dev/null and b/ShareClientUI/vi.lproj/Localizable.strings differ diff --git a/ShareClientUI/zh-Hans.lproj/Localizable.strings b/ShareClientUI/zh-Hans.lproj/Localizable.strings index e444031..79b51e7 100644 Binary files a/ShareClientUI/zh-Hans.lproj/Localizable.strings and b/ShareClientUI/zh-Hans.lproj/Localizable.strings differ