I'm having the following code block:
struct StackOverflow: View {
var body: some View {
Text("Hello, World!")
.padding(.bottom,UIApplication.shared.windows.first?.safeAreaInsets.bottom ?? 15)
}
}
However, this returns the following error:
'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a relevant window scene instead
I tried to utilize UIWindowScene.windows but it's not working somehow. Any ideas how to translate this into the new syntax?
Depends on what you need, there's more about this here:
https://developer.apple.com/documentation/swiftui/text/padding(_:)-5wi61
https://www.hackingwithswift.com/quick-start/swiftui/how-to-inset-the-safe-area-with-custom-content
SwiftUI how to adjust different screen sizes
https://developer.apple.com/news/?id=nixcb564
https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/