Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Pass Functions as Closure Parameters To SwiftUI Views

Pass Functions as Closure Parameters To SwiftUI Views

Daily Coding Tip 029

Type Safely's avatar
Type Safely
Jan 16, 2021
∙ Paid

Share this post

Type Safely
Type Safely
Pass Functions as Closure Parameters To SwiftUI Views
Share
Image by bhupp from Pixabay

You don’t always have to share an EnvironmentObject between SwiftUI views in order to give them access to the same methods. In fact you really shouldn’t do this in most cases, because most subviews should have very few responsibilities. It will help your debugging if you reduce the amount of data that each view can modify. If …

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share