Type Safely

Type Safely

Calling a RefreshAction From Custom Views That Can't Use .refreshable

Daily Coding Tip 126

Millie Sturgeon's avatar
Millie Sturgeon
Jul 07, 2022
∙ Paid
Image by Kevin Schmid from Pixabay

Tested on Xcode Version 14.0 beta 2 (14A5229c).

There’s a .refreshable modifier that I can call on a List, but I can’t use it everywhere.

An environment variable is available to views that don’t have access to it, and it looks like this:

@Environment(\.refresh) var refreshAction: RefreshAction?

Here’s a simple Button that …

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture