v0.8.0 — Phase β-7 App-Store-Vorbereitung
Feature-komplett für TestFlight. App-Icon-Platzhalter, Siri-Shortcut, Share-Extension, Release-Checklist mit allen externen Apple-Schritten. - scripts/make-appicon.swift: CoreGraphics-basierter Generator für 1024×1024 forest-green PNG mit "C"-Letter und Karten-Stack-Schatten - Asset-Catalog auf Single-Size-AppIcon-Pattern umgestellt - StudyCardsIntent + CardsAppShortcuts (App Intents): Siri- Shortcut "Karten lernen mit Cards" / "Mit Cards lernen" - CardsShareExtension Target: ShareViewController (UIKit-Bootstrap + SwiftUI-Hosting), ShareEditorView mit Text-Edit - PendingShare + PendingShareStore shared in App-Group group.ev.mana.cards - DeckListView zeigt PendingShare-Banner; Tap navigiert zu PendingShareConsumeView mit Deck-Picker + Front/Back-Felder, Submit → POST /cards, danach store.remove - Info.plist: NSPhotoLibraryUsageDescription für Image-Occlusion- Picker, NSUserActivityTypes für Universal-Links - docs/RELEASE_CHECKLIST.md mit externen Schritten: Apple-Developer- Portal, App-IDs, App-Group, AASA, Xcode-Archive, TestFlight-Plan, App-Store-Connect-Felder, Compliance-Verifikation - UI-Test robuster (akzeptiert Login oder Decks/Entdecken als Launch-Erfolg, unabhängig vom Simulator-Keychain-State) - 35 Tests + 1 UI-Test grün, alle drei Targets bauen App-Store-Submission selbst ist externe Aktion und passiert nicht durch dieses Repo — Schritte in docs/RELEASE_CHECKLIST.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
55359c5333
commit
0b2ae167b7
16 changed files with 783 additions and 59 deletions
10
ShareExtension/Resources/CardsShareExtension.entitlements
Normal file
10
ShareExtension/Resources/CardsShareExtension.entitlements
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.ev.mana.cards</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
41
ShareExtension/Resources/Info.plist
Normal file
41
ShareExtension/Resources/Info.plist
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Als Karte speichern</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionAttributes</key>
|
||||
<dict>
|
||||
<key>NSExtensionActivationRule</key>
|
||||
<dict>
|
||||
<key>NSExtensionActivationSupportsText</key>
|
||||
<true/>
|
||||
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.share-services</string>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).ShareViewController</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
60
ShareExtension/ShareEditorView.swift
Normal file
60
ShareExtension/ShareEditorView.swift
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import SwiftUI
|
||||
|
||||
/// Mini-Editor in der Share-Extension. User kann den Text noch
|
||||
/// anpassen, dann "Speichern" → PendingShare landet in der Haupt-App.
|
||||
struct ShareEditorView: View {
|
||||
let initialText: String
|
||||
let sourceURL: String?
|
||||
let onSave: (String) -> Void
|
||||
let onCancel: () -> Void
|
||||
|
||||
@State private var text: String
|
||||
|
||||
init(
|
||||
text: String,
|
||||
sourceURL: String?,
|
||||
onSave: @escaping (String) -> Void,
|
||||
onCancel: @escaping () -> Void
|
||||
) {
|
||||
initialText = text
|
||||
self.sourceURL = sourceURL
|
||||
self.onSave = onSave
|
||||
self.onCancel = onCancel
|
||||
_text = State(initialValue: text)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
Form {
|
||||
Section("Vorderseite") {
|
||||
TextField("Text", text: $text, axis: .vertical)
|
||||
.lineLimit(4 ... 10)
|
||||
}
|
||||
if let sourceURL {
|
||||
Section("Quelle") {
|
||||
Text(sourceURL)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.lineLimit(1)
|
||||
}
|
||||
}
|
||||
Section {
|
||||
Text("Wähle das Ziel-Deck in der Cards-App.")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
.navigationTitle("Als Karte speichern")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
Button("Abbrechen", action: onCancel)
|
||||
}
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button("Speichern") { onSave(text) }
|
||||
.disabled(text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
78
ShareExtension/ShareViewController.swift
Normal file
78
ShareExtension/ShareViewController.swift
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
import SwiftUI
|
||||
import UIKit
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
/// Share-Extension-Entrypoint. Liest geteilten Text/URL aus
|
||||
/// `extensionContext`, persistiert als `PendingShare` in der App-Group,
|
||||
/// schließt sich nach Bestätigung.
|
||||
final class ShareViewController: UIViewController {
|
||||
private var sharedText: String = ""
|
||||
private var sharedURL: String?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
view.backgroundColor = .systemBackground
|
||||
loadSharedContent { [weak self] in
|
||||
self?.presentEditor()
|
||||
}
|
||||
}
|
||||
|
||||
private func loadSharedContent(completion: @escaping () -> Void) {
|
||||
guard let item = extensionContext?.inputItems.first as? NSExtensionItem,
|
||||
let providers = item.attachments
|
||||
else {
|
||||
completion()
|
||||
return
|
||||
}
|
||||
|
||||
let group = DispatchGroup()
|
||||
for provider in providers {
|
||||
if provider.hasItemConformingToTypeIdentifier(UTType.url.identifier) {
|
||||
group.enter()
|
||||
provider.loadItem(forTypeIdentifier: UTType.url.identifier, options: nil) { item, _ in
|
||||
if let url = item as? URL {
|
||||
self.sharedURL = url.absoluteString
|
||||
if self.sharedText.isEmpty { self.sharedText = url.absoluteString }
|
||||
}
|
||||
group.leave()
|
||||
}
|
||||
} else if provider.hasItemConformingToTypeIdentifier(UTType.plainText.identifier) {
|
||||
group.enter()
|
||||
provider.loadItem(forTypeIdentifier: UTType.plainText.identifier, options: nil) { item, _ in
|
||||
if let text = item as? String { self.sharedText = text }
|
||||
group.leave()
|
||||
}
|
||||
}
|
||||
}
|
||||
group.notify(queue: .main, execute: completion)
|
||||
}
|
||||
|
||||
private func presentEditor() {
|
||||
let host = UIHostingController(rootView: ShareEditorView(
|
||||
text: sharedText,
|
||||
sourceURL: sharedURL,
|
||||
onSave: { [weak self] cleanedText in
|
||||
self?.saveAndClose(text: cleanedText)
|
||||
},
|
||||
onCancel: { [weak self] in
|
||||
self?.cancel()
|
||||
}
|
||||
))
|
||||
host.modalPresentationStyle = .formSheet
|
||||
present(host, animated: true)
|
||||
}
|
||||
|
||||
private func saveAndClose(text: String) {
|
||||
let share = PendingShare(text: text, sourceURL: sharedURL)
|
||||
PendingShareStore.append(share)
|
||||
dismiss(animated: true) { [weak self] in
|
||||
self?.extensionContext?.completeRequest(returningItems: nil)
|
||||
}
|
||||
}
|
||||
|
||||
private func cancel() {
|
||||
dismiss(animated: true) { [weak self] in
|
||||
self?.extensionContext?.cancelRequest(withError: NSError(domain: "ev.mana.cards.share", code: 0))
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue