State Object

7 posts

State Object

State Object

@StateObject

A property wrapper type that instantiates an observable object.

加入时间 Haziran 2020
47 关注53 粉丝
Adam Bell
Adam Bell@b3ll·
I felt crafty yesterday and made this Binding extension that optionally supports an animation if a given closure (with arguments oldValue, newValue) returns true So you can do stuff like animate if a value is increasing, but not if decreasing, or whatever
Adam Bell tweet media
English
2
0
25
0
Rony
Rony@ronyfadel·
I imagine updating a binding from a view model is wrong, because its view doesn't update. What's the right way though? I ended up with a @Published ivar that updates the binding in `didSet`
Rony tweet media
English
3
0
1
0
State Object
State Object@StateObject·
That moment when you're doing a twitter shtick with but @ObservedObject did it better last year—and @EnvironmentObject is forever out of reach because Twitter caps handles at 15 chars. 😭
English
1
0
8
0