16 ms·
SwiftUI for Mac 2022
- aaaaaaaaaaab 4y agoGod, please tell me future macOS apps won't look like this: https://troz.net/images/form.jpg https://troz.net/images/form.jpg
- speedgoose 4y agoThankfully, most of them will be Electron based (or similar) and look better.
- ChrisMarshallNY 4y agoIt's an academic exercise app. Those always look fairly primitive. 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.
- makeitdouble 4y agoI think the issue is not on it being primitive. 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.
- ChrisMarshallNY 4y agoIt probably is the way the author set stuff up. 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 https://github.com/ChrisMarshallNY/ITCB-master
- SebastianKra 4y agoThe date picker is the only thing I see as wrong with the components displayed here. 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.
- draw_down 4y ago
- eyelidlessness 4y agoAll the things that don’t look nearly or exactly identical to Catalina-era Cocoa (i.e. the “switch” toggles, “grouped” sub-form, oversized “capsule” button) are explicitly declared in the source code[1]. I’d wager those toggles will become more common as they get more first-party usage, grouped sub-forms probably less so. Huge oversized buttons? Pretty unlikely. 1: https://github.com/trozware/swiftui-mac-2022/blob/a301437c169811f080fe09c39cc4f2b610dddc7f/SwiftUI-Mac-2022/Views/Samples/FormSamplesView.swift https://github.com/trozware/swiftui-mac-2022/blob/a301437c16...
- resist_futility 4y agoIt literally says “UI Samples” right above it, it’s not supposed to be pretty
- dagmx 4y agoWhy would that be your conclusion? If you were to slap any UI framework elements together without a design in mind, especially for a form, they'd look like that. 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.
- hombre_fatal 4y agoSo, you scrolled the article just to attack a random screenshot out of context? 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.
- dmitriid 4y agoDespite what people are replying to you, yes, that is the future of MacOS apps. For proof, look no further than the new Settings.app. As Craig Federighi said in Gruber's talk show, it was carefully crafted.
- lapcat 4y agoUnfortunately it will. Look at the redesigned System Settings in the Ventura beta.
- christoph 4y agoNot sure why you are getting downvoted. There are so many basic fundamental things wrong there... 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...
- Shadonototra 4y agoIn comparison, looks at the mess that is WinUI https://docs.microsoft.com/en-us/windows/apps/winui/winui3/create-your-first-winui3-app https://docs.microsoft.com/en-us/windows/apps/winui/winui3/c...
- smoldesu 4y agoWinUI, and even SwiftUI, to an extent, are pretty contrived systems for building apps. Maybe I'm crazy, but writing apps for x11/GTK3 was probably the easiest time I had writing a GUI application of any kind. I simply drafted up an XML file containing all of my UI elements, then called some functions that would wrap actual app logic around interactive components at compile-time. The result? Designing an app can be done entirely with drag-and-drop, then programmed with your language of choice. I used Rust, and my resulting binaries were pretty competitive all things considered. 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.
- thechao 4y agoI also found Win16/32 with "the giant switch statement" easy to program & reason about. Once you weapped your head around how to minimize the rdraw area, there wasn't much that could wrong. OTOH, it was a really tedious way to GUI.
- smoldesu 4y agoI agree with that, but I felt like the tooling surrounding it offered just enough functionality to make really nice, functional applications. The tedium was never really an issue to me since I mostly stuck to the GTK3 ethos of making small, polished and usable apps, but I could see how it would get complicated when making something more advanced. 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...
- mark_l_watson 4y agoI wrote a short mostly-AI book on Swift and Core ML last year and the last example was an app using SwiftUI (the example is in Apple's App Store). I was pleasantly surprised how straightforward it was to use SwiftUI. I read the Apple docs and spent about $10 for a short online class. It was probably only a 15 hour investment to learn enough for my purposes. EDIT: you can get a free copy of my book by setting the price to $0.00: https://leanpub.com/SwiftAI https://leanpub.com/SwiftAI
- skavi 4y agohttps://github.com/mark-watson/KGN https://github.com/mark-watson/KGN If anyone was interested in the app. I couldn’t find it on the App Store.
- mark_l_watson 4y agoI used to have one large GitHub repo for all the book examples, but then decided later to have separate GitHub repos for the examples because some are libraries and this works better with the Swift Package Manager. This link should show all my public Swift repos: https://github.com/mark-watson?tab=repositories&q=swift&type=&language=&sort= 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!).
- srvmshr 4y agoJust a gentle headsup: Looks like this suggestion doesn't work, since Leanpub annual membership is added automatically to this purchase, as being part of some bundle. Typically I wouldn't mind paying it if I knew what I would be getting out of the book
- codybontecou 4y agoI was able to find the manuscript on his [Github](https://github.com/mark-watson/SwiftAI-book https://github.com/mark-watson/SwiftAI-book)
- sircastor 4y agoAfter some 17 years of web development, I finally managed to sit down with XCode and figure out some app development with Swift UI. Having gone through some much earlier InterfaceBuilder tutorials and trying to figure out ObjectiveC, I’m far more confident I could actually make something viable in SwiftUI. Purely anecdotal, of course.
- ardit33 4y agoSwiftUI looks promising, but it is not ready at all. It is fine for 'toy apps' but if you want to do anything serious UIKit is unbeatable. I think it will take few more years until SwiftUI can get to feature parity with UIKit.
- dagmx 4y agoI think that's hyperbole. We have multiple, very complex SwiftUI apps published, and there are quite a few on the app store. You can do very fully featured apps in SwiftUI today
- lostgame 4y agoI’m baffled as to how this has been so downvoted. It’s just a fact. Been using SwiftUI for two-some years and while I use it for prototyping, when I actually want to get ‘real’ things done, I go back to UIKit quick as a bolt of lightning.
- programmarchy 4y agoI’ve found SwiftUI to be a dramatic improvement over storyboards or view controllers for managing state and flow. Sure, for some view components you need to drop down into UIKit to do some detail work, but then it can be abstracted back into SwiftUI.
- ardit33 4y agoNo serious company is using Storyboards. Only toy apps or small companies do, or junior devs. SwiftUI might be ok for them as well.
- spideymans 4y agoI find that SwiftUI is fantastic for small, self-contained views, that don’t have any complex custom behaviour, and don’t deal with navigation logic. For anything more complex that that, I’d strongly urge falling back to UIKit
- ardit33 4y agoAgreed... it is not ready to be prime time yet. UIKit is still unbeatable for more serious apps. At this pace it might take few more years of dev for SwiftUI to reach feature parity.
- viktorcode 4y agoI concluded from experience that it always pays off to keep views separate from any logic except the bare minimum required for presenting the data on screen. This works regardless of UI framework.
- spideymans 4y agoAre you describing MVVM? If so, I completely agree.
- secretsatan 4y agoI concur, recruiting now and everyone wants to use swift ui, but uikit, horrible as it is, is the only option for our complex ui
- LeoNatan25 4y agoWhat is “horrible” about UIKit or AppKit, other than them not being the latest sexy fad?
- deleted 4y ago[deleted]
- gardaani 4y agoUIKit's constraint-based layout system isn't as easy as SwiftUI's layout system. SwiftUI layout system is similar to the CSS layout system, so it's easier to learn.
- adamnemecek 4y agoThis big thing for me about SwiftUI is that it makes not using xibs a thing of the past. Like there’s value to it even if your app is just NSViewRepresentables (or UIViewRepresentables).
- deleted 4y ago[deleted]
- keyle 4y agoFor someone who casually makes Swift apps, how can I keep up to date? 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.
- mrtesthah 4y agoThis is becoming true for maintaining any Mac app nowadays, if only in terms of Apple's security theater "features" and arbitrary restrictions which randomly break apps that had worked fine for over a decade. Want to enumerate mounted disks or read a file from the user's Documents folder? Guess again. Meanwhile there are still more zero-days in the OS itself than ever.
- keyle 4y agoThis is exactly my point. The walled garden of Apple is riddled with developers' head on pikes.
- 1123581321 4y agoSwiftUI is only a couple years old. That would be like PHP templating ossifying around the turn of the century. 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.)
- afro88 4y agoIf you're interested in SwiftUI and care about feature composability, decent test coverage, dependency injection, isolated side effects, functional core and being able to use live previews properly, take a look at: https://github.com/pointfreeco/swift-composable-architecture https://github.com/pointfreeco/swift-composable-architecture 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 https://www.pointfree.co/collections/composable-architecture
- ChildOfChaos 4y agoIntreasting read this thread. 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!