Code + Identity-Rename zur Vorbereitung auf Apple-Dev-Portal-Aktion (Bundle ev.mana.wordeck, App-Group group.ev.mana.wordeck, AASA applinks:wordeck.com). Build bleibt funktional, aber gegen die neue text-only-API können image-occlusion-Creates 422 zurückgeben — das wird mit der Wordeck-Native v1.0-Welle (parallele Apple-Aktion) sauber gemacht. Umbenennung: - 41 Files: cardecky/Cardecky → wordeck/Wordeck (Display, Strings, Kommentare) - 57 Files: CardsNative → WordeckNative, CardsAPI → WordeckAPI, CardsTheme → WordeckTheme, CardsBrand → WordeckBrand, CardsWidget → WordeckWidget, CardsDueWidget → WordeckDueWidget - Bundle-ID ev.mana.cardecky → ev.mana.wordeck (project.yml, Info.plist, entitlements, Keychain-Service, App-Group) - AASA applinks:cardecky.mana.how → applinks:wordeck.com - API-Base cardecky-api.mana.how → api.wordeck.com - 10 Files renamed (App-Entry, API-Extensions, Theme, Widget, Entitlements, Tests) - xcodeproj regenerated via xcodegen → WordeckNative.xcodeproj - MaskRegionsTests.swift gelöscht (image-occlusion entfällt mit Wordeck text-only) Forgejo-Repo git.mana.how/till/cards-native → wordeck-native umbenannt (Auto-Redirect aktiv). Lokales Verzeichnis Code/cards-native/ bleibt vorerst — wird beim nächsten Apple-Setup mit Bundle-Test umbenannt. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
56 lines
1.9 KiB
Swift
56 lines
1.9 KiB
Swift
import SwiftUI
|
|
|
|
#if canImport(SafariServices) && canImport(UIKit)
|
|
import SafariServices
|
|
import UIKit
|
|
#endif
|
|
|
|
/// In-App-Browser für die Druck-Ansicht des Decks. Nutzt
|
|
/// `SFSafariViewController`, weil iOS dort die Print-Sheet und
|
|
/// „In Dateien speichern" → PDF von Haus aus mitbringt — kein eigener
|
|
/// PDF-Renderer in der App nötig.
|
|
///
|
|
/// Auth-Cookies für `wordeck.com` werden geteilt mit Safari auf
|
|
/// dem Gerät; der User muss dort eingeloggt sein, damit die Print-
|
|
/// Seite den Deck-Inhalt rendert.
|
|
struct DeckPrintView: View {
|
|
let deckId: String
|
|
|
|
@Environment(\.dismiss) private var dismiss
|
|
|
|
private var printURL: URL {
|
|
URL(string: "https://wordeck.com/decks/\(deckId)/print")!
|
|
}
|
|
|
|
var body: some View {
|
|
#if canImport(SafariServices) && canImport(UIKit)
|
|
SafariViewRepresentable(url: printURL)
|
|
.ignoresSafeArea()
|
|
#else
|
|
VStack(spacing: 16) {
|
|
Text("Druck-Ansicht ist nur auf iOS verfügbar.")
|
|
.font(.subheadline)
|
|
Link("Im Web öffnen", destination: printURL)
|
|
Button("Schließen") { dismiss() }
|
|
}
|
|
.padding(32)
|
|
#endif
|
|
}
|
|
}
|
|
|
|
#if canImport(SafariServices) && canImport(UIKit)
|
|
private struct SafariViewRepresentable: UIViewControllerRepresentable {
|
|
let url: URL
|
|
|
|
func makeUIViewController(context _: Context) -> SFSafariViewController {
|
|
let config = SFSafariViewController.Configuration()
|
|
config.entersReaderIfAvailable = false
|
|
let controller = SFSafariViewController(url: url, configuration: config)
|
|
controller.preferredControlTintColor = .systemGreen
|
|
controller.dismissButtonStyle = .close
|
|
return controller
|
|
}
|
|
|
|
func updateUIViewController(_: SFSafariViewController, context _: Context) {}
|
|
}
|
|
#endif
|