SwiftUI Weekly - Issue #113
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
Conditional layouts in SwiftUI
From the first day of the SwiftUI framework, we have primary layout containers like VStack, HStack, and ZStack. The current iteration of the SwiftUI framework brings another layout container allowing us to place views in a grid. But the most important addition was the Layout protocol that all layout containers conform to. It also allows us to build our super-custom layout containers from scratch. This week we will learn the basics of the Layout protocol in SwiftUI and how to build conditional layouts using AnyLayout type.
Mastering grid layout in SwiftUI
You might be familiar with the LazyVGrid and LazyHGrid views we have from the second iteration of the SwiftUI framework. They work great for the massive data arrays you want to display as the grid. But it is not always possible to arrange the columns and rows strictly because of their lazy nature.
Adjust the direction of focus-based navigation in SwiftUI
We can customize how the user navigates through focusable views in our macOS apps with the help of the new focusSection() modifier.
Responsive layout in SwiftUI with ViewThatFit
Making SwiftUI views responsive usually involves a lot of GeometryReaders and if-else. In iOS 16, SwiftUI got a new view that makes it easier. Let's learn how to do it.
Customize a line chart with SwiftUI Charts in iOS 16
How to customize a line chart with SwiftUI Charts in iOS 16.
@ViewBuilder usage explained with code examples
The @ViewBuilder attribute allows you to create compact code and improve readability. SwiftUI forces you already to use the result builder.
Using CoordinateSpace to draw over a SwiftUI List
How to accurately position a View over a ScrollView or List, using CoordinateSpaces.
SwiftUI Button Tutorial: Customization
Learn how to easily customize your app buttons style with the minimum effort by leveraging the latest SwiftUI button modifiers.
Video
BottomSheets and PresentationDetents in SwiftUI
In this video, I am going to introduce you to the new bottom sheet presentationDetents modifier that was introduced in iOS 16. This will gives us the ability to control the height of our modal sheets.