Are you wondering how to get some information from one component to another in SwiftUI? Too many options to consider? This helpful post walks you through all the scenarios.
- From Parent to Direct Child – Use Initializer
- From Parent to Distant Child – Use Environment
- From Child to Direct Parent – Use Bindings and Callbacks
- From Child to Distant Parent – Use PreferenceKey
- Between Children – Lift the State Up
Via iOS Dev Weekly.