txtodo

[DORMANT] a minimalist todo list app inspired by jeff huang
git clone git://git.figbert.com/txtodo.git
Log | Files | Refs | README

commit 69bce3cc045ab897345d9b9eba655743cca45d64
parent 7f504649e36d1e68413146745232a8ec2c93d0a4
Author: FIGBERT <figbert@figbert.com>
Date:   Wed, 25 Nov 2020 13:09:54 -0800

Simplify SceneBuilder code

Previously the iOS and macOS windows were declared separately,
because I had assumed that the SKPaymentQueue had to be managed
on the window that used it. However, moving SKPaymentQueue to the
WindowGroup on both platforms functions perfectly, simplifies code,
and improves load times on macOS.

Diffstat:
MShared/txtodoApp.swift | 23+----------------------
MiOS/Info.plist | 4++--
MmacOS/Info.plist | 4++--
3 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/Shared/txtodoApp.swift b/Shared/txtodoApp.swift @@ -22,7 +22,6 @@ struct txtodoApp: App { ] @SceneBuilder var body: some Scene { - #if os(iOS) WindowGroup { ContentView(storeManager: storeManager) .environment(\.managedObjectContext, self.persistentContainer.viewContext) @@ -43,29 +42,9 @@ struct txtodoApp: App { saveContext() } } - #elseif os(macOS) - WindowGroup { - ContentView(storeManager: storeManager) - .environment(\.managedObjectContext, self.persistentContainer.viewContext) - } - .onChange(of: scenePhase) { phase in - switch phase { - case .active: - UNUserNotificationCenter.current().removeAllDeliveredNotifications() - case .inactive: - saveContext() - case .background: - saveContext() - @unknown default: - saveContext() - } - } + #if os(macOS) Settings { SettingsView(storeManager: storeManager) - .onAppear(perform: { - SKPaymentQueue.default().add(storeManager) - storeManager.getProducts(productIDs: productIDs) - }) } #endif } diff --git a/iOS/Info.plist b/iOS/Info.plist @@ -15,9 +15,9 @@ <key>CFBundlePackageType</key> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <key>CFBundleShortVersionString</key> - <string>3.0.2</string> + <string>3.0.3</string> <key>CFBundleVersion</key> - <string>3.0.2</string> + <string>3.0.3</string> <key>LSRequiresIPhoneOS</key> <true/> <key>UIApplicationSceneManifest</key> diff --git a/macOS/Info.plist b/macOS/Info.plist @@ -17,9 +17,9 @@ <key>CFBundlePackageType</key> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <key>CFBundleShortVersionString</key> - <string>1.0.1</string> + <string>1.0.2</string> <key>CFBundleVersion</key> - <string>1.0.1</string> + <string>1.0.2</string> <key>LSApplicationCategoryType</key> <string>public.app-category.productivity</string> <key>LSMinimumSystemVersion</key>