-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from Adventech/feature/fixes-widgets-iOS17
Fixes widgets iOS 17
- Loading branch information
Showing
8 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// ViewExtensions.swift | ||
// WidgetExtension | ||
// | ||
// Created by Emerson Carpes on 11/02/24. | ||
// Copyright © 2024 Adventech. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension View { | ||
func widgetBackground(_ backgroundView: some View) -> some View { | ||
if #available(iOSApplicationExtension 17.0, *) { | ||
return containerBackground(for: .widget) { | ||
backgroundView | ||
} | ||
} else { | ||
return background(backgroundView) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// WidgetConfigurationExtensions.swift | ||
// WidgetExtension | ||
// | ||
// Created by Emerson Carpes on 11/02/24. | ||
// Copyright © 2024 Adventech. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension WidgetConfiguration { | ||
func contentMarginsDisabledIfAvailable() -> some WidgetConfiguration { | ||
if #available(iOSApplicationExtension 17.0, *) { | ||
return self.contentMarginsDisabled() | ||
} | ||
else { | ||
return self | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters