Play With SwiftUI Views and Closure Variables

You can pass info to a View’s children like a provider

Mary Paskhaver
Level Up Coding
Published in
7 min readMay 9, 2024

--

An electrical tower on a grass field.
Photo by Thomas Despeyroux on Unsplash.

Providers, wrappers… we’ve heard the terms. I decided to have some fun and try to make them in SwiftUI.

What was my motivation? Well, I was intrigued by how GeometryReader gives its children a closure variable. Every other View I used in my projects is made by putting…

--

--

Student and mobile app developer. Follow me for tips on tech, work, and more.