@grishka There's lots I take issue with in SwiftUI, but none of that intersects with that post https://twitter.com/harshil/status/1220957638101323778
Top-level
@grishka There's lots I take issue with in SwiftUI, but none of that intersects with that post https://twitter.com/harshil/status/1220957638101323778 9 comments
@grishka If you compare SwiftUI just to AppKit or UIKit, sure, I can see your point. But it's whole deal is it needs to be compared to both. Smart defaults things like spacing, appearance, etc. is table stakes for a cross platform technology @harshil @grishka I think some of the defaults are quite reasonable, I just wish it weren't treated as magic. `Text(“Hello”).padding()` applies system-determined mystery padding. And you can't just query how much padding was applied. The default stack spacing for a stack containing two shapes is different than stack containing two text labels. I just wish I had access to that so I can make adjustments rather than either forgoing the smart defaults entirely or doing geometry reading nonsense @samhenrigold @grishka Agreed, I want there to be more info, and more customisation! I was mad about one of these just yesterday too: https://mastodon.social/@harshil/112585977671011003 @samhenrigold @harshil @grishka Some of this spacing information is available inside the Layout protocol but I agree it's still not convenient for most cases. I don't think there's any way to get the default padding amount. https://developer.apple.com/documentation/swiftui/viewspacing @grishka Ehh, I disagree there. Heck the iPad invalidates the whole argument by itself. Touch, trackpads, pencils for input, and windows as small as an iPhone SE and as large as a Mac with an external display. Do you want to develop for it with 4 separate frameworks? Harshil, the iPad doesn't invalidate it, it's basically just a large iPhone. The touchscreen is the default mode of interaction for 99% of how people use iPads. UIKit, Apple's touch-focused framework, is its native UI framework (that SwiftUI is built on top of). Apple's continued insistence on blurring the lines between UIKit (touch) and AppKit (keyboard + mouse/trackpad) really rubs me the wrong way. Steve Jobs would've never approved of any of that. @grishka If you're gonna invoke a man who’s been dead for a decade to argue against a product decision that has been in place for half of the iPad's existence, I'm not sure what we're doing here |
Harshil, as someone who hates declarative approach to building UIs in general, this doesn't help. All this implicit behavior is still a lot to keep in mind at any given moment compared to the explicit nature of UIKit/AppKit.