Hey, everyone! I've just started learning SwiftUI. Moreover, I upgraded Xcode yesterday so now it is Xcode 12.
My problem:
I need to make a list and locate it in NavigationView. Everything is OK until I'm trying to add NavigationBarItems. When I add NavigationBarItems the extra grey-colored space around list appears. Probably it is because of Xcode 12. Help me, please.
My code:
My problem:
I need to make a list and locate it in NavigationView. Everything is OK until I'm trying to add NavigationBarItems. When I add NavigationBarItems the extra grey-colored space around list appears. Probably it is because of Xcode 12. Help me, please.
My code:
Code Block import SwiftUI struct ContentView: View { var body: some View { let f1 = Film(id: UUID(), title: "Harry Potter", type: "film") let f2 = Film(id: UUID(), title: "Who am I", type: "film") let f3 = Film(id: UUID(), title: "Scorpion", type: "series") let f4 = Film(id: UUID(), title: "Manifest", type: "series") let films = [f1, f2, f3, f4] NavigationView { List (films) { watch in Text(watch.title) } .navigationBarItems(trailing: EditButton()) } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } struct Film: Identifiable { var id: UUID var title: String var type: String }