Share Vault, persistence, SSH/SFTP, forwarding, and SwiftUI components across platforms. Add mobile editors, terminal input, standalone Assistant, Metrics navigation, transfers, and a unified Live Activity with host system icons. Validation: 35 iOS tests and 100 focused macOS tests pass; formatting and zh-Hans checks pass. The full macOS run reports 14 issues in the documented timing, Keychain, and popover suites. Remaining Assistant tool and CloudKit work is tracked in Memory/MOBILE_ROLLOUT.md.
23 lines
639 B
Swift
23 lines
639 B
Swift
import Foundation
|
|
|
|
extension DispatchQueue {
|
|
func perform<T: Sendable>(
|
|
_ operation: @escaping @Sendable () throws -> T
|
|
) async throws -> T {
|
|
try await withCheckedThrowingContinuation { continuation in
|
|
async {
|
|
do { continuation.resume(returning: try operation()) } catch { continuation.resume(throwing: error) }
|
|
}
|
|
}
|
|
}
|
|
|
|
func perform(_ operation: @escaping @Sendable () -> Void) async {
|
|
await withCheckedContinuation { continuation in
|
|
async {
|
|
operation()
|
|
continuation.resume()
|
|
}
|
|
}
|
|
}
|
|
}
|