Merge pull request #2249 from stuartbreckenridge/feature/widget

Widget Work in Progress
This commit is contained in:
Maurice Parker
2020-07-11 09:36:50 -05:00
committed by GitHub
15 changed files with 933 additions and 11 deletions

View File

@@ -17,6 +17,7 @@ struct SceneNavigationView: View {
#if os(iOS)
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
@Environment(\.scenePhase) private var scenePhase
#endif
var body: some View {
@@ -64,6 +65,13 @@ struct SceneNavigationView: View {
.onChange(of: sheetToShow) { value in
value != .none ? (showSheet = true) : (showSheet = false)
}
.onChange(of: scenePhase) { newPhase in
if newPhase == .background {
#if os(iOS)
WidgetDataEncoder.encodeWidgetData()
#endif
}
}
.toolbar {
#if os(macOS)