You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iOS 17 has a new Stand by mode so SwiftUI introduces containerBackground for the system to decide when to draw background. It also automatically applies margin to widget so we may need to disable that
To update existing widgets, we can write some useful extension
extensionView{@ViewBuilderfunc safeContainerBackground(@ViewBuilder content:()->someView)->someView{
if #available(iOS 17.0,*){self.containerBackground(for:.widget, content: content)}else{self.background(content())}}}extensionWidgetConfiguration{func safeContentMarginsDisabled()->someWidgetConfiguration{
if #available(iOS 15.0,*){returncontentMarginsDisabled()}else{returnself}}}
iOS 17 has a new Stand by mode so SwiftUI introduces
containerBackground
for the system to decide when to draw background. It also automatically applies margin to widget so we may need to disable thatTo update existing widgets, we can write some useful extension
So in our
Widget
configuration, we can useThe text was updated successfully, but these errors were encountered: