Filters

Hide filters
Platform
Content Type
Difficulty

All Tutorials · Video Course · 19 Results

Contained in: SwiftUI: Layout & Interfaces Video Course
iOS & Swift
SwiftUI: Layout & Interfaces
Learn the fundamentals of layout in SwiftUI. Lazy Stacks andGrids, Scroll View Readers, Alignment, ZStacks, and GeometryReaders are the main topics.
iOS & Swift

Introduction

Learn the fundamentals of layout in SwiftUI! In this first part of the course, you’ll be working with scroll views, and lazy views: both stacks, and grids.
iOS & Swift

Lazy Stacks

The first of SwiftUI’s “lazy” views that we’ll be going over are the Stacks. LazyVStacks and LazyHStacks are typically used within ScrollViews.
iOS & Swift

ScrollViewReader

To avoid spending a lot of time scrolling to a child of a massive scroll view, use a ScrollViewReader. Its proxy allows control over scroll position.
iOS & Swift

Challenge: Nested Scrolling Stacks

Replicate a layout for first scrolling vertically, and then, horizontally, in order to navigate categories and subcategories.
iOS & Swift

Grids

SwiftUI offers two types of grids: LazyHStacks, which expand horizontally, and LazyVStacks, which expand vertically. Grids only come in lazy variants.
iOS & Swift

PinnedScrollableViews

SwiftUI’s Section View is used for adding headers and footers to views. You have the option of pinning headers and footers to your views.
iOS & Swift

Challenge: Grids with Pinned Views

Create a colorful, vertically-scrolling grid-based layout, which resembles the “Search” view from Apple Music.
iOS & Swift

Conclusion

Lazy views have made it practical to use SwiftUI for much larger data sets than before. So go fill up those views with giant collections!
iOS & Swift

Introduction

To finish off, you’ll learn about Alignment, ZStacks, and Geometry Readers. All of these were introduced with the first version of SwiftUI, and work in iOS 13.
iOS & Swift

Stack Alignment

Stack alignment occurs perpendicularly to the primary axis of a Stack: use VerticalAlignment for HStacks, and HorizontalAlignment for VStacks.
iOS & Swift

Challenge: Align Nested Stacks

Recreate a section of the profile layout from the Tweetbot Twitter client using Text and Image Views in nested Stacks.
iOS & Swift

Alignment Guides

Stacks use Alignment Guides to match up each of their children based on a point along their perpendicular axis. If the defaults don’t cut it, supply your own!
iOS & Swift

Custom Alignment

When you want to line up guides of particular views, but those views are inside of different stacks, custom alignments are the simplest solution.
iOS & Swift

Challenge: Custom Alignment Guides

Use custom alignment guides to line up specific points of interest in images with guide points of text views. 👀
iOS & Swift

ZStacks

Now that you’ve mastered the first two dimensions, it’s time to tackle the third! ZStacks have much in common with the HStacks and VStacks you know and love.
iOS & Swift

GeometryReader

GeometryReader is a container view that doesn’t perform stacking. Instead, its children incorporate information about it by way of the GeometryProxy structure.
iOS & Swift

Challenge: 3-Axis Layout

In this final layout challenge, implement a badge layout that will require thinking in all three axes.
iOS & Swift

Conclusion

Get some recommendations on where to go for more SwiftUI layout learning. Next up in the iOS User Interfaces with SwiftUI learning path is SwiftUI: Animation.