Full SwiftUI app at clients/apple/iOS/VoiceCatiOS.xcodeproj:
- 24 Swift source files: AppState + SessionState (@Observable @MainActor),
AudioSessionManager (AVAudioSession owner + interruption/route handling),
ServerListStore/SavedServer (App Group container + Keychain sharing),
and 14 SwiftUI views covering the full feature set
- NavigationSplitView on iPad, TabView on iPhone (horizontalSizeClass)
- Channel tree via OutlineGroup, user list with context menu admin actions
- PTT via DragGesture(minimumDistance: 0) + @GestureState
- onEvent closures hop to MainActor via Task { @MainActor in ... }
- App Group: group.cat.voice.VoiceCat (shared with future ReplayKit extension)
C ABI: add vc_audio_suspend / vc_audio_resume (AudioEngine::suspend/resume)
called by AudioSessionManager on AVAudioSession interruption events.
XCFramework: add ios-arm64 and ios-arm64-simulator slices to build-xcframework.sh;
Package.swift gains .iOS(.v17) platform; CMakePresets.json adds apple-ios /
apple-ios-sim presets with arm64-ios / arm64-ios-simulator vcpkg triplets.
Verified: xcodebuild -target VoiceCatiOS -sdk iphonesimulator26.5 BUILD SUCCEEDED.
50 lines
1.7 KiB
Swift
50 lines
1.7 KiB
Swift
import SwiftUI
|
|
|
|
struct ActivityLogView: View {
|
|
@Bindable var session: SessionState
|
|
|
|
private static let timeFormatter: DateFormatter = {
|
|
let fmt = DateFormatter()
|
|
fmt.dateStyle = .none
|
|
fmt.timeStyle = .medium
|
|
return fmt
|
|
}()
|
|
|
|
var body: some View {
|
|
ScrollViewReader { proxy in
|
|
List(session.activityLog) { entry in
|
|
HStack(alignment: .top, spacing: 8) {
|
|
Text(Self.timeFormatter.string(from: entry.timestamp))
|
|
.font(.caption2)
|
|
.foregroundStyle(.secondary)
|
|
.monospacedDigit()
|
|
.frame(width: 64, alignment: .leading)
|
|
Text(entry.text)
|
|
.font(.caption)
|
|
}
|
|
.id(entry.id)
|
|
.listRowSeparator(.hidden)
|
|
.accessibilityElement(children: .combine)
|
|
.accessibilityLabel("\(Self.timeFormatter.string(from: entry.timestamp)): \(entry.text)")
|
|
}
|
|
.listStyle(.plain)
|
|
.onChange(of: session.activityLog.count) { _, _ in
|
|
if let last = session.activityLog.last {
|
|
proxy.scrollTo(last.id, anchor: .bottom)
|
|
}
|
|
}
|
|
}
|
|
.navigationTitle("Activity")
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
.overlay {
|
|
if session.activityLog.isEmpty {
|
|
ContentUnavailableView(
|
|
"No Activity",
|
|
systemImage: "bell.slash",
|
|
description: Text("Events will appear here as they happen.")
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|