Building a menu using List - a free SwiftUI by Example tutorial
We’re going to start simple, and work our way up. Along the way you’ll start to see some of the things that SwiftUI makes easy, and some of the things that are a bit harder. In ContentView.swift is a basic struct representing the only screen in our app: ContentView. It looks like this: That isn’t much code, but it already tells us a lot: You should also see a preview pane on the right of Xcode. This updates as you type, which makes it a great way to see your changes as you work. If you don’t see the preview pane on the right, go to the Editor menu and choose Canvas. In the event that Xcode’s preview area stops – which will happen quite often – you can press Opt-Cmd-P to make it resume showing your layouts. This is really important so I’m repeating it: pressing Opt-Cmd-P will make your SwiftUI preview update. In our app this screen will show us a list of items from a menu, so we’re going to use a List view instead of Xcode’s default template code. So, replace the current text view with
Building a menu using List - a free SwiftUI by Example tutorial WWDC26: Save 50% on my books and bundles! >> < SwiftUI tutorial: Building a complete project Composing views to create a list row > Building a menu using List Paul Hudson @twostraws June 16th 2023 Updated for Xcode 16.4 We’re going to start simple, and work our way up. Along the way you’ll start to see some of the things that SwiftUI makes easy, and some of the things that are a bit harder. In ContentView.swift is a basic struct representing the only screen in our app: ContentView . It looks like this: struct ContentView: View { v
Explore this link on the map →saved by
related reading
- SwiftUI by Example - free quick start tutorials for Swift developershackingwithswift.com
- Composing views to create a list row - a free SwiftUI by Example tutorialhackingwithswift.com
- Displaying a detail screen with NavigationLink - a free SwiftUI by Example tutorialhackingwithswift.com
- Polishing designs with fonts and colors - a free SwiftUI by Example tutorialhackingwithswift.com
- Structural identity in SwiftUI | Swift with Majidswiftwithmajid.com
- Using stacks to arrange views | Apple Developer Documentationdeveloper.apple.com
- What’s in the basic template? - a free SwiftUI by Example tutorialhackingwithswift.com
- A Day in the Life of a SwiftUI View — Chris Eidhofchris.eidhof.nl
- Learn Swift 4 - Learn Swift - Design+Codedesigncode.io
- What is SwiftUI? - a free SwiftUI by Example tutorialhackingwithswift.com
- Behind the scenes of UI: Part 2 - SwiftUIvbat.dev
- Frequently asked questions about SwiftUI - a free SwiftUI by Example tutorialhackingwithswift.com