Post

Replies

Boosts

Views

Activity

Reply to SwiftUI: WidgetKit Gradient Bug
This is a weird bug in Xcode 12 on the simulator. The good news is all looks normal on device, so you may need to do your testing there. In my case, if I load the app in the simulator on my MacBook Pro 15" internal retina display the gradients are rendered fine, but if I use my external display they look like what you're showing. I've heard that's not the case for everyone though, but it's definitely an Xcode bug either way.
Oct ’20
Reply to DarkMode in TimelineProvider
You can't, and you shouldn't - because the user could change their appearance from light to dark in the middle of a timeline event and your widget wouldn't update then. I think the best solution here would be to snapshot both cases, one for light and one for dark, and the select and display the correct one in your SwiftUI view depending on the state then. You can get that by adding: @Environment(\.colorScheme) private var colorScheme: ColorScheme In your SwiftUI file and switching on the colorScheme value.
Oct ’20
Reply to IntentTimelineProvider does not appear to be used
I had this problem on the simulator and on device as well using the current normal version of iOS 14 and Xcode 12. I was able to fix it on the simulator by doing an erase all content and settings and reinstalling. It seems like maybe because there were existing timeline entries that were tied to a different Intent as I was working on this, the widget refused to keep going. Deleting and reinstalling cleared those out and all is well now. That's just my theory though, either way it worked for me.
Sep ’20