3 ms·
- Bugs. There’s so many weird bugs in SwiftUI, and the framework is so opaque and poorly-documented that it takes hours of trial and error to find an ugly worka
by NobodyNada 7y ago
- Bugs. There’s so many weird bugs in SwiftUI, and the framework is so opaque and poorly-documented that it takes hours of trial and error to find an ugly workaround.
That being said, hopefully these issues will get better with time. Swift 5.2 includes a new diagnostics architecture [0] that is supposed to greatly improve SwiftUI error messages. The 10-subviews limitation will be removed once we have variadic generics; a Swift Evolution proposal is currently being drafted [1] and is expected to land in Swift 6.
[0]: https://swift.org/blog/new-diagnostic-arch-overview/ https://swift.org/blog/new-diagnostic-arch-overview/
[1]: https://github.com/technicated/swift-evolution/blob/variadic-generics/proposals/XXXX-variadic-generics.md https://github.com/technicated/swift-evolution/blob/variadic...
- tayistay 7y agoHow could I forget the bugs? We've failed at doing some simple things (like tooltips on styled buttons on macOS). An Apple engineer [0] said the nested generics were used for SwiftUI because it makes diffing view hierarchies easy and makes identities stable, eliminating a class of bugs caused by changing view hierarchies during interactions or animations. But does potential dynamism actually cause problems in practice? (I haven't used other reactive UI toolkits.) It seems to me that most of the pain in using SwiftUI stems from the heavy reliance on generics. Hopefully it's worth it. [0]: https://forums.swift.org/t/why-is-swiftuis-view-a-pat/28029/13 https://forums.swift.org/t/why-is-swiftuis-view-a-pat/28029/...