parent
31618c9f7d
commit
3e69ef40f1
@ -0,0 +1,38 @@ |
||||
// |
||||
// 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() |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
struct DefaultView_Previews: PreviewProvider { |
||||
static var previews: some View { |
||||
DefaultView().previewContext(WidgetPreviewContext(family: .systemSmall)) |
||||
} |
||||
} |
||||
Loading…
Reference in new issue