diff --git a/.gitignore b/.gitignore index d80e905..7a43d8b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ Thumbs.db # iOS (Schritt 2) ios/**/xcuserdata/ ios/**/DerivedData/ +# Wird aus ios/project.yml erzeugt ("xcodegen generate") +ios/ProjectGood.xcodeproj/ diff --git a/ios/Sources/Info.plist b/ios/Sources/Info.plist index fe74b7d..fcc10d3 100644 --- a/ios/Sources/Info.plist +++ b/ios/Sources/Info.plist @@ -2,6 +2,20 @@ + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleDisplayName Project-Good CFBundleShortVersionString diff --git a/ios/Sources/ProductViews.swift b/ios/Sources/ProductViews.swift index 005cc72..3c8814a 100644 --- a/ios/Sources/ProductViews.swift +++ b/ios/Sources/ProductViews.swift @@ -30,7 +30,7 @@ struct ProductSearchView: View { .searchable(text: $query, prompt: "Artikel suchen") .onSubmit(of: .search) { Task { await search() } } .task { await search() } - .onChange(of: query) { _, _ in Task { await search() } } + .onChange(of: query) { _ in Task { await search() } } .navigationTitle("Artikel suchen") .navigationBarTitleDisplayMode(.inline) .toolbar { diff --git a/ios/Sources/ProjectGoodApp.swift b/ios/Sources/ProjectGoodApp.swift index 3d2c2c1..9360ea6 100644 --- a/ios/Sources/ProjectGoodApp.swift +++ b/ios/Sources/ProjectGoodApp.swift @@ -61,9 +61,13 @@ final class AppDelegate: NSObject, UIApplicationDelegate { return true } + // Bewusst die Variante mit Completion-Handler: Bei der async-Fassung muesste + // das nicht-Sendable UIApplicationShortcutItem ueber eine Actor-Grenze + // gereicht werden (Warnung heute, Fehler im Swift-6-Sprachmodus). func application(_ application: UIApplication, - performActionFor shortcutItem: UIApplicationShortcutItem) async -> Bool { + performActionFor shortcutItem: UIApplicationShortcutItem, + completionHandler: @escaping (Bool) -> Void) { NotificationCenter.default.post(name: AppDelegate.shortcutNotification, object: shortcutItem.type) - return true + completionHandler(true) } } diff --git a/ios/project.yml b/ios/project.yml index 38cce41..55215ca 100644 --- a/ios/project.yml +++ b/ios/project.yml @@ -13,29 +13,17 @@ targets: ProjectGood: type: application platform: iOS + # Info.plist wird bewusst NICHT aus dieser Datei erzeugt, sondern unveraendert + # aus Sources/Info.plist uebernommen. Ein "info:"-Block hier wuerde die Datei + # bei jedem "xcodegen generate" ueberschreiben und dabei Schluessel verlieren, + # die nur dort stehen (z. B. NSAppTransportSecurity fuer das HTTP-Heimnetz). sources: - path: Sources - info: - path: Sources/Info.plist - properties: - CFBundleDisplayName: Project-Good - CFBundleShortVersionString: "1.0" - CFBundleVersion: "1" - UILaunchScreen: {} - NSCameraUsageDescription: >- - Die Kamera wird zum Scannen von Barcodes beim Ein- und Auslagern verwendet. - UIApplicationShortcutItems: - - UIApplicationShortcutItemType: com.scarriffle.projectgood.checkin - UIApplicationShortcutItemTitle: Einlagern - UIApplicationShortcutItemIconType: UIApplicationShortcutIconTypeAdd - - UIApplicationShortcutItemType: com.scarriffle.projectgood.checkout - UIApplicationShortcutItemTitle: Auslagern - UIApplicationShortcutItemIconType: UIApplicationShortcutIconTypeRemove - CFBundleURLTypes: - - CFBundleURLName: com.scarriffle.projectgood - CFBundleURLSchemes: [projectgood] + excludes: + - Info.plist settings: base: + INFOPLIST_FILE: Sources/Info.plist PRODUCT_BUNDLE_IDENTIFIER: com.scarriffle.projectgood MARKETING_VERSION: "1.0" TARGETED_DEVICE_FAMILY: "1,2"