SwiftUI for Mac 2022
troz.net
troz.net
EDIT: you can get a free copy of my book by setting the price to $0.00: https://leanpub.com/SwiftAI
If anyone was interested in the app. I couldn’t find it on the App Store.
This link should show all my public Swift repos: https://github.com/mark-watson?tab=repositories&q=swift&type...
Also, I am a Common Lisp developer. Swift is just a side language for me, but I enjoy it and I was blown away at how useful Apple's Core ML libraries are (good stuff!).
That said, I will first ask Leanpub if I can allow no membership downloads.
EDIT: you should now be able to get the book for free.
You should consider expanding it. (plus: Typeset in latex). Maybe even selfhost it instead of Leanpub since you make it available to read for no charge. I am sure you will find much better viewership & suggestions/PR/contributors.
Professionally I am a Common Lisp programmer and I have updated My Loving Common Lisp... book many times.
I think that Apple has done a very good job with the Swift + SwiftUI + Core ML ecosystem. Probably not to many people's taste, but I really like bottom up programming, starting with experiments in a REPL, and then creating little libraries, etc. Swift support this and on any M1 or M2 laptop of iPad Pro, compilation is really fast. I think that Apple could improve the Swift Playgrounds experience on iPad Pros, but I like what they have done so far.
What kind of AI application could be handled bay Macbook Air M1 easily?
You can also import Keras/TensorFlow models, etc.
I just used the parts I needed.
Been using it at work for a moderately complex app (not a toy app by any means) and it's been fantastic. We're 7 months in and haven't hit any gotchas, but the learning curve can be a bit steep, especially for more junior iOS devs.
Helps that they have a full video series taking you through the library and how they built it: https://www.pointfree.co/collections/composable-architecture
I think it will take few more years until SwiftUI can get to feature parity with UIKit.
If you start with SwiftUI and need to integrate sone part of UIkit without really knowing the patterns, it's daunting for a while, but it's kind of an interesting daunting. My biggest issue is in the blurry line between iOS SwiftUI and mac swiftUI capabilities. A lot of examples are written by ios devs, who aren't even thinking about mac discrepancies
I was working on a 'toy app' earlier this year. I needed to use MapKit, but the SwiftUI MapKit is pretty simple, features-wise.
So I had to do the more complicated (relatively-speaking as someone with no prior UIKit/Swift experience) solution of using a UIViewRepresentable to host a UIKit MapView.
It wasn't the hardest thing to implement but it definitely shows that SwiftUI can't handle everything.
I definitely think having that 1:1 parity will help and hopefully it doesn't took too long.
I have used SwiftUI now in 5 shipping iOS applications and one internal macOS app. Two of them had codebases that extended all the way back to pre-ARC Objective-C! One app was 100% SwiftUI (with two UIKit exceptions where I had to drop down to work around a SwiftUI bug)
I get "real" things done in both UIKit and SwiftUI. It is trivial to host a SwiftUI view in UIKit, and it soon becomes the most pleasant part of the app to work on in my experience
It's simply a tool to use alongside UIKit, and it happens to be fun to use too
> It's simply a tool to use alongside UIKit, and it happens to be fun to use too
exactly. the way i look at it is like a super powered version of xml (xib) for describing app uisthere are alot of things you cant do in pure xml/xib and the same is true of swiftui, in those cases you need to use an island of imperative code (uikit or custom class) and things work smoother in those cases
We are also working on SwiftUI stuff as well.
Let me know when any of the major companies actually use it seriously.
Out of curiosity, what products of note have you developed that give you the right to talk down to everyone else?
We are a bank. We make software used by millions of people a day.
We are a major company.
Lost your key, gatekeeper? :P
Plenty of serious development uses SwiftUI and storyboards.
You can do very fully featured apps in SwiftUI today
But I’m curious what this means, specifically. What would a good example of a serious UI, in your view? Not looking to argue - I’m genuinely curious.
That's interesting. UIKit is by far my favoured UI development framework (whether on web or mobile). It's incredibly powerful, and also pretty damn easy to work with once you know what you're doing.
I feel SwiftUI might be favoured nowadays, only because the vast majority of devs come from a web development background. UIKit unfortunately has a pretty steep learning curve if you've come from a web dev background.
Unfortunately, desktop Linux development has been on a constant downhill trend for the past few years. Red Hat and GNOME have been doing their best to pull the rug out underneath most of the good development infrastructure, which is annoying to say the least. It's a crying shame, but I have no doubt that Apple will trounce whatever libadwaita nonsense is getting built by GNOME maintainers right now.
Like you said, though, it's a great entrypoint for people like me who work on servers first and write software second. Kinda like how Zenity was a nice swiss-army-knife for script kiddies who got their rocks off watching sliders go from 0-to-100. Unfortunately, it looks like GTK4 isn't quite as accessible, which is going to be really challenging for it's adoption. The regression of features was frustrating enough, but now I genuinely don't know how to write an app with the library anymore. It's insane that they'd expect me to re-write my app to fit their brand new library, especially if it might not be sticking around very long either...
Edit: also, looks like Cambalanche isn't packaged for my distro anyways.
Edit 2: I just built a more recent version and I am actually pretty impressed with how it's come along. Still not at parity, but a lot better than when I last saw it. Now, if only I didn't need Flatpak in order to watch it's development...
It moves so fast, it's changing every time I revisit. Often forcing me to upgrade my OS in order to keep my toy-software compatible.
Meanwhile I can reopen PHP projects from 6 years ago and it's still perfectly correct and workable.
I feel swift is mature now and they should slow the f down. I'm being priced out of the market in terms of maintainability. If it's your full time job, sure. Otherwise, RIP weekends.
Additionally, web apps only need to maintain install compatibility with their server. iOS apps are “desktop apps” so you need to have the mindset that your installation targets are a constantly evolving mix.
On top of that, your targeted OS is one with strict design, security and performance guidelines that aren’t static. The web doesn’t have this requirement (other than what search ranking factors incentivize.)
I haven't done any coding since I was a kid and fancied doing some, since my devices are all Apple, iPhone / iPad / Mac, Swift and SwiftUI seemed like a good choice to start learning.
I'm finding it a little slow going and the language seems quite strange to me, I'm not too sure if it's because i've only dabbled in older languages itself or if it's more the language or the framework, but I do hope I made the right choice to invest time into!
This is just the author putting together the elements and discussing them. They're not trying to design something.
There's tons of SwiftUI apps out there that are gorgeous looking. As with any UI framework, it's up to the developers who use them to make pretty or not.
I'm pretty sure that some of the new versions of the Apple standard apps are in SwiftUI. They may be a better example.
Polish takes a great deal of effort, and often detracts from the lesson.
Having done a number of things like this, I can attest to how much work it is, and appreciate the effort.
All that said, I am still not entirely comfortable with committing to SwiftUI for a major app development project. I'm in no hurry. AAA apps are still using ObjC codebases, so there's no real urgency.
The defaults being inconsistent and ugly is a failure of the component system. Like, why does the date field s month (6) have a space in the middle, and the up/down arrows are different from the select box’s up/down arrows ? And squared corners instead of round ones ?
It might be from the options the author is setting, but I’m not sure why it would end up that way.
For myself, I spend many hours, polishing my courses.
This one is a bit dated, but you can see what I mean: https://github.com/ChrisMarshallNY/ITCB-master
And, from the perspective of a developer, I don't think it's a big deal. This date-picker design is used consistently across the system. So I assume someone at Apple will eventually get a 16 man-hour ticket to fix it system-wide, including third party apps.
1: https://github.com/trozware/swiftui-mac-2022/blob/a301437c16...
Open up Xcode and drag various AppKit/UIKit's components onto the screen. Now ask yourself if this is the future of iOS/macOS apps just because you were able to cobble it together out of curiosity.
For proof, look no further than the new Settings.app. As Craig Federighi said in Gruber's talk show, it was carefully crafted.
A UI framework should at least get some of the very basic things correct with out of the box defaults. Bootstrap, for example, largely gets this right. You can slap something together and it at least looks vaguely cohesive. The screenshot you posted, should have taken somebody a lot of effort to demonstrate how a UI should NOT look. It's a visual version of a new HTML form framework where the labels aren't clickable...