Sizing Things Equally in SwiftUI

Episode #439 | 9 minutes | published on May 15, 2020 | Uses Xcode-11.4, Swift-5.2
Subscribers Only
Using Preferences we can communicate data, such as the actual size of a view, to any ancestor view. By taking advantage of the reduce function required by the PreferenceKey protocol, we can combine multiple values in whatever way suits our needs. In this episode we will use this technique to size a bunch of sibling views equally by collecting the biggest width and then pushing this value down to subviews with some parent state.

Nothing yet...

blog comments powered by Disqus