- Initialize iOS project with 6-tab navigation structure - Configure custom Light/Dark themes and AppColors - Define SwiftData models for Tasks, Tags, Goals, and TrackingRecords - Setup relationships (Super/Sub tags) and cascade delete rules - Implement Observable TrackingEngine for real-time timer updates
40 lines
945 B
Swift
40 lines
945 B
Swift
import SwiftUI
|
||
|
||
// MARK: – ThemeMode → ColorScheme
|
||
|
||
extension ThemeMode {
|
||
var colorScheme: ColorScheme? {
|
||
switch self {
|
||
case .system: return nil
|
||
case .light: return .light
|
||
case .dark: return .dark
|
||
}
|
||
}
|
||
}
|
||
|
||
// MARK: – Shared reusable views
|
||
|
||
struct EmptyStateView: View {
|
||
let icon: String
|
||
let message: String
|
||
|
||
var body: some View {
|
||
VStack(spacing: 16) {
|
||
Image(systemName: icon)
|
||
.font(.system(size: 48))
|
||
.foregroundStyle(Color.tfMuted)
|
||
Text(message)
|
||
.font(.subheadline)
|
||
.foregroundStyle(Color.tfMuted)
|
||
.multilineTextAlignment(.center)
|
||
}
|
||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||
.padding()
|
||
}
|
||
}
|
||
|
||
#Preview("EmptyStateView") {
|
||
EmptyStateView(icon: "tag", message: "태그가 없습니다")
|
||
.background(Color.tfBackground)
|
||
}
|