Huge news for anyone working in tech in the US.
Noncompetes are now banned: not just in California (like before), but nationwide. Very, very relevant for anyone at Amazon (which is the Big Tech that has enforced noncompetes even for low-level engineering positions).
Swift 5.9 is now available! This is a major new release that introduces macros to Swift, adds bi-directional interoperability with C++, and more. Read the blog post to see what's new. https://t.co/JAklmUEylH
#iosdev#swift#SwiftUI#xcode
✍️ Hey iOS devs, I just published an article about the SwiftUI environment lifecycle.
❓Is it possible for it to be retained in memory? When does it happen?
https://t.co/bK144WrbKB
@mitt_rafael If it's a published property, any changes to it would be emitted by its underlying publisher.
You get access to an environmentObject using the @environmentObject wrapper:
@environmentObject
var someEnvObj: SomeType
Changes to this object will all be observed by SwiftUI.
@mitt_rafael An envObject might be used in all subviews, and changes to it might be still observed in different points:
RootView (contains envObj)
All subviews will have access to envObj
All subviews might redraw when envObj changes
@mitt_rafael It depends on what property is being published.
If you wish to manually observe events, you use the projected value: $somePublishedProperty.sink {}
If no published properties are exposed, you can use:
envObj.objectWillChange.sink {}
https://t.co/JaA3cQvsvf