Skip to content

Commit bfee8d4

Browse files
authored
Merge branch 'master' into bugfix/226-no-pull-to-refresh-on-empty-gallery
2 parents 40fb791 + 7571f7d commit bfee8d4

File tree

15 files changed

+220
-119
lines changed

15 files changed

+220
-119
lines changed

BeeKit/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<key>CFBundlePackageType</key>
1616
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>6.7</string>
18+
<string>6.8</string>
1919
<key>CFBundleVersion</key>
20-
<string>54</string>
20+
<string>55</string>
2121
</dict>
2222
</plist>

BeeKitTests/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<key>CFBundlePackageType</key>
1616
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>6.7</string>
18+
<string>6.8</string>
1919
<key>CFBundleVersion</key>
20-
<string>54</string>
20+
<string>55</string>
2121
</dict>
2222
</plist>

BeeSwift.xcodeproj/project.pbxproj

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
9B65F2322CFA6427009674A7 /* DeeplinkGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B65F2312CFA6418009674A7 /* DeeplinkGenerator.swift */; };
1011
9B8CA57D24B120CA009C86C2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9B8CA57C24B120CA009C86C2 /* LaunchScreen.storyboard */; };
1112
A10D4E931B07948500A72D29 /* DatapointsTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A10D4E921B07948500A72D29 /* DatapointsTableView.swift */; };
1213
A10DC2DF207BFCBA00FB7B3A /* RemoveHKMetricViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A10DC2DE207BFCBA00FB7B3A /* RemoveHKMetricViewController.swift */; };
@@ -24,7 +25,6 @@
2425
A17E930C1B09032F0098FCA0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A17E930B1B09032F0098FCA0 /* QuartzCore.framework */; };
2526
A196CB1A1AE4142E00B90A3E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A196CB191AE4142E00B90A3E /* AppDelegate.swift */; };
2627
A196CB1F1AE4142F00B90A3E /* GalleryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A196CB1E1AE4142F00B90A3E /* GalleryViewController.swift */; };
27-
A196CB221AE4142F00B90A3E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A196CB201AE4142F00B90A3E /* Main.storyboard */; };
2828
A196CB241AE4142F00B90A3E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A196CB231AE4142F00B90A3E /* Images.xcassets */; };
2929
A196CB331AE4142F00B90A3E /* BeeSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A196CB321AE4142F00B90A3E /* BeeSwiftTests.swift */; };
3030
A1A8BDE61FEAE8DD007D61D6 /* ConfigureNotificationsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1A8BDE51FEAE8DD007D61D6 /* ConfigureNotificationsViewController.swift */; };
@@ -38,6 +38,7 @@
3838
A1E618E41E7934C700D8ED93 /* HealthKitConfigTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1E618E31E7934C700D8ED93 /* HealthKitConfigTableViewCell.swift */; };
3939
A1EA154D1B01E6EC0052A6E6 /* DatapointTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1EA154C1B01E6EC0052A6E6 /* DatapointTableViewCell.swift */; };
4040
A1F9D1EA211B9B7600E2BC93 /* EditDatapointViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1F9D1E9211B9B7600E2BC93 /* EditDatapointViewController.swift */; };
41+
E4015D9F2D10DC4D00F58D94 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4015D9E2D10DC4D00F58D94 /* SceneDelegate.swift */; };
4142
E41286F12A62E6840093D598 /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = E41286F02A62E6840093D598 /* KeychainSwift */; };
4243
E41286F32A62E97B0093D598 /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = E41286F22A62E97B0093D598 /* KeychainSwift */; };
4344
E412DADF2B869E1E0099E483 /* BeeLemniscateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E412DADE2B869E1E0099E483 /* BeeLemniscateView.swift */; };
@@ -217,6 +218,7 @@
217218
/* End PBXCopyFilesBuildPhase section */
218219

219220
/* Begin PBXFileReference section */
221+
9B65F2312CFA6418009674A7 /* DeeplinkGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeeplinkGenerator.swift; sourceTree = "<group>"; };
220222
9B8CA57C24B120CA009C86C2 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
221223
A10D4E921B07948500A72D29 /* DatapointsTableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatapointsTableView.swift; sourceTree = "<group>"; };
222224
A10DC2DE207BFCBA00FB7B3A /* RemoveHKMetricViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoveHKMetricViewController.swift; sourceTree = "<group>"; };
@@ -246,7 +248,6 @@
246248
A196CB181AE4142E00B90A3E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
247249
A196CB191AE4142E00B90A3E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
248250
A196CB1E1AE4142F00B90A3E /* GalleryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GalleryViewController.swift; sourceTree = "<group>"; };
249-
A196CB211AE4142F00B90A3E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
250251
A196CB231AE4142F00B90A3E /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
251252
A196CB2C1AE4142F00B90A3E /* BeeSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BeeSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
252253
A196CB311AE4142F00B90A3E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -268,6 +269,7 @@
268269
A1E618FF1E86980900D8ED93 /* HealthKitConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitConfig.swift; sourceTree = "<group>"; };
269270
A1EA154C1B01E6EC0052A6E6 /* DatapointTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatapointTableViewCell.swift; sourceTree = "<group>"; };
270271
A1F9D1E9211B9B7600E2BC93 /* EditDatapointViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditDatapointViewController.swift; sourceTree = "<group>"; };
272+
E4015D9E2D10DC4D00F58D94 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
271273
E4040D732A7B5F0E008E7D0E /* WorkoutMinutesHealthKitMetric.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WorkoutMinutesHealthKitMetric.swift; sourceTree = "<group>"; };
272274
E41286ED2A62DF330093D598 /* BeeminderModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = BeeminderModel.xcdatamodel; sourceTree = "<group>"; };
273275
E412DADE2B869E1E0099E483 /* BeeLemniscateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeeLemniscateView.swift; sourceTree = "<group>"; };
@@ -476,6 +478,7 @@
476478
A196CB161AE4142E00B90A3E /* BeeSwift */ = {
477479
isa = PBXGroup;
478480
children = (
481+
9B65F2312CFA6418009674A7 /* DeeplinkGenerator.swift */,
479482
A1E618E51E79E01900D8ED93 /* Cells */,
480483
E46071002B43DA7100305DB4 /* Gallery */,
481484
E46070FF2B43DA3D00305DB4 /* GoalView */,
@@ -490,8 +493,8 @@
490493
A196CB231AE4142F00B90A3E /* Images.xcassets */,
491494
9B8CA57C24B120CA009C86C2 /* LaunchScreen.storyboard */,
492495
E43BEA832A036A9C00FC3A38 /* LogReader.swift */,
493-
A196CB201AE4142F00B90A3E /* Main.storyboard */,
494496
A1453B3E1AEDFCC8006F48DA /* SignInViewController.swift */,
497+
E4015D9E2D10DC4D00F58D94 /* SceneDelegate.swift */,
495498
);
496499
path = BeeSwift;
497500
sourceTree = "<group>";
@@ -959,7 +962,6 @@
959962
buildActionMask = 2147483647;
960963
files = (
961964
E5DF493724DC69A200260560 /* Config.swift.sample in Resources */,
962-
A196CB221AE4142F00B90A3E /* Main.storyboard in Resources */,
963965
9B8CA57D24B120CA009C86C2 /* LaunchScreen.storyboard in Resources */,
964966
A196CB241AE4142F00B90A3E /* Images.xcassets in Resources */,
965967
);
@@ -1014,9 +1016,11 @@
10141016
A1E618E41E7934C700D8ED93 /* HealthKitConfigTableViewCell.swift in Sources */,
10151017
E4B083392932F90400A71564 /* ConfigureHKMetricViewController.swift in Sources */,
10161018
E43BEA842A036A9C00FC3A38 /* LogReader.swift in Sources */,
1019+
9B65F2322CFA6427009674A7 /* DeeplinkGenerator.swift in Sources */,
10171020
A196CB1F1AE4142F00B90A3E /* GalleryViewController.swift in Sources */,
10181021
A1BE73AA1E8B45BF00DEC4DB /* ChooseHKMetricViewController.swift in Sources */,
10191022
A149147B1BE79FD50060600A /* EditNotificationsViewController.swift in Sources */,
1023+
E4015D9F2D10DC4D00F58D94 /* SceneDelegate.swift in Sources */,
10201024
A1BE73AC1E8B47E700DEC4DB /* HealthKitMetricTableViewCell.swift in Sources */,
10211025
E43833942AC1473E0098A38F /* InlineDatePicker.swift in Sources */,
10221026
E55760F526549D310076B95A /* AddDataIntentHandler.swift in Sources */,
@@ -1177,17 +1181,6 @@
11771181
};
11781182
/* End PBXTargetDependency section */
11791183

1180-
/* Begin PBXVariantGroup section */
1181-
A196CB201AE4142F00B90A3E /* Main.storyboard */ = {
1182-
isa = PBXVariantGroup;
1183-
children = (
1184-
A196CB211AE4142F00B90A3E /* Base */,
1185-
);
1186-
name = Main.storyboard;
1187-
sourceTree = "<group>";
1188-
};
1189-
/* End PBXVariantGroup section */
1190-
11911184
/* Begin XCBuildConfiguration section */
11921185
A196CB341AE4142F00B90A3E /* Debug */ = {
11931186
isa = XCBuildConfiguration;
@@ -1222,7 +1215,7 @@
12221215
CODE_SIGN_IDENTITY = "iPhone Developer";
12231216
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
12241217
COPY_PHASE_STRIP = NO;
1225-
CURRENT_PROJECT_VERSION = 54;
1218+
CURRENT_PROJECT_VERSION = 55;
12261219
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
12271220
ENABLE_STRICT_OBJC_MSGSEND = YES;
12281221
ENABLE_TESTABILITY = YES;
@@ -1287,7 +1280,7 @@
12871280
CODE_SIGN_IDENTITY = "iPhone Distribution";
12881281
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
12891282
COPY_PHASE_STRIP = NO;
1290-
CURRENT_PROJECT_VERSION = 54;
1283+
CURRENT_PROJECT_VERSION = 55;
12911284
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
12921285
ENABLE_NS_ASSERTIONS = NO;
12931286
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -1454,7 +1447,7 @@
14541447
DEFINES_MODULE = YES;
14551448
DEVELOPMENT_TEAM = 8TW9V9HVES;
14561449
DYLIB_COMPATIBILITY_VERSION = 1;
1457-
DYLIB_CURRENT_VERSION = 54;
1450+
DYLIB_CURRENT_VERSION = 55;
14581451
DYLIB_INSTALL_NAME_BASE = "@rpath";
14591452
ENABLE_MODULE_VERIFIER = YES;
14601453
EXCLUDED_ARCHS = "";
@@ -1501,7 +1494,7 @@
15011494
DEFINES_MODULE = YES;
15021495
DEVELOPMENT_TEAM = 8TW9V9HVES;
15031496
DYLIB_COMPATIBILITY_VERSION = 1;
1504-
DYLIB_CURRENT_VERSION = 54;
1497+
DYLIB_CURRENT_VERSION = 55;
15051498
DYLIB_INSTALL_NAME_BASE = "@rpath";
15061499
ENABLE_MODULE_VERIFIER = YES;
15071500
EXCLUDED_ARCHS = "";

BeeSwift/AppDelegate.swift

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
2121
let logger = Logger(subsystem: "com.beeminder.beeminder", category: "AppDelegate")
2222
let backgroundUpdates = BackgroundUpdates()
2323

24-
var window: UIWindow?
25-
2624
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
2725
logger.notice("application:didFinishLaunchingWithOptions")
2826

@@ -43,8 +41,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
4341

4442
NetworkActivityIndicatorManager.shared.isEnabled = true
4543

46-
NotificationCenter.default.addObserver(self, selector: #selector(self.updateBadgeCount), name: NSNotification.Name(rawValue: GoalManager.goalsUpdatedNotificationName), object: nil)
47-
NotificationCenter.default.addObserver(self, selector: #selector(self.updateBadgeCount), name: NSNotification.Name(rawValue: CurrentUserManager.signedOutNotificationName), object: nil)
44+
NotificationCenter.default.addObserver(self, selector: #selector(self.handleGoalsUpdated), name: NSNotification.Name(rawValue: GoalManager.goalsUpdatedNotificationName), object: nil)
45+
NotificationCenter.default.addObserver(self, selector: #selector(self.handleUserSignedOut), name: NSNotification.Name(rawValue: CurrentUserManager.signedOutNotificationName), object: nil)
4846

4947
backgroundUpdates.startUpdatingRegularlyInBackground()
5048

@@ -128,9 +126,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
128126
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
129127
logger.notice("application:didFailToRegisterForRemoteNotificationsWithError")
130128
}
131-
132-
@objc func updateBadgeCount() {
133-
assert(Thread.isMainThread, "updateBadgeCount must be run on the main thread")
129+
130+
@objc private func handleGoalsUpdated() {
131+
assert(Thread.isMainThread, "\(#function) must be run on the main thread")
134132

135133
let context = ServiceLocator.persistentContainer.viewContext
136134
guard let goals = ServiceLocator.goalManager.staleGoals(context: context) else { return }
@@ -139,6 +137,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
139137

140138
UNUserNotificationCenter.current().setBadgeCount(beemergencyCount)
141139
}
140+
141+
@objc private func handleUserSignedOut() {
142+
assert(Thread.isMainThread, "\(#function) must be run on the main thread")
143+
144+
logger.notice("User signed out; updating Beemergency badge count to 0")
145+
146+
UNUserNotificationCenter.current().setBadgeCount(0)
147+
}
142148

143149
private func refreshGoalsAndLogErrors() {
144150
Task { @MainActor in

BeeSwift/Base.lproj/Main.storyboard

Lines changed: 0 additions & 53 deletions
This file was deleted.

BeeSwift/DeeplinkGenerator.swift

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//
2+
// DeeplinkGenerator.swift
3+
// BeeSwift
4+
//
5+
// Created by krugerk on 2024-11-29.
6+
//
7+
8+
9+
struct DeeplinkGenerator {
10+
public static func generateDeepLinkToGoalCommitment(username: String, goalName: String) -> URL {
11+
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#commitment")!
12+
}
13+
14+
public static func generateDeepLinkToGoalStop(username: String, goalName: String) -> URL {
15+
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#stop")!
16+
}
17+
18+
public static func generateDeepLinkToGoalData(username: String, goalName: String) -> URL {
19+
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#data")!
20+
}
21+
22+
public static func generateDeepLinkToGoalStatistics(username: String, goalName: String) -> URL {
23+
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#statistics")!
24+
}
25+
26+
public static func generateDeepLinkToGoalSettings(username: String, goalName: String) -> URL {
27+
URL(string: "https://www.beeminder.com/\(username)/\(goalName)#settings")!
28+
}
29+
30+
public static func generateDeepLinkToUrl(accessToken: String, username: String, url: URL) -> URL {
31+
let baseUrlString = "https://www.beeminder.com/api/v1/users/\(username).json"
32+
33+
var components = URLComponents(string: baseUrlString)!
34+
35+
components.queryItems = [
36+
URLQueryItem(name: "access_token", value: accessToken),
37+
URLQueryItem(name: "redirect_to_url", value: url.absoluteString)
38+
]
39+
40+
return components.url!
41+
}
42+
}

0 commit comments

Comments
 (0)