From 1912a523d6253e35c53268265f439228d991f47a Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:22:14 +0100 Subject: [PATCH] removes the deprecated and unmaintained Today View extension (#500) Today View extensions have been deprecated since iOS 14. Furthermore they are [no longer available at all on iOS 18](https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-18-release-notes#Widgets). This app's such extension allowed for viewing up to three goals and provided quick data entry for them. It seems each iteration of iOS since 14 has tucked the Today View extensions further and further out of reach. A more powerful replacement could be iOS 14 style widgets (#68). Today View extension tickets: #97, #98, #114, #236 This merge request merely removes the legacy code/feature. --- BeeSwift.xcodeproj/project.pbxproj | 250 ------------------ .../Base.lproj/MainInterface.storyboard | 41 --- BeeSwiftToday/BeeSwiftToday.entitlements | 14 - BeeSwiftToday/Info.plist | 44 --- BeeSwiftToday/TodayTableViewCell.swift | 192 -------------- BeeSwiftToday/TodayViewController.swift | 91 ------- 6 files changed, 632 deletions(-) delete mode 100644 BeeSwiftToday/Base.lproj/MainInterface.storyboard delete mode 100644 BeeSwiftToday/BeeSwiftToday.entitlements delete mode 100644 BeeSwiftToday/Info.plist delete mode 100644 BeeSwiftToday/TodayTableViewCell.swift delete mode 100644 BeeSwiftToday/TodayViewController.swift diff --git a/BeeSwift.xcodeproj/project.pbxproj b/BeeSwift.xcodeproj/project.pbxproj index 4d69ba36..620773c1 100644 --- a/BeeSwift.xcodeproj/project.pbxproj +++ b/BeeSwift.xcodeproj/project.pbxproj @@ -13,11 +13,6 @@ A11A87C61FEBFF7200A43E47 /* ChooseGoalSortViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A11A87C51FEBFF7200A43E47 /* ChooseGoalSortViewController.swift */; }; A11BC2D91FFAD5BC00E56064 /* TimerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A11BC2D81FFAD5BC00E56064 /* TimerViewController.swift */; }; A12BA94E1AFF202200AFEF32 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A12BA94D1AFF202200AFEF32 /* SystemConfiguration.framework */; }; - A12E694E1BD3EF0200AB94C2 /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1B53C301B2D04EA00AF266F /* NotificationCenter.framework */; }; - A12E69511BD3EF0200AB94C2 /* TodayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A12E69501BD3EF0200AB94C2 /* TodayViewController.swift */; }; - A12E69541BD3EF0200AB94C2 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A12E69521BD3EF0200AB94C2 /* MainInterface.storyboard */; }; - A12E69581BD3EF0200AB94C2 /* BeeSwiftToday.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = A12E694D1BD3EF0200AB94C2 /* BeeSwiftToday.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - A142492E1FD0A56A007736B3 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A158DDB51E46EEA10031BD4F /* HealthKit.framework */; }; A1453B3F1AEDFCC8006F48DA /* SignInViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1453B3E1AEDFCC8006F48DA /* SignInViewController.swift */; }; A149147B1BE79FD50060600A /* EditNotificationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A149147A1BE79FD40060600A /* EditNotificationsViewController.swift */; }; A149147F1BE7A5670060600A /* SettingsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A149147E1BE7A5670060600A /* SettingsTableViewCell.swift */; }; @@ -39,15 +34,12 @@ A1BD0D181AEB30A5001EDE8B /* GoalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1BD0D171AEB30A5001EDE8B /* GoalViewController.swift */; }; A1BE73AA1E8B45BF00DEC4DB /* ChooseHKMetricViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1BE73A91E8B45BF00DEC4DB /* ChooseHKMetricViewController.swift */; }; A1BE73AC1E8B47E700DEC4DB /* HealthKitMetricTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1BE73AB1E8B47E700DEC4DB /* HealthKitMetricTableViewCell.swift */; }; - A1D853281EB0DE0700FC75DE /* TodayTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1D853271EB0DE0700FC75DE /* TodayTableViewCell.swift */; }; - A1D853311EB3E0A300FC75DE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A196CB231AE4142F00B90A3E /* Images.xcassets */; }; A1E618E21E78158700D8ED93 /* HealthKitConfigViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1E618E11E78158700D8ED93 /* HealthKitConfigViewController.swift */; }; A1E618E41E7934C700D8ED93 /* HealthKitConfigTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1E618E31E7934C700D8ED93 /* HealthKitConfigTableViewCell.swift */; }; A1EA154D1B01E6EC0052A6E6 /* DatapointTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1EA154C1B01E6EC0052A6E6 /* DatapointTableViewCell.swift */; }; A1F9D1EA211B9B7600E2BC93 /* EditDatapointViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1F9D1E9211B9B7600E2BC93 /* EditDatapointViewController.swift */; }; E41286F12A62E6840093D598 /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = E41286F02A62E6840093D598 /* KeychainSwift */; }; E41286F32A62E97B0093D598 /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = E41286F22A62E97B0093D598 /* KeychainSwift */; }; - E41286F52A62E9840093D598 /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = E41286F42A62E9840093D598 /* KeychainSwift */; }; E412DADF2B869E1E0099E483 /* BeeLemniscateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E412DADE2B869E1E0099E483 /* BeeLemniscateView.swift */; }; E412DAE12B86A8F70099E483 /* GoalImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E412DAE02B86A8F70099E483 /* GoalImageView.swift */; }; E417572D2A6446FE0029CDDA /* CurrentUserManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E417572C2A6446FE0029CDDA /* CurrentUserManagerTests.swift */; }; @@ -59,7 +51,6 @@ E454702A2B60E25C00EE648B /* DaystampTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E45470292B60E25C00EE648B /* DaystampTests.swift */; }; E457BE5D28C192B50012F5D0 /* IntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = E457BE5C28C192B50012F5D0 /* IntentHandler.swift */; }; E458C7F72AD10D68000DCA5C /* BeeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E57BE6E02655EBD900BA540B /* BeeKit.framework */; }; - E458C7FC2AD10D6E000DCA5C /* BeeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E57BE6E02655EBD900BA540B /* BeeKit.framework */; }; E458C8012AD11BB3000DCA5C /* RequestManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1BCE9841AFFFB3A007322CC /* RequestManager.swift */; }; E458C8022AD11BB9000DCA5C /* CurrentUserManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1453B3C1AEDFA52006F48DA /* CurrentUserManager.swift */; }; E458C8042AD11BC3000DCA5C /* SignedRequestManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A142492C1FD079B4007736B3 /* SignedRequestManager.swift */; }; @@ -103,25 +94,18 @@ E462BA3F29AC456500E80EF0 /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA3E29AC456500E80EF0 /* SwiftyJSON */; }; E462BA4229AC458B00E80EF0 /* MBProgressHUD in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA4129AC458B00E80EF0 /* MBProgressHUD */; }; E462BA4829ADAA1C00E80EF0 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA4729ADAA1C00E80EF0 /* SnapKit */; }; - E462BA4A29ADAAB800E80EF0 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA4929ADAAB800E80EF0 /* SnapKit */; }; E462BA4B29ADAAF500E80EF0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1B6723F1B0989E800584782 /* UIKit.framework */; }; E462BA4D29ADAB3900E80EF0 /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA4C29ADAB3900E80EF0 /* SwiftyJSON */; }; - E462BA4F29ADAB4300E80EF0 /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA4E29ADAB4300E80EF0 /* SwiftyJSON */; }; - E462BA5129ADAB4F00E80EF0 /* MBProgressHUD in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA5029ADAB4F00E80EF0 /* MBProgressHUD */; }; E462BA5329ADACAC00E80EF0 /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA5229ADACAC00E80EF0 /* Alamofire */; }; - E462BA5529ADACB600E80EF0 /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA5429ADACB600E80EF0 /* Alamofire */; }; - E462BA5729AEEF9D00E80EF0 /* AlamofireImage in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA5629AEEF9D00E80EF0 /* AlamofireImage */; }; E462BA5A29AEF02500E80EF0 /* IQKeyboardManagerSwift in Frameworks */ = {isa = PBXBuildFile; productRef = E462BA5929AEF02500E80EF0 /* IQKeyboardManagerSwift */; }; E46DC80F2AA58DF20059FDFE /* PullToRefreshHint.swift in Sources */ = {isa = PBXBuildFile; fileRef = E46DC80E2AA58DF20059FDFE /* PullToRefreshHint.swift */; }; E486DE2629B0403700F338B2 /* OrderedCollections in Frameworks */ = {isa = PBXBuildFile; productRef = E486DE2529B0403700F338B2 /* OrderedCollections */; }; - E486DE2829B040FB00F338B2 /* OrderedCollections in Frameworks */ = {isa = PBXBuildFile; productRef = E486DE2729B040FB00F338B2 /* OrderedCollections */; }; E486DE2A29B0410A00F338B2 /* OrderedCollections in Frameworks */ = {isa = PBXBuildFile; productRef = E486DE2929B0410A00F338B2 /* OrderedCollections */; }; E48E2714296B75E4008013C0 /* TotalSleepMinutesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E48E2713296B75E4008013C0 /* TotalSleepMinutesTests.swift */; }; E48E27202973261F008013C0 /* BackgroundUpdates.swift in Sources */ = {isa = PBXBuildFile; fileRef = E48E271F2973261F008013C0 /* BackgroundUpdates.swift */; }; E4B083392932F90400A71564 /* ConfigureHKMetricViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B083382932F90400A71564 /* ConfigureHKMetricViewController.swift */; }; E4B0833B2934620500A71564 /* DatapointTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B0833A2934620500A71564 /* DatapointTableViewController.swift */; }; E4B0A32E28C194C800055EA7 /* AddDataIntents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = E540953B260FB6A100C30784 /* AddDataIntents.intentdefinition */; }; - E4B0A32F28C194C800055EA7 /* AddDataIntents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = E540953B260FB6A100C30784 /* AddDataIntents.intentdefinition */; }; E4B0A33028C194C900055EA7 /* AddDataIntents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = E540953B260FB6A100C30784 /* AddDataIntents.intentdefinition */; }; E4B0A33128C194C900055EA7 /* AddDataIntents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = E540953B260FB6A100C30784 /* AddDataIntents.intentdefinition */; }; E4B0A33228C194CA00055EA7 /* AddDataIntents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = E540953B260FB6A100C30784 /* AddDataIntents.intentdefinition */; }; @@ -147,7 +131,6 @@ E5CF51A72612436200546184 /* Config.swift.sample in Resources */ = {isa = PBXBuildFile; fileRef = E5DF493624DC69A200260560 /* Config.swift.sample */; }; E5DF493724DC69A200260560 /* Config.swift.sample in Resources */ = {isa = PBXBuildFile; fileRef = E5DF493624DC69A200260560 /* Config.swift.sample */; }; E5DF493824DC69A200260560 /* Config.swift.sample in Resources */ = {isa = PBXBuildFile; fileRef = E5DF493624DC69A200260560 /* Config.swift.sample */; }; - E5DF493924DC69A200260560 /* Config.swift.sample in Resources */ = {isa = PBXBuildFile; fileRef = E5DF493624DC69A200260560 /* Config.swift.sample */; }; E5F7C492260FC5300095684F /* Intents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5F7C491260FC5300095684F /* Intents.framework */; }; E5F7C4AA260FC5300095684F /* BeeSwiftIntents.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = E5F7C490260FC5300095684F /* BeeSwiftIntents.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; E5F7C55026113C330095684F /* AddDataIntents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = E540953B260FB6A100C30784 /* AddDataIntents.intentdefinition */; settings = {ATTRIBUTES = (codegen, ); }; }; @@ -156,13 +139,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - A12E69561BD3EF0200AB94C2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A196CB0C1AE4142E00B90A3E /* Project object */; - proxyType = 1; - remoteGlobalIDString = A12E694C1BD3EF0200AB94C2; - remoteInfo = BeeSwiftToday; - }; A196CB2D1AE4142F00B90A3E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A196CB0C1AE4142E00B90A3E /* Project object */; @@ -177,13 +153,6 @@ remoteGlobalIDString = E57BE6DF2655EBD900BA540B; remoteInfo = BeeKit; }; - E458C7FE2AD10D6E000DCA5C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A196CB0C1AE4142E00B90A3E /* Project object */; - proxyType = 1; - remoteGlobalIDString = E57BE6DF2655EBD900BA540B; - remoteInfo = BeeKit; - }; E57BE6EA2655EBE000BA540B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A196CB0C1AE4142E00B90A3E /* Project object */; @@ -235,7 +204,6 @@ dstPath = ""; dstSubfolderSpec = 13; files = ( - A12E69581BD3EF0200AB94C2 /* BeeSwiftToday.appex in Embed Foundation Extensions */, E5F7C4AA260FC5300095684F /* BeeSwiftIntents.appex in Embed Foundation Extensions */, ); name = "Embed Foundation Extensions"; @@ -264,11 +232,6 @@ A12BA94B1AFF201B00AFEF32 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; A12BA94D1AFF202200AFEF32 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; A12BA9531AFFF21800AFEF32 /* Crypto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Crypto.swift; sourceTree = ""; }; - A12E694D1BD3EF0200AB94C2 /* BeeSwiftToday.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = BeeSwiftToday.appex; sourceTree = BUILT_PRODUCTS_DIR; }; - A12E69501BD3EF0200AB94C2 /* TodayViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayViewController.swift; sourceTree = ""; }; - A12E69531BD3EF0200AB94C2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; - A12E69551BD3EF0200AB94C2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A12E695C1BD3EF3600AB94C2 /* BeeSwiftToday.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = BeeSwiftToday.entitlements; sourceTree = ""; }; A1308D451DE24D76006D0626 /* BeeSwift.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = BeeSwift.entitlements; sourceTree = ""; }; A142492C1FD079B4007736B3 /* SignedRequestManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignedRequestManager.swift; sourceTree = ""; }; A1453B341AED9184006F48DA /* UIColorExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIColorExtension.swift; sourceTree = ""; }; @@ -306,7 +269,6 @@ A1BE73AB1E8B47E700DEC4DB /* HealthKitMetricTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitMetricTableViewCell.swift; sourceTree = ""; }; A1C11B471B06F5D100D22871 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; A1C170DF1BEEB3110018D32B /* UIFontExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIFontExtension.swift; sourceTree = ""; }; - A1D853271EB0DE0700FC75DE /* TodayTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TodayTableViewCell.swift; sourceTree = ""; }; A1E618E11E78158700D8ED93 /* HealthKitConfigViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitConfigViewController.swift; sourceTree = ""; }; A1E618E31E7934C700D8ED93 /* HealthKitConfigTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitConfigTableViewCell.swift; sourceTree = ""; }; A1E618FF1E86980900D8ED93 /* HealthKitConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitConfig.swift; sourceTree = ""; }; @@ -377,23 +339,6 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - A12E694A1BD3EF0200AB94C2 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E41286F52A62E9840093D598 /* KeychainSwift in Frameworks */, - E462BA4A29ADAAB800E80EF0 /* SnapKit in Frameworks */, - A142492E1FD0A56A007736B3 /* HealthKit.framework in Frameworks */, - E462BA5129ADAB4F00E80EF0 /* MBProgressHUD in Frameworks */, - E462BA5529ADACB600E80EF0 /* Alamofire in Frameworks */, - E462BA4F29ADAB4300E80EF0 /* SwiftyJSON in Frameworks */, - E458C7FC2AD10D6E000DCA5C /* BeeKit.framework in Frameworks */, - A12E694E1BD3EF0200AB94C2 /* NotificationCenter.framework in Frameworks */, - E486DE2829B040FB00F338B2 /* OrderedCollections in Frameworks */, - E462BA5729AEEF9D00E80EF0 /* AlamofireImage in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; A196CB111AE4142E00B90A3E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -483,18 +428,6 @@ path = Managers; sourceTree = ""; }; - A12E694F1BD3EF0200AB94C2 /* BeeSwiftToday */ = { - isa = PBXGroup; - children = ( - A12E695C1BD3EF3600AB94C2 /* BeeSwiftToday.entitlements */, - A12E69501BD3EF0200AB94C2 /* TodayViewController.swift */, - A12E69521BD3EF0200AB94C2 /* MainInterface.storyboard */, - A12E69551BD3EF0200AB94C2 /* Info.plist */, - A1D853271EB0DE0700FC75DE /* TodayTableViewCell.swift */, - ); - path = BeeSwiftToday; - sourceTree = ""; - }; A149147C1BE7A4FC0060600A /* UI */ = { isa = PBXGroup; children = ( @@ -523,7 +456,6 @@ A196CB161AE4142E00B90A3E /* BeeSwift */, A196CB2F1AE4142F00B90A3E /* BeeSwiftTests */, E5FEFB3F24E6FAD900A076BB /* BeeSwiftUITests */, - A12E694F1BD3EF0200AB94C2 /* BeeSwiftToday */, E5FEFB3624E6FAC800A076BB /* BeeSwiftUITests */, E5F7C493260FC5300095684F /* BeeSwiftIntents */, E57BE6E12655EBDA00BA540B /* BeeKit */, @@ -538,7 +470,6 @@ children = ( A196CB141AE4142E00B90A3E /* BeeSwift.app */, A196CB2C1AE4142F00B90A3E /* BeeSwiftTests.xctest */, - A12E694D1BD3EF0200AB94C2 /* BeeSwiftToday.appex */, E5FEFB3524E6FAC800A076BB /* BeeSwiftUITests.xctest */, E5F7C490260FC5300095684F /* BeeSwiftIntents.appex */, E57BE6E02655EBD900BA540B /* BeeKit.framework */, @@ -785,33 +716,6 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - A12E694C1BD3EF0200AB94C2 /* BeeSwiftToday */ = { - isa = PBXNativeTarget; - buildConfigurationList = A12E695B1BD3EF0200AB94C2 /* Build configuration list for PBXNativeTarget "BeeSwiftToday" */; - buildPhases = ( - A12E69491BD3EF0200AB94C2 /* Sources */, - A12E694A1BD3EF0200AB94C2 /* Frameworks */, - A12E694B1BD3EF0200AB94C2 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - E458C7FF2AD10D6E000DCA5C /* PBXTargetDependency */, - ); - name = BeeSwiftToday; - packageProductDependencies = ( - E462BA4929ADAAB800E80EF0 /* SnapKit */, - E462BA4E29ADAB4300E80EF0 /* SwiftyJSON */, - E462BA5029ADAB4F00E80EF0 /* MBProgressHUD */, - E462BA5429ADACB600E80EF0 /* Alamofire */, - E462BA5629AEEF9D00E80EF0 /* AlamofireImage */, - E486DE2729B040FB00F338B2 /* OrderedCollections */, - E41286F42A62E9840093D598 /* KeychainSwift */, - ); - productName = BeeSwiftToday; - productReference = A12E694D1BD3EF0200AB94C2 /* BeeSwiftToday.appex */; - productType = "com.apple.product-type.app-extension"; - }; A196CB131AE4142E00B90A3E /* BeeSwift */ = { isa = PBXNativeTarget; buildConfigurationList = A196CB361AE4142F00B90A3E /* Build configuration list for PBXNativeTarget "BeeSwift" */; @@ -825,7 +729,6 @@ buildRules = ( ); dependencies = ( - A12E69571BD3EF0200AB94C2 /* PBXTargetDependency */, E5F7C4A9260FC5300095684F /* PBXTargetDependency */, E57BE6F42655EBE000BA540B /* PBXTargetDependency */, E57BE7132655F00200BA540B /* PBXTargetDependency */, @@ -965,20 +868,6 @@ LastUpgradeCheck = 1500; ORGANIZATIONNAME = APB; TargetAttributes = { - A12E694C1BD3EF0200AB94C2 = { - CreatedOnToolsVersion = 7.1; - DevelopmentTeam = 8TW9V9HVES; - LastSwiftMigration = 1240; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.ApplicationGroups.iOS = { - enabled = 1; - }; - com.apple.SafariKeychain = { - enabled = 0; - }; - }; - }; A196CB131AE4142E00B90A3E = { CreatedOnToolsVersion = 6.3; DevelopmentTeam = 8TW9V9HVES; @@ -1060,7 +949,6 @@ targets = ( A196CB131AE4142E00B90A3E /* BeeSwift */, A196CB2B1AE4142F00B90A3E /* BeeSwiftTests */, - A12E694C1BD3EF0200AB94C2 /* BeeSwiftToday */, E5FEFB3424E6FAC800A076BB /* BeeSwiftUITests */, E5F7C48F260FC5300095684F /* BeeSwiftIntents */, E57BE6DF2655EBD900BA540B /* BeeKit */, @@ -1070,16 +958,6 @@ /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - A12E694B1BD3EF0200AB94C2 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E5DF493924DC69A200260560 /* Config.swift.sample in Resources */, - A12E69541BD3EF0200AB94C2 /* MainInterface.storyboard in Resources */, - A1D853311EB3E0A300FC75DE /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; A196CB121AE4142E00B90A3E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1132,16 +1010,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - A12E69491BD3EF0200AB94C2 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E4B0A32F28C194C800055EA7 /* AddDataIntents.intentdefinition in Sources */, - A12E69511BD3EF0200AB94C2 /* TodayViewController.swift in Sources */, - A1D853281EB0DE0700FC75DE /* TodayTableViewCell.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; A196CB101AE4142E00B90A3E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1276,11 +1144,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - A12E69571BD3EF0200AB94C2 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = A12E694C1BD3EF0200AB94C2 /* BeeSwiftToday */; - targetProxy = A12E69561BD3EF0200AB94C2 /* PBXContainerItemProxy */; - }; A196CB2E1AE4142F00B90A3E /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A196CB131AE4142E00B90A3E /* BeeSwift */; @@ -1291,11 +1154,6 @@ target = E57BE6DF2655EBD900BA540B /* BeeKit */; targetProxy = E458C7F92AD10D68000DCA5C /* PBXContainerItemProxy */; }; - E458C7FF2AD10D6E000DCA5C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = E57BE6DF2655EBD900BA540B /* BeeKit */; - targetProxy = E458C7FE2AD10D6E000DCA5C /* PBXContainerItemProxy */; - }; E57BE6EB2655EBE000BA540B /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = E57BE6DF2655EBD900BA540B /* BeeKit */; @@ -1329,14 +1187,6 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - A12E69521BD3EF0200AB94C2 /* MainInterface.storyboard */ = { - isa = PBXVariantGroup; - children = ( - A12E69531BD3EF0200AB94C2 /* Base */, - ); - name = MainInterface.storyboard; - sourceTree = ""; - }; A196CB201AE4142F00B90A3E /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -1348,62 +1198,6 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - A12E69591BD3EF0200AB94C2 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_ENTITLEMENTS = BeeSwiftToday/BeeSwiftToday.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = 8TW9V9HVES; - ENABLE_TESTABILITY = YES; - EXCLUDED_ARCHS = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = BeeSwiftToday/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 17.6; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.beeminder.beeminder.BeeminderToday; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; - SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - A12E695A1BD3EF0200AB94C2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_ENTITLEMENTS = BeeSwiftToday/BeeSwiftToday.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 8TW9V9HVES; - EXCLUDED_ARCHS = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = BeeSwiftToday/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 17.6; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.beeminder.beeminder.BeeminderToday; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; - SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; A196CB341AE4142F00B90A3E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1935,15 +1729,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - A12E695B1BD3EF0200AB94C2 /* Build configuration list for PBXNativeTarget "BeeSwiftToday" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A12E69591BD3EF0200AB94C2 /* Debug */, - A12E695A1BD3EF0200AB94C2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; A196CB0F1AE4142E00B90A3E /* Build configuration list for PBXProject "BeeSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -2095,11 +1880,6 @@ package = E41286EF2A62E6840093D598 /* XCRemoteSwiftPackageReference "keychain-swift" */; productName = KeychainSwift; }; - E41286F42A62E9840093D598 /* KeychainSwift */ = { - isa = XCSwiftPackageProductDependency; - package = E41286EF2A62E6840093D598 /* XCRemoteSwiftPackageReference "keychain-swift" */; - productName = KeychainSwift; - }; E458C81F2AD11D35000DCA5C /* SwiftyJSON */ = { isa = XCSwiftPackageProductDependency; package = E462BA3D29AC456500E80EF0 /* XCRemoteSwiftPackageReference "SwiftyJSON" */; @@ -2160,41 +1940,16 @@ package = E462BA4629ADAA1C00E80EF0 /* XCRemoteSwiftPackageReference "SnapKit" */; productName = SnapKit; }; - E462BA4929ADAAB800E80EF0 /* SnapKit */ = { - isa = XCSwiftPackageProductDependency; - package = E462BA4629ADAA1C00E80EF0 /* XCRemoteSwiftPackageReference "SnapKit" */; - productName = SnapKit; - }; E462BA4C29ADAB3900E80EF0 /* SwiftyJSON */ = { isa = XCSwiftPackageProductDependency; package = E462BA3D29AC456500E80EF0 /* XCRemoteSwiftPackageReference "SwiftyJSON" */; productName = SwiftyJSON; }; - E462BA4E29ADAB4300E80EF0 /* SwiftyJSON */ = { - isa = XCSwiftPackageProductDependency; - package = E462BA3D29AC456500E80EF0 /* XCRemoteSwiftPackageReference "SwiftyJSON" */; - productName = SwiftyJSON; - }; - E462BA5029ADAB4F00E80EF0 /* MBProgressHUD */ = { - isa = XCSwiftPackageProductDependency; - package = E462BA4029AC458B00E80EF0 /* XCRemoteSwiftPackageReference "MBProgressHUD" */; - productName = MBProgressHUD; - }; E462BA5229ADACAC00E80EF0 /* Alamofire */ = { isa = XCSwiftPackageProductDependency; package = E462BA3429AC44EA00E80EF0 /* XCRemoteSwiftPackageReference "Alamofire" */; productName = Alamofire; }; - E462BA5429ADACB600E80EF0 /* Alamofire */ = { - isa = XCSwiftPackageProductDependency; - package = E462BA3429AC44EA00E80EF0 /* XCRemoteSwiftPackageReference "Alamofire" */; - productName = Alamofire; - }; - E462BA5629AEEF9D00E80EF0 /* AlamofireImage */ = { - isa = XCSwiftPackageProductDependency; - package = E462BA3729AC450000E80EF0 /* XCRemoteSwiftPackageReference "AlamofireImage" */; - productName = AlamofireImage; - }; E462BA5929AEF02500E80EF0 /* IQKeyboardManagerSwift */ = { isa = XCSwiftPackageProductDependency; package = E462BA5829AEF02500E80EF0 /* XCRemoteSwiftPackageReference "IQKeyboardManager" */; @@ -2205,11 +1960,6 @@ package = E486DE2429B0403700F338B2 /* XCRemoteSwiftPackageReference "swift-collections" */; productName = OrderedCollections; }; - E486DE2729B040FB00F338B2 /* OrderedCollections */ = { - isa = XCSwiftPackageProductDependency; - package = E486DE2429B0403700F338B2 /* XCRemoteSwiftPackageReference "swift-collections" */; - productName = OrderedCollections; - }; E486DE2929B0410A00F338B2 /* OrderedCollections */ = { isa = XCSwiftPackageProductDependency; package = E486DE2429B0403700F338B2 /* XCRemoteSwiftPackageReference "swift-collections" */; diff --git a/BeeSwiftToday/Base.lproj/MainInterface.storyboard b/BeeSwiftToday/Base.lproj/MainInterface.storyboard deleted file mode 100644 index 2d0b1874..00000000 --- a/BeeSwiftToday/Base.lproj/MainInterface.storyboard +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BeeSwiftToday/BeeSwiftToday.entitlements b/BeeSwiftToday/BeeSwiftToday.entitlements deleted file mode 100644 index 8bf2187d..00000000 --- a/BeeSwiftToday/BeeSwiftToday.entitlements +++ /dev/null @@ -1,14 +0,0 @@ - - - - - com.apple.security.application-groups - - group.beeminder.beeminder - - keychain-access-groups - - $(AppIdentifierPrefix)group.beeminder.beeminder - - - diff --git a/BeeSwiftToday/Info.plist b/BeeSwiftToday/Info.plist deleted file mode 100644 index f5a25363..00000000 --- a/BeeSwiftToday/Info.plist +++ /dev/null @@ -1,44 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - Beeminder - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - XPC! - CFBundleShortVersionString - 6.7 - CFBundleSignature - ???? - CFBundleVersion - 50 - NSAppTransportSecurity - - NSExceptionDomains - - localhost - - NSExceptionAllowsInsecureHTTPLoads - - - - - NSExtension - - NSExtensionMainStoryboard - MainInterface - NSExtensionPointIdentifier - com.apple.widget-extension - - - diff --git a/BeeSwiftToday/TodayTableViewCell.swift b/BeeSwiftToday/TodayTableViewCell.swift deleted file mode 100644 index d335e6fc..00000000 --- a/BeeSwiftToday/TodayTableViewCell.swift +++ /dev/null @@ -1,192 +0,0 @@ -// -// TodayTableViewCell.swift -// BeeSwift -// -// Created by Andy Brett on 10/15/15. -// Copyright © 2015 APB. All rights reserved. -// - -import Foundation -import UIKit -import Alamofire -import AlamofireImage -import MBProgressHUD -import SwiftyJSON - -import BeeKit - -class TodayTableViewCell: UITableViewCell { - var goal: Goal? { - didSet { - self.configureCell() - } - } - - let valueLabel = BSLabel() - let valueStepper = UIStepper() - let limitLabel = BSLabel() - let addDataButton = BSButton() - var pollTimer : Timer? - let graphImageView = UIImageView() - - var thumbnailPlaceholder: UIImage? { - UIImage(named: "ThumbnailPlaceholder") - } - - override func prepareForReuse() { - super.prepareForReuse() - - self.valueLabel.text = nil - self.limitLabel.text = nil - self.addDataButton.titleLabel?.text = nil - self.graphImageView.image = self.thumbnailPlaceholder - } - - fileprivate func configureCell() { - guard let goal = self.goal else { return } - - self.selectionStyle = .none - - self.addSubview(self.graphImageView) - self.graphImageView.snp.makeConstraints({ (make) -> Void in - make.width.equalTo(Constants.thumbnailWidth) - make.height.equalTo(Constants.thumbnailHeight) - make.left.equalTo(16) - make.top.equalTo(20) - make.bottom.equalTo(-20) - }) - self.graphImageView.image = self.thumbnailPlaceholder - self.setGraphImage(urlStr: goal.thumbUrl) - - self.addSubview(self.limitLabel) - self.limitLabel.numberOfLines = 0 - self.limitLabel.text = "\(goal.slug.prefix(20)): \(goal.limSum)" - self.limitLabel.font = UIFont.systemFont(ofSize: 14) - - self.limitLabel.snp.makeConstraints({ (make) -> Void in - make.left.equalTo(self.graphImageView.snp.right).offset(10) - make.top.equalTo(self.graphImageView).offset(5) - make.right.equalTo(-10) - }) - - if goal.hideDataEntry { - self.limitLabel.snp.remakeConstraints({ (make) in - make.left.equalTo(self.graphImageView.snp.right).offset(10) - make.centerY.equalTo(self.graphImageView) - make.right.equalTo(-10) - }) - return - } - - self.addSubview(self.addDataButton) - self.addDataButton.snp.makeConstraints { (make) in - make.bottom.equalTo(self.graphImageView) - make.right.equalTo(-10) - } - - var addTitle = "Add" - // small screen hack - if (UIDevice.current.orientation == .landscapeRight || UIDevice.current.orientation == .landscapeLeft && UIScreen.main.bounds.height >= 375) || - (UIScreen.main.bounds.width >= 375) { - addTitle = "Add data" - } - self.addDataButton.setTitle(addTitle, for: .normal) - self.addDataButton.setTitleColor(UIColor.black, for: .normal) - self.addDataButton.addTarget(self, action: #selector(self.addDataButtonPressed), for: .touchUpInside) - - self.valueStepper.addTarget(self, action: #selector(self.valueStepperChanged), for: .valueChanged) - self.valueStepper.tintColor = UIColor.darkGray - self.valueStepper.minimumValue = -1000000 - self.valueStepper.maximumValue = 1000000 - self.addSubview(self.valueStepper) - self.valueStepper.snp.makeConstraints { (make) in - make.right.equalTo(self.addDataButton.snp.left).offset(-10) - make.centerY.equalTo(self.addDataButton) - } - - self.addSubview(self.valueLabel) - self.valueLabel.snp.makeConstraints { (make) in - make.centerY.equalTo(self.addDataButton) - make.left.equalTo(self.limitLabel) - make.right.equalTo(self.valueStepper.snp.left).offset(-10) - } - self.valueLabel.text = "0" - self.valueLabel.textAlignment = .center - } - - @objc func valueStepperChanged() { - self.valueLabel.text = "\(Int(self.valueStepper.value))" - } - - @objc func addDataButtonPressed() { - guard let goal = self.goal else { return } - - let hud = MBProgressHUD.showAdded(to: self, animated: true) - hud.mode = .indeterminate - self.addDataButton.isUserInteractionEnabled = false - - let urtextDaystamp = Daystamp.makeUrtextDaystamp(submissionDate: Date(), goal: goal) - let value = Int(self.valueStepper.value) - let comment = "Added via iOS widget" - - let params = ["urtext": "\(urtextDaystamp) \(value) \"\(comment)\"", "requestid": UUID().uuidString] - let slug = goal.slug - - Task { @MainActor in - do { - let _ = try await ServiceLocator.requestManager.post(url: "api/v1/users/me/goals/\(slug)/datapoints.json", parameters: params) - } catch { - self.addDataButton.setTitle("oops!", for: .normal) - return - } - - self.pollUntilGraphUpdates() - } - } - - func pollUntilGraphUpdates() { - if self.pollTimer != nil { return } - self.pollTimer = Timer.scheduledTimer(timeInterval: 2, target: self, selector: #selector(self.refreshGoal), userInfo: nil, repeats: true) - } - - @objc func refreshGoal() { - Task { @MainActor in - guard let goal = self.goal else { return } - let slug = goal.slug - - do { - let responseObject = try await ServiceLocator.requestManager.get(url: "api/v1/users/me/goals/\(slug)", parameters: [:]) - let goalJSON = JSON(responseObject!) - if (!goalJSON["queued"].bool!) { - self.pollTimer?.invalidate() - self.pollTimer = nil - let hud = MBProgressHUD.forView(self) - hud?.mode = .customView - hud?.customView = UIImageView(image: UIImage(named: "BasicCheckmark")) - hud?.hide(animated: true, afterDelay: 2) - self.valueStepper.value = 0 - self.valueLabel.text = "0" - self.addDataButton.isUserInteractionEnabled = true - self.limitLabel.text = "\(slug): \(goalJSON["limsum"])" - let urlString = "\(goalJSON["thumb_url"])" - self.setGraphImage(urlStr: urlString) - } - } catch { - // TODO: Log the error? - } - } - } - - /// updates the graph, setting a placeholder - /// and replacing it with the downloaded, updated image - /// provided via the urlStr - func setGraphImage(urlStr: String?) { - guard !ServiceLocator.currentUserManager.isDeadbeat(), - let thumbUrlStr = urlStr, let thumbUrl = URL(string: thumbUrlStr) else { - self.graphImageView.image = self.thumbnailPlaceholder - return - } - - self.graphImageView.af.setImage(withURL: thumbUrl, placeholderImage: thumbnailPlaceholder, progressQueue: DispatchQueue.global(qos: .background), imageTransition: .crossDissolve(0.4), runImageTransitionIfCached: false) - } -} diff --git a/BeeSwiftToday/TodayViewController.swift b/BeeSwiftToday/TodayViewController.swift deleted file mode 100644 index 9f08dab4..00000000 --- a/BeeSwiftToday/TodayViewController.swift +++ /dev/null @@ -1,91 +0,0 @@ -// -// TodayViewController.swift -// BeeSwift -// -// Created by Andy Brett on 10/13/15. -// Copyright © 2015 APB. All rights reserved. -// - -import Foundation -import UIKit -import SnapKit -import NotificationCenter - -import BeeKit - -class TodayViewController: UIViewController { - var goals: [Goal] = [] { - didSet { - self.extensionContext?.widgetLargestAvailableDisplayMode = self.goals.count > 1 ? .expanded : .compact - } - } - var tableView = UITableView() - - fileprivate let rowHeight = Constants.thumbnailHeight + 40 - fileprivate let cellReuseIdentifier = "todayTableViewCell" - - override func viewDidLoad() { - NotificationCenter.default.addObserver(self, selector: #selector(self.updateDataSource), name: UserDefaults.didChangeNotification, object: nil) - - self.updateDataSource() - - self.preferredContentSize = CGSize(width: 0, height: self.rowHeight) - - self.view.addSubview(self.tableView) - self.tableView.dataSource = self - self.tableView.delegate = self - self.tableView.tableFooterView = UIView() - self.tableView.backgroundColor = UIColor.clear - self.tableView.snp.makeConstraints { (make) in - make.left.equalTo(0) - make.right.equalTo(0) - make.top.equalTo(0) - make.bottom.equalTo(0) - } - self.tableView.register(TodayTableViewCell.self, forCellReuseIdentifier: self.cellReuseIdentifier) - } - - @objc func updateDataSource() { - self.goals = Array(ServiceLocator.currentUserManager.user(context: ServiceLocator.persistentContainer.viewContext)?.goals ?? []) - } -} - -extension TodayViewController : NCWidgetProviding { - func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) { - if activeDisplayMode == .expanded { - self.preferredContentSize = CGSize(width: 0, height: self.rowHeight * self.goals.count) - } - else if activeDisplayMode == .compact { - self.preferredContentSize = CGSize(width: 0, height: self.rowHeight) - } - } -} - -extension TodayViewController : UITableViewDelegate { - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let slug = self.goals[indexPath.row].slug - self.extensionContext?.open(URL(string: "beeminder://?slug=\(slug)")!, completionHandler: nil) - } -} - -extension TodayViewController : UITableViewDataSource { - func numberOfSections(in tableView: UITableView) -> Int { - return 1 - } - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return self.goals.count - } - - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return CGFloat(self.rowHeight) - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = self.tableView.dequeueReusableCell(withIdentifier: self.cellReuseIdentifier, for: indexPath) as! TodayTableViewCell - - cell.goal = self.goals[indexPath.row] - - return cell - } -}