229 points · by geoffeg · 4y ago · 246 comments
Success to me looks like steering clear of SwiftUI for now, and advocating for Apple to hire documentation editors/leaders who can 1) create SwiftUI documentation of code examples for how to escape out of SwiftUI to handle more-complex cases, and 2) accelerate Xcode speedups of SwiftUI testing-and-instrumentation techniques such as View testing (e.g. ViewInspector) and integration testing vs. unit testing (e.g. reactive vs. dependency injection vs. extension tests vs. protocol tests etc.)
Will it ever be mainstream for iOS/MacOS? Maybe, if Apple would use it way more than they have so far, thus improvement by dogfooding. It is nice to build apps this way, but there are way too many bizarre gotchas still for most people unless you can live with more flexible designs.
For those "stupidly complex UIs", SwiftUI just doesn't have enough hooks for customization. And the improvements are too slow. Using SwiftUI has been bitter-sweet. It feels like you just can't use it to craft a high quality app that doesn't look like a generic iOS app.
To be honest, as a user, I'd really rather see more "generic iOS apps". I think too many design teams are self-centered and do not consider that users need the apps not to admire their wonderful creations, but to get certain things done. In other words, your app is the center of your world, but it is not the center of mine. It's something I want to use to get stuff done quickly, with minimum effort, and with minimum cognitive load. Generic is good.
I think a mobile app should have a stupidly simple UI instead. Designers traditionally use a graphics program to design pixels. SwiftUI let’s you design layouts and components. Maybe designers should change how they design and start using SwiftUI as a design tool.
Modern development, at some companies, can truly feel regressive at times.
Meanwhile, my team has built an entire cross-platform desktop app in Qt with QML, which has been around for years and works refreshingly well. You're telling us that Apple, starting fresh and with several years under its belt now, still hasn't gotten its shit together with SwiftUI?
And the word is that nobody at Apple even understands how Xcode works at this point. It's a patched-together shitshow that desperately needs a ground-up rewrite... but we all know how those go. Remember the "ground-up rewrite" of Finder we were promised several major OS releases ago? Still waiting.
No? I've never heard of this. Do you have any citation for such a promise?
Wired: https://www.wired.com/2008/10/rumor-apple-s-finder-app-to-ge...
Ars Tecnica: https://arstechnica.com/civis/viewtopic.php?f=19&t=99890&sta...
Also a quick search found this guy referring to it in 2009:
"I have always wished that I could change both the font and spacing between both sections and items. I was really hoping this would be possible with the rewrite of finder in SL 10.6."
https://macmost.com/forum/resizing-the-sidebar-font-in-finde...
WHOOPS
I agree that Apple’s documentation needs help (this year’s improvements are a nice step) but can we really expect them to provide extensive documentation for handling edge cases (you’re telling me UIKit docs offer that)?
Forcing myself to be rational "hate" is probably too strong a word. If you are down the Apple cul-de-sac there is really no turning back. So investing in things like code examples for all of their API (there are a few, a very few) is a waste for Apple. It does not attract new developers and the old ones are stuck in the cul-de-sac.
There obviously is a trade off with how much you can/should expect, but "you cannot expect 9/10" is not a valid reply to "it currently is 3/10".
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 hidden, but it's there, and you're going to have to interact with it to do anything non-trivial.
- Is SwiftUI the way?
SwiftUI has enabled me to build out huge amounts of beautiful UI quickly – faster than anything I've ever used. But you will run into things you can't do, forcing you have to fall back to AppKit/UIKit. And the area where AppKit/SwiftUI meet will disappoint and frustrate you. I just got done refactoring a huge amount of my app to use the "AppKit App Lifecycle" instead of the SwiftUI App lifecycle since I need some specific windowing behavior. Now I can't use .toolbar, .menu, and other stuff, which makes things much more complicated for me, and forces me to think about both SwiftUI/AppKit. Switching mental models like that, and trying to remember all the intricacies of both SwiftUI and AppKit is rough.
--------------
Regarding the performance issues of this specific post, my guess is they put everything into an ObservableObject, and used @Published properties to get bindings for their UI controls. This means any view with a reference to the ObservableObject gets re-rendered when @Published values change. Instead you need to silo your changes, so your entire App isn't redrawn every frame. This goes back to the complexity – it's not straightforward at all.
No, this is actually the thing you should not be doing in SwiftUI. Ideally you text fields are not redrawing at 30 fps, actually, ideally nothing in your interface is doing this except when an animation is running and even then only the components that are animating. SwiftUI makes it really easy for you to accidentally start redrawing things that don't really need to be redraw far more often then you want, and that's how you get performance problems.
> 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).
> 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?
What you’d need to be careful off is ensuring your @State or @Published changes don’t too take too long to skip frames
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!
I'm still at the beginning of that part, but I'm doing it myself with TextKit 2 as well.
> I've been researching this space for a while and syntax highlighting text editors are rare and sparse.
I had the same experience as you when looking for information on how to go about it. I've come to the conclusion that no matter what an editor/IDE is going to be an ugly beast. This gave me some comfort in just forging ahead and trying to make good decisions as I go. And since I'm doing this all as a native app, I think I have a lot of wiggle room.
As far as syntax highlighting, I just recently started calling into Zig (the language I'm building this for), and using the tokenizer to do basic syntax highlighting. I'll need to go a bit deeper into the compiler to do more advanced highlighting, but it's cool to have it working.
> How did you do about providing autocomplete, etc?
I'm not there yet, but these are the things I'm looking forward to working on. I'm currently working on sort of "core" things and trying to design them well. Things like the settings, window management, a command palette, etc. Getting them close to right early on seems important.
I don't really do very technical posts, but I'm trying to blog a little about it: https://austinrude.com/tags/zig-ide/. My biggest issue is second-guessing using Swift/SwiftUI and not trying to do it all myself with Zig, leading me to procrastinate. But I'm pretty far along, and think I'll probably release something eventually.
On Android, at least, Compose feels fully baked to us. Our shop is fully committed to new development on Compose UI; bridging tools for legacy components work great, and they work great for hosting new Compose views in our legacy framework as well. The Compose team is engaged with the community, and is generally ahead of the ball on problems real engineers are having.
In addition to all that, the structure of Compose has led to its new tooling being used in a variety of other domains. Engineers outside of Google are wiring Compose up to TUI frameworks, to platform-independent view APIs, and even running Compose without any UI at all as an asynchronous programming framework.
I don't have any experience with SwiftUI to compare it to. As an outsider, I know that the naysayers are sometimes louder than happy consumers of a new technology. But I will say this: there's a whole narrative in the Android world pointing out that Compose and Compose UI are two different things. Compose is available to use and work with even if you never touch the concrete UI framework Google has built.
Does any equivalent narrative exist in the iOS world? Or is SwiftUI mostly just a UI framework?
People don't think about it, but UIKit now has ~15 years of effort put into it, and got a serious boost from its shared roots with AppKit (even though big chunks of UIKit were freshly written, its structuring and API design were largely informed by AppKit), which has history tracing all the way back to the 1980s. Of course something as fresh out of the oven as SwiftUI is isn't going to be able to compare in terms of polish or capability.
So for now I'm sticking to UIKit in the apps I'm responsible for. I think SwiftUI's day in the sun is coming, but it's not here quite yet.
That doesn't mean that there aren't issues with how it's being engineered and documented, though. It has serious shortcomings that need to be shored up, and hopefully that happens with its maturation.
Based on my experience, the UIKit dev experience didn’t start to reach the level of completeness it’s known for now until some time between iOS 7 and 9… at least that’s when I remember the number of “required” third party libraries start to steeply decline.
I was there for Cocoa development in Mac OS X 10.3. AppKit was not mature. I wasn't there but have heard it was less mature in '91 3 years into NextSTEP.
But it looks like the task was somewhat beyond the people who had the responsibility for rolling out SwiftUI at Apple.
We're several years in to SwiftUI.
Apple's in a tough spot now. I'm really glad I don't have anything too high-stakes dependent on it. (I only have a project with ~200 hours invested -- not zero! -- it's heavily UI, but it's tiny... maybe ~30-40 hours to port to UIKit, if needs be.)
OS utilities like Image Capture, Preview, Apple's screenshot utilities, Spotlight, Quick Look, and quite a few others have been basically "killer apps" that make me want to use macOS over Windows for decades now.
Even basic areas like system settings have been a point of frustration for Windows for an extremely long time now, with Microsoft taking many years to truly migrate off of the Control Panel and deliver something half-decent in the Settings app. The Windows 11 iteration finally starts to feel like it's a little bit cohesive (but I still hate the Devices settings panel). The whole situation has really been a mess going back to Windows 8.
Another example: anytime someone says that printers universally suck I know immediately that they're Windows users because of just how much better Macs interact with printers and scanners and how much better and more reliable their configuration interface is. Apple single-handedly saved the entire printer industry from the depths of hell with AirPrint, before that Bonjour, and before that shipping OS X with preinstalled printer drivers.
Windows 10 couldn't decide what screenshot app I was supposed to use, thank goodness it's been consolidated after Windows 10's inclusion of two separate apps both worse than Apple's tooling.
Plus, Apple has to get credit for the sheer number of decently high quality non-enterprise apps that Apple just gives you for free.
Microsoft doesn't make anything that approaches the quality you get from Apple's free iMovie, Photos, Podcasts, Books, iTunes/Music, Contacts, Mail, Pages/Keynote/Numbers (without paying).
Finder on the other hand...
Resting on laurels, while trying to figure out how to destroy everything good about macOS by making it more like iOS.
Android variants all have things that iOS can only dream of having in five years (notifications was a fun one), just spread very unevenly throughout manufacturers. Samsung currently has a very good Android build.
Calling it the best is very far fetched.
When I switched from Android to iOS in 2016, I was shocked at how little was different, and I can only assume gulf has narrowed since then. A lot of features Android users just assume iOS users don't have are there: vendor-agnostic password manager integration, Safari browser extensions, Safari content (ad) blocker API (Chrome is restricting ad-blockers soon!), more complete home screen customization and widgets, lock screen customization and widgets (iOS 16, upcoming), custom third-party keyboards, grouped/customizable notification system, native console wireless controller support from all three consoles.
Features like granular privacy controls and screen recording (with the exception of some obscure Android OEM builds) debuted on iOS first.
I'd be skeptical with anyone declaring either platform "best," I think they're both roughly equivalent.
However, I do think that anyone who uses macOS is insane to go with Android. There are simply too many useful integrations between the platforms to ignore, combined with the fact that, even if the iPhone isn't the best phone, it's usually in the top handful of choices in terms the overall package.
This is a bit of a simplification but in broad strokes it is kind of correct. And it turns out this actually makes good UI!
You can install creaky old Windows on millions of devices with disparate hardware configurations on the day of its release, but Android users must wait weeks, months, or forever for their telcos to dribble out hacked, proprietary versions of Android for every model of device ONE AT A TIME. Seriously, WTF? And this is from the great "open-source" OS that was supposed to free us all from vendor and telco tyranny.
What a fraud.
I would say this is a matter of opinion.
It stagnated enough for android to come really close, while the other issues didn’t improve much (side loading will be on Apple’s dead body, default apps setting still being too few), and there is no end in sight to the constant nagging for more service revenue.
Nowadays both OS are mostly on par, for instance android 13’s per app language setting is one of those QoL things that were iOS’s turf but are now more prominent in android.
So I wouldn't consider iOS the best mobile one in that regard, as probably no one that suffers being brought sundenly to the home screen due to pointer errors in Objective-C.
Some of its features are yet to appear on iOS.
For the rendering part, it depends, I'd say it should take between 0.5 and 2ms with many layers, a lot or transparency and not much care for optimization.
Perhaps surprisingly, the most expensive part is usually text layout and rendering - text shaping is just really expensive and in the industry standard libraries it can take a long time to lay out a string, so you have to aggressively cache and do fancy things to get good performance. ASCII text is fast, though.
I don't see why all of text layout calculations could not be done at maximum speed with everything in L1. Probably with quite a few branch miss-prediction, but still.
The amount of work you can achieve in 1ms on a modern CPU is astonishing.
Rendering is not why SwiftUI can be slow.
If you don't know what you're doing, it's possible for SwiftUI to think your new view is unrelated to the old view and everything needs deallocation and reallocation.
Based on the author's description, it sounds like the real cost here was from way over-diffing a set of models that weren't very efficiently bound to the UI. This is a very common source of bugs in all declarative frameworks.
In SwiftUI, the consequences can be particularly bad, because there are a couple somewhat innocent-sounding ways of injecting dependencies into your UI that actually invalidate the whole thing on any value's change and cause major updates (including, if a custom "Representable" that uses its own GPU tools is not implemented carefully, potentially reallocating all kinds of buffers and drawing tools).
This is all stuff that you learn how to deal with as you get used to the framework and learn its more advanced tools, but adapting to this part is not really something there's a lot of documentation for.
Very unexpected things happen, like items in a specific region in the App UI stop responding to clicks next time once you interact with them.
However I find it fine on iOS and the issues are usually around Apple changing something in the behaviour of the UI or API and breaking it, then you need to fix it for specific versions of the iOS. That's what you get when a framework is not mature yet, I guess.
That said, I don't think there's a turning back. It might be buggy but it definitely feels like the right way of building UI.
Oh, about the performance, you can build very sluggish or very responsive UI with SwiftUI because there's a night and day performance cost difference between "re-calculating and re-drawing" the UI and adjusting a property of it. Always try to structure your components in a way that changes happen by changing passed values instead of inserting or re-doing the views.
SwiftUI works quite a bit like React, many performance lessons from React will translate into SwiftUI.
Well, apps using it get a uniform look, that uniformly changes when the OS look is updated so that it matches it, and more importantly, they and also get to have the same widgets and widget functionality [1].
Unlike, say, Windows where you have 20 generations of MS GUI lib versions, with different looks and behavior, running at the same time, even from MS apps themselves...
[1] Yes, Apple has its share of inconsistencies (e.g. Swift UI vs regular Cocoa UI). But nothing like what would have resulted if they allowed apps with different historical macOS UI libs/versions to be installed at the same time independently from the OS UI libs.
Also apps don't get the new "improved" styles etc if they don't have it in the system, which takes away the consistency Apple aims for.
And then: It's Apple ...
Apple's not doing the correct thing. SwiftUI just created a barrier where people pre-iOS 13 lose access to a lot of apps, and those apps will be raising their minimum version a lot more often than before. So if anything, you could consider this a ploy by Apple to get people to upgrade their phones.
I've been able to workaround this by sticking a .id() on the view in question, I've seen similar issues with views falling out of the keyviewloop when you have a bunch of dynamic forms.
If the bugs are bad enough I can always do something custom in UIKit via UIViewRepresentable.
The current project that I'm working on, is pretty big. It peaked at 40 screens, but I'm trying to get it down to half that.
I've been working on it for two years. I also wrote one of the backends (and most of another).
There was no way that I was going to start on a project of that complexity on SwiftUI, which, at the time I started, had only been demonstrated in a few small projects. I already knew that UIKit could do it.
But I think that SwiftUI will become the standard, sooner or later. I look forward to being able to write more reactive applications in it. In my experience, if I use UIKit, it's a fairly bad idea to stray from the old MVC model (This, I have learned. <Pulls up shirt> See this scar?).
I hope Apple never goes the way Microsoft did with their fad UI toolkits that utterly destroyed developer trust in native Windows development (MFC, WinForms, WPF, UWP, WinUI, .Net MAUI). They are pretty wise for keeping SwiftUI be the "for kids" vanity UI toolkit to lure in React webdevs, while keeping UIKit and AppKit for serious stuff.
At WWDC 2022 they specifically said that Swift+SwiftUI is the best way to build apps, and the future of their platforms. I thought AppKit/UIKit would stick around, but I guess not.
---------------------------
Edit: Here's the direct quote from the "Platforms State of the Union":
> We're continuing to expand our adoption of SwiftUI across our apps and system interfaces. For example, iOS's new Lock Screen widgets were designed from the ground up using SwiftUI. The new Font Book app was completely rewritten with it. And the modern, forward-looking design of the new macOS System Settings app was built using it. Swift and SwiftUI were designed from the start to provide a single, native language and API for all Apple platforms. You can learn them once and apply them everywhere. Whether your vision is to provide quick access to information at a glance on Apple Watch, productivity tools on MacBook Pro and iPad, new experiences on iPhone, or a new way to relax with Apple TV, Swift, SwiftUI, and Xcode provide a next-generation integrated development platform to help you build apps for all of our products. Now, if you have an existing app, it's easy to adopt these new technologies incrementally. And if you're new to our platforms or if you're starting a brand-new app, the best way to build an app is with Swift and SwiftUI.
The slide had a Swift, SwiftUI, and Xcode logo with nothing else.
I'll start getting concerned when they rewrite any of their serious apps in Swift(UI). (i.e. Logic, FCP, Xcode, Finder, Instruments, iMessage, Mail, Calendar, etc.)
I know, for a fact, that some AAA applications are still using ObjC.
Also, I am quite sure (but don't know) that Apple still has a plenty big ObjC codebase at home.
Having said that, even though Apple indicates it will turn, it still may change its mind halfway through.
> The Objective-C language, AppKit & UIKit frameworks, and Interface Builder have empowered generations of developers. These technologies were built for each other, and will continue to serve us well for a long time to come, but over time new abstractions become necessary. For a while now, you've seen us hard at work defining the next generation of integrated language, frameworks, and tools: Swift, SwiftUI, and Xcode Previews.
>
> Tight integration in a development platform like this requires that all three pieces be designed and evolved together, both driving and driven by one another. Swift result builders were inspired by SwiftUI's compositional structure. SwiftUI's declarative views were enabled by Swift value types. And Xcode Previews was specifically designed for, and enabled by, both. Now, the result is the best development platform that we have ever built. And this year, Swift, SwiftUI, and Xcode all have fantastic updates that take this vision further, and make it even easier for you to build great apps for all of our platforms. And it all starts with Swift. Now Ben from the Swift team is gonna tell you all about what's next.
But if you don't keep track of the impurity dependencies on your language, you will need to rediscover those dependencies during compilation, and besides surprising the developer all the time, that's a really nasty problem to solve. That's why it's always solved badly.
However for a real nice C++ GUI development experience on Windows, going with C++ Builder or Qt would probably be a saner option, as the WinUI team doesn't seem to get it, and MFC only gets minor updates nowadays.
WinForms is basically Delphi's VCL ported to .NET. And back in 90s, Delphi was one of the most popular ways to make native Windows desktop apps.
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 applications when we write them?
The worst part is all these tutorials that have to combine SwiftUI and UIKit because the former is very buggy in certain cases, like navigation trees on iOS have really janky animations using SwiftUI. So you have to coordinate all your Views using UIKit. It just seems barely easier to use SwiftUI most of the time.
EDIT: Basically, in summary, it seems like a very complicated (look at the crazy language features they had to add for it) plus very opaque ("it magically does it for you just how you wanted") way to write the same apps you were already writing fine in UIKit and AppKit
I recently began developing with Flutter for a project. And whilst I dont love Flutter/Dart that much, I must admit that Google have done an amazing job of proving resources and documentation for the frameworks!
The whole Flutter community and available resources feels very rich, welcoming and embracing!
Tech like Flutter is fresh and exciting to a lot of people, and Apple is right to be worried!
So say what you will about Flutter/Dart, love it or hate it, the docs and community are excellent!
There’s a lot more variety of learning resources compared to other languages; there are texts, workshops, videos, code labs, etc. It’s also nice seeing members of the Flutter team facilitate some of the workshops themselves; it’s refreshing to see developers being involved in educating users, instead of ‘outsourcing’ everything to others.
> SwiftUI came about because someone who has never been a software engineer
so... management?That... is exactly the same thing with React. You don't notice everything is redrawn until suddenly everything is unbearably slow. And then it's useMemo etc. galore.
I'll withhold my judgement on SwiftUI for now though.
I have never fully bought into this notion that the components should rebuild themselves in this kind of stateless manner.
I think this like an intellectual obsession with functional programming mapped onto the UI Tree. I can't fathom why it's 'better'.
The reactive aspects of the middle tier of the program - that's progress. But the reactive components, I'm not sure about that.
To write code quicker, and make it easier to maintain. If it's a moderately complicated UI, then I could code it up much faster in React (my guess is around 10x). IMO, React isn't about functional programming, it's just a good DSL for writing UI.
On the web frameworks like Solid.js are exploring these fine-grained reactivity approaches to actually re-render only what's needed, and not huge chunks of UI
Well done
After two years with Xcode/Swift/SwiftUI I never succeeded in getting anything useful out of the profiler.
Following the instructions from "blogs", official videos, and what official documentation exists
> Do you have past experience with how to profile and optimize applications?
Yes. About three decades
The tricky part is knowing what is immutable, because standard JVM collections are not.
I ended up implementing a similar rate limiter, I think based on this here: https://weblog.west-wind.com/posts/2017/Jul/02/Debouncing-an... (I've never shipped it though.)
The art is to get the behavior just right. You want the first request to go through immediately, so on a single click the user sees low latency. But afterwards you need to throttle it so that it only updates every, say, 500 ms. And you must not forget to display the very latest state, if there is no new event after e.g. 50 ms.
This seems like one of those things that are really hard to get right and the toolkit developer should have solved for you. I've struggled with it a couple of times now.
And in both cases, still not up to the set of WPF capabilities in that regard.
The issue is that Apple sort of claims that this is all you really need to do, and that the framework will kind of handle it for you. In reality you need to be really careful about what's being updated to avoid spurious updates. Actual SwiftUI code for anything non-trivial necessarily requires some manual debouncing and equatable checks. I hear React Native often has the same issue, but there people have experience with applying memo when necessary. With SwiftUI it's considered "advanced" and bites people before they really know how to deal with it. And, of course, that's assuming that the dependency graph is working correctly: if it's not, you're often stuck and there's often not much you can do.
React and Jetpack Compose aren't so lucky, having to rely on the underlying optimizations of JS engines and ART, on escape analyis and GC algorithms.
I never understood the love for reactive for interactive GUIs, when they are so bad in memory management and its effects to jank.
Also, aren’t they basically push-based reactive frameworks? I would assume they just call a bunch of registered functions and that’s it. The graph itself shouldn’t change too often (and may be static as well, eg. React vs SolidJS) — but I am way out of my depth here.
The most performance code is the one you don't have to execute.
In my experience, you definitely have to minimize work done in Views and maybe avoid `@Published` properties on your model in favor of more explicit calls to `objectWillChange.send()` to signal when you really are ready for the Views to be updated. SwiftUI does not seem to do a very good job of coalescing by default.
If all you want is a declarative UI, just dump in ImGui and be done with it.
btw, please add an RSS feed to your site. If you have one it's not discoverable via in-page links, link tags, or educated guessing.
.onAppear {
// 0.05 is a guess. anything lower seems to run too early
// and does not have the desired effect.
DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
focusTextField = true
}
}
Similarly, dismissing text field focus & on-screen keyboard upon scrolling/tapping away is a source of programming pain. It seemingly was bad in the old APIs. It is worse in SwiftUI in my limited experience. Same for scrolling a view such that an active text field isn't covered by the on-screen keyboard.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.
The only thing I want is to develop an app for my own use, but I need a paid account if I want an app that lasts long.
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.
The tooling will always be less mature than you can find elsewhere. And in the end, all you have is a thing that works only in the walled garden.
Of course this observation is not limited to any particular garden.
Flutter is currently rewriting a key part of their graphics rendering pipeline as we speak that should clear up the remaining issues people seem to have with it when it comes to performance and the rest of the project is incredibly well supported and documented and most importantly as you hinted at genuinely cross platform.
It’s a much better bet for basically any project outside of one that you know for a fact is only ever going to target Apple operating systems.
1. SwiftUI seems mainly suited for building quick proof-of-concept simple intro apps, with the difficult 20% still out of reach. Which doesn’t sound all that different from the notorious downsides of cross-platform frameworks, some of which can allow for small simple apps to be quickly spun up, but the tough under-the-hood cases still intractable.
2. Flutter, and React Native are more mature than SwiftUI is right now. SwiftUI will get there, and maybe it’s only 1-2 years away, but it still hasn’t hit its Swift 5 moment yet. That opens up the possibility of breaking API or even conceptual changes until then.
Source?
The lack of support for Video and Camera from SwiftUI was the most challenging part for me as a newbie Mac dev.
Took me a few weekends to get the core part done (ML and algorithm), but hooking up all the UI components and connecting them with the video stream gave me so many headaches.
With that said, it was still much easier for me (complete newbie to Mac App at the time) to learn and develop in SwiftUI than UIKit.
Hope SwiftUI keeps getting better and keeps investing in the team.
Just an FYI.