Swift Notes on Navigation and Other Protocols

Posted:   March 03, 2021

Status:   Completed

Tags :   Swift SwiftUI protocols

Categories :   technical

Were equations, pictures or diagrams not properly rendered, please refresh the page. If the problem persists, you can contact me.

You cannot put two alerts with isPresented in the same View.

@StateObject conforms to @ObservableObject protocol automatically. You could either pass the state object into a property with ObservedObject attribute or alternatively add using the .environmentObject(:_) modifier.

When separating the leading and trailing items in the NavigationBarItems, use commas.

The place of the .environment matters because you need to include whatever you send it to, otherwise it wouldn’t know what to modify.

Comments


Be the first one to comment on this page!
You can use extended GitHub flavored markdown in your comment. Commenting FAQs & Guidelines