Live data from Hacker News

SwiftUI in 2022

mjtsai.com

151–160 of 216 posts

Re: SwiftUI in 2022

#151

Context: I’ve been working with iOS full time since a few years before Swift came out. A few startups ago we built our app using SwiftUI 1.0. At that time, while 90% of it was fantastic, 10% was either unworkable or extremely unreliable, causing for some maddening bugs. The documentation was laughable so for these reasons I chose to do the app for a subsequent startup in UIKit. Fast forward to my most recent company;…

Do you mind explaining exactly what animations would take that much work? I’m struggling to see how animations could ever take as long as estimated for UIKit

The parent said “animated flows” and mentioned a banking app, so I’m betting a multi-page form with lots of transitions between a lot of different state combinations.

Again, just guessing, but I would imagine that it’s managing that state and animating it in a sane way which requires LOTS of code, less so the animations themselves.

Re: SwiftUI in 2022

#152
If your devs say they are faster with SwiftUI, your app is probably dumber than you are willing to accept.

I have been writing ObjC, Swift for 7 good years. Me or my team will never write anything important in SwiftUI until Apple starts to adopt it non trivially. Blogs, Twitter threads != production code. Teams hate workaround driven development.

Re: SwiftUI in 2022

#153
I just delivered a medium complexity CRUD driven module using SwiftUI for a very large application.

Worked perfect for me, besides issues around navigation, especially showing alerts. Would use SwiftUI screens using UIKit navigation next time.

Also more complex scenarios that sing combine can get a bit more hairy. The most important issue is that all changes are emitted at didSet so the new value is not known anywhere outside of the closure.

Re: SwiftUI in 2022

#154

Earlier quoted context omitted.

> What's the equivalent with UIKit? UIStackView > I was having fun making real layouts my first hour in Good. Now take a pixel-perfect mockup of a new screen from your designer at work and implement that.

> Good. Now take a pixel-perfect mockup of a new screen from your designer at work and implement that. I'm also a designer and have built many detailed screens with custom components/interactions in SwiftUI.

I have been watching your progress on Stocketa and as an experienced iOS engineer who uses SwiftUI at work, I have been amazed by the speed with which you were able to build the app. The fact that you were able to ship a real app (with custom graph and polished animations) really speaks to how accessible SwiftUI is to new developers compared to UIKit.

I work for mid size company with a fairly big app with millions of users and we did a complete re-write of the app in SwiftUI and I can say with confidence that once a SwiftUI view layer is built out, building features on top of that is incredibly fast compared to UIKit.

Re: SwiftUI in 2022

#155

If you like SwiftUI, I challenge you to a SwiftUI fizzbuzz: a square, screen width, 10x padding, red background. inside it, a little square, centered and a little square, top left corner, 10px padding, blue background for both. Tell me that was easy, so that I know you're lying :)

How's this? It's not quite "screen width" if you make the screen wider than it is tall, but I could make it stick to that if you really want I guess.

  struct ContentView: View {
      var body: some View {
          ZStack {
              Rectangle()
                  .fill(Color.red)
              Rectangle()
                  .fill(Color.blue)
                  .frame(width: 100, height: 100)
              HStack {
                  VStack {
                      Rectangle()
                          .fill(Color.blue)
                          .frame(width: 100, height: 100)
                      Spacer()
                  }
                  Spacer()
              }
              .padding(10)
          }
          .aspectRatio(1, contentMode: .fit)
          .padding(10)
      }
  }

Re: SwiftUI in 2022

#156

Context: I’ve been working with iOS full time since a few years before Swift came out. A few startups ago we built our app using SwiftUI 1.0. At that time, while 90% of it was fantastic, 10% was either unworkable or extremely unreliable, causing for some maddening bugs. The documentation was laughable so for these reasons I chose to do the app for a subsequent startup in UIKit. Fast forward to my most recent company;…

Do you mind explaining exactly what animations would take that much work? I’m struggling to see how animations could ever take as long as estimated for UIKit

Here's a part of the flow I'm talking about; for context it's a debit card that rewards users with stock as they use it. The entire flow is SwiftUI (though the top of the pack ripping is PNG sequences so we did cheat a bit).

https://streamable.com/56pha0

(shameless plug; check us out at https://www.withapollo.com we're YCS21, just launched last week, and are hiring an iOS engineer!)

Re: SwiftUI in 2022

#157

...no comparison with Flutter or at least remarks of what would also apply to it?

Flutter is almost exclusively used by web developers in my professional and personal experience which is odd considering the lack of JS. The types of companies that hire iOS developers and build iOS apps also hire android developers and build android apps, again, IME.

Work for a financial institution which hired iOS and Android developers and had them rewrite everything in Flutter.

Re: SwiftUI in 2022

#158

You could write an opposite article featuring people using SwiftUI that have never touched UIKit or iOS code before and it would be nothing but glowing praise. That's kinda like my story. Covid started and I wanted to learn something new so I started with Swift/SwiftUI. 2 years later I've been doing tons of crazy custom stuff in my portfolio tracker app https://stocketa.com (not launched yet) - I kept a thread with m…

It's quite a bit different experience working on an app by yourself and working on an app that has several hundred thousand lines of code that 10+ people are working on simultaneously. I've worked with a bunch of people that are complaining in this and the problems you face are quite a bit different.

Your app looks sharp though I like it.

Re: SwiftUI in 2022

#159
post #106

Is anyone using this really? My team is pretty excited about using it but I've been a little more hesitant mostly because I've not read of anyone using it at any sort of scale with success. Even for smaller project it still doesn't seem production ready.

I just finished a contract on an app with 400K users. It was in pretty bad shape when I got my hands on it. Last update: February 2020. Targeting iOS 11+, mostly UIKit, powered by Cocoapods with 25 dependencies, and 1.3M LOC. It took me 3 months to rewrite everything from scratch in SwiftUI, with 100% feature parity. Of the ~20 different view/components that I had to write, just one required me to dip into UIKit (wit…

Wait, it went from 1.3M LOC to 6.5K? Was the UI layer really that bloated or are you counting the 3rd party dependencies? I envy you the 3 months without adding any "customer value" (not joking, I'd love that).

Re: SwiftUI in 2022

#160
post #111

Earlier quoted context omitted.

Took me 5 minutes. Copy and paste this into a playground: https://gist.github.com/maxhumber/1dbdf0d9c4539a8e145b3c630c...

Your answer is wrong. You've failed the fizzbuzz :) Change frame (screen width) to 300, 500 to see why.

Good catch. Fixed with an extra ZStack.
Post reply on HN