News for hackers. Stuff that matters.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by sophiebits on Saturday May 16, 2020 @02:01AM (#23200845)
Curious to hear more about what SwiftUI does better than React… any place I can read more?
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by Diesel555 on Monday May 25, 2020 @11:53PM (#23307260)
Sorry for the late reply.

You can change state without all the annoying purely functional programming stuff ([... previousState, newValue]). Just change it.

You can change a prop passed in and even pass a new value up to the parent. So you know the pass a function down so the child can change a value in the parent? Just pass the variable you want changed down with @binding.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by doteka on Saturday May 16, 2020 @06:06AM (#23202137)
The official Apple tutorial gives you an idea what they were going for, but in practice it’s nowhere near that smooth.

In fact, most of the time I found myself staring at a “type too complex, add annotation” error. That one doesn’t actually mean your type is too complex, it just means you’re passing the wrong thing somewhere and instead of a useful error message the compiler just gave up and broke.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by kitsunesoba on Saturday May 16, 2020 @12:14PM (#23204678)
Errors in SwiftUI are significantly better in the recently released Swift 5.2, so this is clearly something they’re working on.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by doteka on Saturday May 16, 2020 @02:16PM (#23205814)
I certainly hope so, because this was definitely on Swift 5.2 . In general if you come in expecting a dev experience anywhere close to writing React in Typescript using VSCode, SwiftUI and Xcode both are a bit of a disappointment - it's slow, it's glitchy, autocomplete kind of sucks, never mind tooling like Prettier which I take for granted now.