|
|
|
|
|
by dep_b
2935 days ago
|
|
Yessssss for the allCases property for enums!!! Enums are really the best feature of Swift. I enum all the things everywhere. This is kind of the finishing touch to it. Binary stability would be nice. I do care about the download sizes of my apps. What's really missing from the language is a way to add custom tags like @discardableResult @objc to define some kind of property. It's such a kludge to set up things like ViewModels while I really would like to have something like: @twoWayBinding[username]
lazy var username: UILabel = { /* etc */ }()
|
|
You can have one way binding, you can have binding with a transformer function to go from a number to a string etc.
Here's a playground where I did this a while back. You get type safety and nice syntax too.
https://gist.github.com/desugaring/828e9880f747678ac5912a070...