home.social

#stateobject — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #stateobject, aggregated by home.social.

fetched live
  1. #Swift #SwiftUI #Concurrency #StateObject #NotificationCenter

    Just ran into a question on how to implement NotificationCenter long-running listeners with modern AsyncSequence API, and have them torn down correctly. This seems to work.

    forums.swift.org/t/deinit-not-

  2. #Swift #SwiftUI #Concurrency #StateObject #NotificationCenter

    Just ran into a question on how to implement NotificationCenter long-running listeners with modern AsyncSequence API, and have them torn down correctly. This seems to work.

    forums.swift.org/t/deinit-not-

  3. #SwiftUI #StateObject

    Yesterday we got some important info about how to initialize a StateObject with external values. mastodon.social/@lucabernardi/

    Here’s a small exercise I did around that. All the behavior makes sense. You see all the ViewModels are only initialized once.

    It’s not clear to me why the documentation uses a closure in example code for “Initialize state objects using external data”. StateObject initializer wrappedValue is already an autoclosure.

  4. #SwiftUI #StateObject

    Yesterday we got some important info about how to initialize a StateObject with external values. mastodon.social/@lucabernardi/

    Here’s a small exercise I did around that. All the behavior makes sense. You see all the ViewModels are only initialized once.

    It’s not clear to me why the documentation uses a closure in example code for “Initialize state objects using external data”. StateObject initializer wrappedValue is already an autoclosure.