From 3a0c130cb14331effc20930adc8b45a8be29b075 Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Wed, 22 Jul 2026 16:57:27 +0200 Subject: [PATCH] iOS-App kompiliert erstmals: Info.plist gesichert und zwei Build-Fehler behoben Die App war bisher nie durch einen Compiler gelaufen. Mit Xcode 26.6 baut sie jetzt fehler- und warnungsfrei gegen das iOS-16-Deployment-Target. Info.plist: Der "info:"-Block in project.yml hat die handgepflegte Sources/Info.plist bei jedem "xcodegen generate" ueberschrieben und dabei Schluessel verloren, die nur in der Datei standen - insbesondere NSAppTransportSecurity/NSAllowsLocalNetworking. Ohne diese Ausnahme haette die App den Server im Heimnetz per http:// ueberhaupt nicht erreichen koennen. Die Datei ist jetzt die einzige Quelle: project.yml verweist nur noch per INFOPLIST_FILE darauf und nimmt sie aus den Sources heraus. Die Bundle-Keys, die vorher nur die erzeugte Fassung hatte (CFBundleExecutable, CFBundleIdentifier, CFBundlePackageType ...), stehen nun in der Datei selbst. ProductViews: onChange(of:) wurde in der zweiwertigen iOS-17-Form verwendet und war damit ein harter Fehler - auf die einwertige Form umgestellt. ProjectGoodApp: application(_:performActionFor:) als async-Fassung reicht das nicht-Sendable UIApplicationShortcutItem ueber eine Actor-Grenze. Das ist heute eine Warnung und im Swift-6-Sprachmodus ein Fehler; jetzt die Variante mit Completion-Handler. Der dritte Verdacht hat sich nicht bestaetigt: AudioServicesPlaySystemSound in ScannerView uebersetzt ohne zusaetzliches "import AudioToolbox", weil AVFoundation es bereits mitbringt. Deshalb dort keine Aenderung. Das erzeugte ProjectGood.xcodeproj wandert in .gitignore, da project.yml es vollstaendig beschreibt. Co-Authored-By: Claude Opus 4.8 --- .gitignore | 2 ++ ios/Sources/Info.plist | 14 ++++++++++++++ ios/Sources/ProductViews.swift | 2 +- ios/Sources/ProjectGoodApp.swift | 8 ++++++-- ios/project.yml | 26 +++++++------------------- 5 files changed, 30 insertions(+), 22 deletions(-) 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"