You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LeCountdown/LaunchWidget/DefaultView.swift

40 lines
954 B

//
// DefaultView.swift
// LeCountdown
//
// Created by Laurent Morvillier on 17/02/2023.
//
import SwiftUI
import WidgetKit
struct DefaultView: View {
@Environment(\.widgetFamily) var family: WidgetFamily
var body: some View {
switch family {
case .accessoryCorner, .accessoryCircular, .accessoryRectangular, .accessoryInline:
VStack {
Text("Configure me!").monospaced()
}
default:
VStack {
Text("Configure me!\n")
Text("Tea".uppercased()).monospaced()
Text("4:00").monospaced()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(GradientView())
}
}
}
struct DefaultView_Previews: PreviewProvider {
static var previews: some View {
DefaultView().previewContext(WidgetPreviewContext(family: .systemSmall))
}
}