This feels closer to how app building should work. If I have a web app, it should be simple to give it an icon, with notifications.
And if I want to build that, I shouldn't have to figure out all of XCode. I should be able to just quickly make a webview with native controls.
And I shouldn't need to download all of electron. An OSX webview should only need a few kb as a standalone app.
I don’t mean to sound overly negative but for small shops or individual developers there is simply no way for them to create a web, Mac and Windows version of their app at the same time. Personally, I’m glad that the likes of Electron give them the option. I’d much prefer a fully native version but I’d take Electron over nothing. You’re free to disagree of course, but no one is forcing you to install these things on your computer.
The problem this solves is that web apps don't have (1) cmd-tab icons or (2) decent notifications. And it does that without using "cross-platform tools" or "electron". That's why it's cool.
The closer analogy here is the iOS ecosystem, where folks ship apps that are really just Safari WebViews inside an app icon, and who would probably be perfectly happy to ship a PWA if users weren't thoroughly trained to use the AppStore.
what’s the best cross-platform strategy?
The swift-only, programmatic approach without Xcode or the typical app framework is very cool! Assembling those parts seems like a great learning experience.
(More interesting to me than the actual functionality)
> NSMakeRect/NSMakePoint
Generally I prefer the actual constructors.
> NSWindow.BackingStoreType.buffered/NSApplication.ActivationPolicy.regular
You can just use .buffered/.regular.
> let _ = NSApplication.shared
Just _ = NSApplication.shared works: https://github.com/saagarjha/DarkNight/blob/0e3aef8559b634ce...
> Rizwan Sattar wrote a neat workaround that monkey-patches NSBundle, which I’ve translated to Swift 4 below
Don't do this, it will stop working (crash!) once you update your Swift version and the compiler is smart enough to start making direct calls. As far as I am aware, this is the correct way to do it: https://github.com/saagarjha/DetailsViewer/blob/master/Detai...
One thing I've always wanted is a Chrome plugin to redirect links into a dedicated fluid application.
[0] https://developer.apple.com/download/more/ (you'll need an AppleID)
[1] https://buck.build/setup/getting_started.html
[2] https://www.jetbrains.com/appcode/
* edit: formatting & it looks like Buck doesn't have macOS targets.
https://news.ycombinator.com/item?id=23277219
Very cool project, thanks.
edit: oh I see... single notifications and simple switcher. OK, seems reasonable enough
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --app=https://web.whatsapp.com --kiosk