News for hackers. Stuff that matters.
Re:SwiftUI in 2022 by emehex on Wednesday May 25, 2022 @11:41AM (#31506119)
Took me 5 minutes. Copy and paste this into a playground: https://gist.github.com/maxhumber/1dbdf0d9c4539a8e145b3c630c...
Re:SwiftUI in 2022 by alexashka on Wednesday May 25, 2022 @11:53AM (#31506307)
Your answer is wrong. You've failed the fizzbuzz :)

Change frame (screen width) to 300, 500 to see why.

Re:SwiftUI in 2022 by emehex on Wednesday May 25, 2022 @01:12PM (#31507421)
Good catch. Fixed with an extra ZStack.
Re:SwiftUI in 2022 by alexashka on Wednesday May 25, 2022 @04:48PM (#31510336)
GeometryReader was not part of fizzbuzz. Replace geo.size.width * 0.1 with 10 to see your code break.

Now tell me, why did it break? Do you even know? Because I don't.

I don't know why half the shit works as it does, and I've written non-trivial SwiftUI code for 6 months. I did not have this problem with UIKit and interface builder.

Re:SwiftUI in 2022 by emehex on Wednesday May 25, 2022 @05:03PM (#31510524)
GeometryReader is a pretty critical part of the SwiftUI framework. I'd recommend getting familiar with it!

Saying "you can't use GeometryReader" would be like saying you can't use UIKit's Auto Layout...

Re:SwiftUI in 2022 by b3morales on Wednesday May 25, 2022 @12:05PM (#31506486)
Now please see how it looks on a device: https://postimg.cc/crtKHSTG