RSSAmplifier

Shadowfacts · Nov 30, 2024

Your View's Lifetime Is Not Yours

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

When SwiftUI was announced in 2019 (oh boy, more than 5 years ago), one of the big things that the Apple engineers emphasized was that a SwiftUI View is not like a UIKit/AppKit view. As Apple was at pains to note, SwiftUI may evaluate the body property of a View arbitrarily often. It’s easy to miss an important consequence this has, though: your View will also be initialized arbitrarily often.…

Read on shadowfacts.net

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.