SwiftUI by Apple | Wrap-up: Layout and Style — Part 1

Tony Trejo
2 min readJul 11, 2024

--

Apple Journey | Layout and Style — Wrap-up: Layout and Style — Part 1

🚀 #6.1 I’m excited to continue sharing my insights into SwiftUI with all of you!
In this tutorial, we explore SwiftUI’s layout system, which has a few simple rules but can produce complex behavior. By combining stacks, spacers, and padding, you can create expressive interfaces🌟 .
🔗 Tutorial Link: Layout and Style Conclusion
https://developer.apple.com/tutorials/develop-in-swift/layout-and-style-conclusion

📝 Subtopics:
- Expanding ChatPrototype App functionality
- Enhancing WeatherForecast App functionality
- Creating a simple Book App

🔍 Key Insights:
- SF Symbols: If you’re wondering where to find SF Symbols, you can download them from the links below:
Download SF Symbols
https://developer.apple.com/sf-symbols
SF Symbols Documentation https://developer.apple.com/documentation/symbols

- Opacity and Brightness: To introduce variety to opacity and brightness, consider using random values:

private let opacity = CGFloat.random(in: 0.45…0.75)
private let brightness = CGFloat.random(in: -0.4…0.4)

- Strings and Multiline Strings: In this tutorial, you may need to create a book, requiring you to work with multiline strings or escape characters such as `\n` and `\”`. Learn more about strings in Swift from the Swift Documentation https://docs.swift.org/swift-book/documentation/the-swift-programming-language/stringsandcharacters

- Building a Book App: Creating the Book app was a lot of fun! I added images to the asset section (e.g., named `image1`) and used them in SwiftUI like this: `Image(“image1”)`. This was very satisfying.

- Playing with TabView: This tutorial helped me revisit the `TabView` and the `.tabViewStyle(.page)` modifier.
https://developer.apple.com/documentation/swiftui/tabview

- Laying Out Views: Another section called “Laying Out Views” offers more insights into arranging views effectively. Explore this resource here. https://developer.apple.com/tutorials/sample-apps/layingoutviews.

This tutorial provided a fantastic learning experience, enabling me to deepen my understanding of SwiftUI layout and style. Let’s keep challenging ourselves, learning from these experiences, and growing as developers! 🌟👩‍💻👨‍💻 #SwiftUI #DevelopInSwift #Xcode #AppDevelopment

--

--