Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
struct JokesWidgetEntryView : View {
var entry: JokeProvider.Entry
@Environment(\.widgetFamily) var family
@ViewBuilder
var body: some View {
switch family {
case .systemSmall:
Text(entry.joke)
.minimumScaleFactor(0.3)
.padding(.all, 5)
default:
VStack{
Text("Chuck Norris Cracks:")
.font(.system(.headline, design: .rounded))
.padding()
Text(entry.joke)
.minimumScaleFactor(0.3)
.padding(.all, 5)
}
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
.background(Color.pink)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment