SwiftUI Notes

I will add a bunch of little notes as I read all the tutorials in the internet. (Yep, ALL the tutorials in the internet)

Ignoring Safe Area

Apparently ignoresSafeArea and edgesIgnoringSafeAreaboth do the same.
let colors = [Color.init(red: 0.1, green: 0.1, blue: 0.6), Color.blue]
LinearGradient(gradient: Gradient(colors: colors), startPoint: .topLeading, endPoint: .bottomTrailing)

// This is the preferred way: `@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)`
.ignoresSafeArea(SafeAreaRegions.all, edges: [Edge.Set.top, .bottom])

// Header says deprecated: `@available(iOS, introduced: 13.0, deprecated: 100000.0, message: "Use ignoresSafeArea(_:edges:) instead.")`
.edgesIgnoringSafeArea(Edge.Set.all)

0 comments :

This work is licensed under BSD Zero Clause License | nacho4d ®