SwiftUI’s Grid Views
SwiftUI's grid views arrange their child views in a horizontal or vertical grid. However, how they layout their child views can be surprising, and in this post, Florian Kugler from Objc.io examines three particular grid view layout scenarios and explains how the layout algorithm works.
Posted on December 1, 2020
#swiftui
#layout
SwiftUI View Lifecycle
When working with UI frameworks, it's helpful to understand the lifecycle of the views which make up our interface. Knowing what and when events will occur enables us to perform our actions at the right time. In this post, Vadim Bulavin explores the three phases of the SwiftUI view lifecycle, describing the series of events that happen from the creation of a view to its destruction.
Posted on November 25, 2020
#swiftui
#lifecycle
How an Hstack Lays out Its Children
As Chris Eidhof states in the introduction to this post, SwiftUI's layout system is, for the most part, intuitive to use. However, there are times when we encounter puzzling layout behaviors, and here Chris provides a detailed explanation of how one particular container view, an HStack, lays out its child views.
Posted on November 23, 2020
#swiftui
#layout
Debugging SwiftUI: Trials and Tribulations
Working with relatively new frameworks such as SwiftUI means sometimes dealing with subpar debugging tools and seemingly unsolvable bugs. In this post, Reda Lemeden describes the frustration and anxiety he experienced when trying to resolve an issue without much help from the Swift compiler.
Posted on November 15, 2020
#swiftui
#debugging
Hashable SwiftUI bindings
A SwiftUI DisclosureGroup is a view that shows or hides content based on the state of a disclosure control. In this post, Federico Zanetello shows us how to extend DisclosureGroup with a new initializer to provide a similar API to that of the NavigationLink type.
Posted on October 30, 2020
#swiftui
Mastering GroupBox in SwiftUI
A Groupbox is a stylized SwiftUI view with an optional label that is associated with a logical grouping of content. In this post, Majid Jabrayilov runs through the basics of using this view type and shows us how we can apply custom styles.
Posted on October 23, 2020
#swiftui
Mastering transitions in SwiftUI
In this post, Pavel Zak shows us how to implement custom animation transitions in SwiftUI. As Pavel says, transitions play a vital role in the user experience of an app, and the examples he provides are great starting points for implementing our own transitions.
Posted on October 21, 2020
#swiftui
#animation
#transition
Transactions in SwiftUI
SwiftUI's Transaction type provides the context of the current state-processing update. In this post, Majid Jabrayilov shows us how we can use the transaction that accompanies every state change to override state-related view animations.
Posted on October 16, 2020
#swiftui
#animation
UIKit or SwiftUI: what to use in production?
How ready is SwiftUI for use in large production apps? In this post, Alexey Naumov considers this question and shows us how to structure a project with a UI layer that can be easily detached and replaced.
Posted on October 13, 2020
#swiftui
#uikit
Importing interactive UIKit views into SwiftUI
One of SwiftUI's strengths is that it works with existing Apple UI frameworks such as UIKit. This enables us to reuse our existing UIKit components when introducing SwiftUI into a project. In this post, John Sundell shows us how to bring a UIKit-based view into a SwiftUI view hierarchy.
Posted on October 12, 2020
#swiftui
#uikit