Prepare App Store 1.0 build 4

This commit is contained in:
2026-08-17 16:50:30 +02:00
parent f894d43eb6
commit 0b7c938b23
19 changed files with 191 additions and 62 deletions

View File

@@ -99,11 +99,19 @@ private final class WatchSnapshotCoordinator: NSObject, WCSessionDelegate {
snapshot.resetBytes(in: 0..<snapshot.count)
transfer.snapshot.removeAll(keepingCapacity: false)
}
let payload: [String: Any] = [
Self.snapshotKey: snapshot,
Self.deliveredReceiptKey: Data(transfer.deliveredReceipt),
]
do {
try session.updateApplicationContext([
Self.snapshotKey: snapshot,
Self.deliveredReceiptKey: Data(transfer.deliveredReceipt),
])
try session.updateApplicationContext(payload)
if session.isReachable {
session.sendMessage(payload, replyHandler: nil) { _ in
session.transferUserInfo(payload)
}
} else {
session.transferUserInfo(payload)
}
} catch {
_ = try? authentication.failWatchSnapshot(
revision: transfer.revision,
@@ -5366,6 +5374,7 @@ private final class MobileEntryEditorViewController: UITableViewController,
title = page.creating ? "New \(page.title)" : "Edit \(page.title)"
navigationItem.largeTitleDisplayMode = .never
tableView.register(MobileEntryEditorCell.self, forCellReuseIdentifier: "EditorField")
tableView.keyboardDismissMode = .interactive
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 120
tableView.setEditing(true, animated: false)
@@ -5373,7 +5382,7 @@ private final class MobileEntryEditorViewController: UITableViewController,
systemItem: .cancel,
primaryAction: UIAction { [weak self] _ in self?.cancelRequested() }
)
navigationItem.rightBarButtonItem = UIBarButtonItem(
let save = UIBarButtonItem(
systemItem: .save,
primaryAction: UIAction { [weak self] _ in self?.saveRequested() }
)
@@ -5382,15 +5391,16 @@ private final class MobileEntryEditorViewController: UITableViewController,
primaryAction: UIAction { [weak self] _ in self?.addRequested() }
)
add.accessibilityLabel = "Add entry field"
navigationItem.rightBarButtonItems = [save, add]
let generate = UIBarButtonItem(
title: "Generate Password",
image: UIImage(systemName: "wand.and.stars"),
primaryAction: UIAction { [weak self] _ in self?.generateRequested() }
)
toolbarItems = [
add,
UIBarButtonItem(systemItem: .flexibleSpace),
generate,
UIBarButtonItem(systemItem: .flexibleSpace),
]
NotificationCenter.default.addObserver(
self,
@@ -5783,7 +5793,7 @@ private final class MobileEntryEditorViewController: UITableViewController,
}
@MainActor
private final class MobileEntryEditorCell: UITableViewCell, UITextViewDelegate {
private final class MobileEntryEditorCell: UITableViewCell, UITextFieldDelegate, UITextViewDelegate {
private let iconView = UIImageView()
private let labelView = UILabel()
private let nameField = UITextField()
@@ -5808,6 +5818,8 @@ private final class MobileEntryEditorCell: UITableViewCell, UITextViewDelegate {
field.font = .preferredFont(forTextStyle: .body)
field.adjustsFontForContentSizeCategory = true
field.clearButtonMode = .whileEditing
field.delegate = self
field.returnKeyType = .done
field.addTarget(self, action: #selector(textFieldChanged(_:)), for: .editingChanged)
}
nameField.placeholder = "Field Name"
@@ -5926,6 +5938,11 @@ private final class MobileEntryEditorCell: UITableViewCell, UITextViewDelegate {
changed?(currentName, currentValue)
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
func textViewDidChange(_ textView: UITextView) {
currentValue = textView.text
changed?(currentName, currentValue)

View File

@@ -172,6 +172,18 @@ private final class WatchSnapshotTransport: NSObject, ObservableObject, WCSessio
self?.receive(applicationContext, session: session)
}
}
nonisolated func session(_ session: WCSession, didReceiveMessage message: [String: Any]) {
Task { @MainActor [weak self] in
self?.receive(message, session: session)
}
}
nonisolated func session(_ session: WCSession, didReceiveUserInfo userInfo: [String: Any]) {
Task { @MainActor [weak self] in
self?.receive(userInfo, session: session)
}
}
}
private struct WatchRootView: View {