Here is how my widget looks like:
and this is how it looks in code:
struct WidgetTimerEntryView : View {
var entry: WidgetTimerEntry
var backgroundColor: Color {
return Color(Options.shared.currentMode.underlayBackgroundColor)
}
var body: some View {
VStack(alignment: .center, spacing: 5) {
Image(Options.shared.timerIsPaused ? "icon-play" : "icon-paused")
.scaledToFit()
.frame(width: 30.0, height: 30.0)
.cornerRadius(15)
.clipped()
}
.padding(.all, 10)
.background(backgroundColor)
}
}
Now I need the following things:
- Why my corner radius doesn't work?
- How to attach the tap event to Image without opening parent application?
- How to update my View?