Live data from Hacker News

Why I quit using SwiftUI

chsxf.dev

71–80 of 257 posts

Re: Why I quit using SwiftUI

#71
post #58

I'm building an IDE in (mostly) SwiftUI, and have been using it since release, so I feel like I've worked with it more than most people. A couple observations: - SwiftUI is really complex It's going to take you at least a year to get used to the declarative way it works, and be able to make UIs without struggling to figure out how to shuffle data around. If you look at SwiftUI examples/code, most of the complexity is…

How do you silo the changes? The issue was that changing a property of an object caused the inspector to be redrawn. With old fashioned UI libraries you would only change the value of one text field in the inspector. Can this be achieved with SwiftUI? To be honest I'm surprised that it's that slow even if the entire inspector is redrawn. Surely on a modern computer you can redraw a couple of text fields at 30fps?

See this answer: https://swiftui-lab.com/digital-lounges-2022/#data-15

> Surely on a modern computer you can redraw a couple of text fields at 30fps?

Yeah this is the tricky thing, with how (I'm guessing) the code looks, you would think it's only updating the text fields. But in reality it's probably re-rendering the entire hierarchy using the @EnvironmentObject. So the SceneKit view gets setup and rendered every update of the Slider.

------------------

I have real-time color pickers for changing all windows in my app. Same with font sizes. It's possible to make it work, you just have to modify your design (which is unfortunate).

Re: Why I quit using SwiftUI

#72
Ugh.

I haven't really coded things since I was a kid and since I have an iPad/iPhone/iMac and wanted to learn how to code again and potentially use it as a side hustle or some sort of future money making opportunity, I decided to learn swift/swiftUI and i'm currently taking an online course, but when I read through hacker news, all I see is articles bashing it constantly.

Re: Why I quit using SwiftUI

#73

Ugh. I haven't really coded things since I was a kid and since I have an iPad/iPhone/iMac and wanted to learn how to code again and potentially use it as a side hustle or some sort of future money making opportunity, I decided to learn swift/swiftUI and i'm currently taking an online course, but when I read through hacker news, all I see is articles bashing it constantly.

[deleted]

Re: Why I quit using SwiftUI

#74
post #53

Earlier quoted context omitted.

It's probably the same as the technical justification for why Safari updates are bundled with iOS and not separate, why XCode only runs on macOS, why no other browsers are allowed on iOS, why macOS can't have separate scroll directions between mouse and touchpad and many many others. It's Apple's ecosystem, nobody is asking you, you're holding it wrong.

Scroll direction is because everyone needs a mouse that you have to turn upside down to charge

The meme about the Magic Mouse charging upside down is really silly. There's a real good reason to be like that and you charge it once a month.

In the case of Magic Mouse, there's really a case of holding it wrong too. People hold it wrong and thats why they also complain about the ergonomics.

Truly excellent but misunderstood product.

Re: Why I quit using SwiftUI

#75
In 2022 developing software for iOS (now iPhoneOS) feels like you're working for Apple for free.

You have to look closely to new requirements that they roll out every few months. You should use Apple products in your app or gtfo (e.g. login with Apple ID). You have to update your laptop every few years because Xcode (which is monumental PoS) requires new MacOS that your hardware doesn't support. And when you go through all this trouble, you have to literally beg Apply to admit a new version of your app. You even have to pay Apple to be able to write apps for their phones/tablets.

I'm so glad I jumped off iOS development a few years ago.

If you're a young developer and still not decided what area suits you the most, think twice before entering iOS and MacOS development.

Re: Why I quit using SwiftUI

#76
post #58

Earlier quoted context omitted.

How do you silo the changes? The issue was that changing a property of an object caused the inspector to be redrawn. With old fashioned UI libraries you would only change the value of one text field in the inspector. Can this be achieved with SwiftUI? To be honest I'm surprised that it's that slow even if the entire inspector is redrawn. Surely on a modern computer you can redraw a couple of text fields at 30fps?

See this answer: https://swiftui-lab.com/digital-lounges-2022/#data-15 > Surely on a modern computer you can redraw a couple of text fields at 30fps? Yeah this is the tricky thing, with how (I'm guessing) the code looks, you would think it's only updating the text fields. But in reality it's probably re-rendering the entire hierarchy using the @EnvironmentObject. So the SceneKit view gets setup and rendered every upd…

Ah I see, so each of the values that are shown in the inspector should become its own observable object? That sounds reasonable.

> But in reality it's probably re-rendering the entire hierarchy using the @EnvironmentObject. So the SceneKit view gets setup and rendered every update of the Slider.

I get that this is slower than only updating the single value, but what I don't understand is why even this is so slow? Browsers can render the right hand side of this inspector UI (https://chsxf.dev/assets/posts/5/map-editor-with-inspector.p...) at reasonable speed even if you rebuild the entire DOM for the fields in the inspector. I mean, it's one checkbox, one slider, and 7 text boxes and a bunch of labels. What is taking so much time here?

Re: Why I quit using SwiftUI

#77

In 2022 developing software for iOS (now iPhoneOS) feels like you're working for Apple for free. You have to look closely to new requirements that they roll out every few months. You should use Apple products in your app or gtfo (e.g. login with Apple ID). You have to update your laptop every few years because Xcode (which is monumental PoS) requires new MacOS that your hardware doesn't support. And when you go throu…

I couldn’t agree more, especially the bit about Xcode. I don’t even do apple development but still have to deal with it on every upgrade. What a pain

Re: Why I quit using SwiftUI

#78

I spent only about half an hour with Swift UI to decide it was bot worth it. Looks sleek but the underlying technology is too complex IMHO.

I just wish that Apple had used this big effort to update their ui tooling to instead 1. Bring in stylesheets to UIKit/AppKit, 2. Let us define UIKit/Appkit views with simple straightforward xml like android or xaml.

Re: Why I quit using SwiftUI

#79

I just don't get what purpose it really solves over UIKit. Everything seems far more complicated in SwiftUI, and the data dependence problems it solves did not ever really seem to be a huge issue in UIKit anyway. Apple's sell for SwiftUI was "it's like going to a chef who knows how to cook for you" instead of "cooking yourself". But is that really a good thing? Do we really want to be taking less control of our appli…

I have some friends at Apple... The story goes something like this: SwiftUI came about because someone who has never been a software engineer, got concerned about losing mindshare to ReactNative et al. So this person created a "task force" to deal with the problem by tacking something on top of UIKit that resembles React, to create a "friendly" ingress funnel into the iOS world.

  > SwiftUI came about because someone who has never been a software engineer
so... management?

Re: Why I quit using SwiftUI

#80

I'm building an IDE in (mostly) SwiftUI, and have been using it since release, so I feel like I've worked with it more than most people. A couple observations: - SwiftUI is really complex It's going to take you at least a year to get used to the declarative way it works, and be able to make UIs without struggling to figure out how to shuffle data around. If you look at SwiftUI examples/code, most of the complexity is…

Out of curiosity, what framework/library/solution are you using for your text editor? I've been researching this space for a while and syntax highlighting text editors are rare and sparse.

There is this: https://github.com/krzyzanowskim/STTextView for textkit2, but the author ended up writing his own text input client.

How did you do about providing autocomplete, etc?

Thanks!

Post reply on HN