Update widget, iOS 17 + backwards compatibility
This commit is contained in:
parent
9f9f4c6409
commit
e33e3402fc
@ -2,6 +2,8 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
|
@ -57,7 +57,7 @@ struct Toki_Trainer_WidgetsEntryView : View {
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
Color("LightPurple")
|
||||
//Color("LightPurple")
|
||||
VStack(alignment: .leading) {
|
||||
Text(entry.word)
|
||||
.foregroundColor(Color("FontColorTitle"))
|
||||
@ -70,6 +70,20 @@ struct Toki_Trainer_WidgetsEntryView : View {
|
||||
.padding(8)
|
||||
}
|
||||
}
|
||||
.widgetBackground(backgroundView: Color("LightPurple"))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension View {
|
||||
func widgetBackground(backgroundView: some View) -> some View {
|
||||
if #available(iOSApplicationExtension 17.0, *) {
|
||||
return containerBackground(for: .widget) {
|
||||
Color("LightPurple")
|
||||
}
|
||||
} else {
|
||||
return background(Color("LightPurple"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user