[HN Gopher] Show HN: Create a custom macOS app from a group of w...
       ___________________________________________________________________
        
       Show HN: Create a custom macOS app from a group of websites
        
       Author : hkgumbs
       Score  : 75 points
       Date   : 2020-05-22 18:05 UTC (4 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | toomim wrote:
       | I'm into this. I've wanted to build something like this before,
       | too, but never finished it.
       | 
       | 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.
        
         | aantix wrote:
         | The JS performance in mobile safari is pretty incredible.
         | 
         | What can native do currently that js/html would have difficulty
         | with?
        
           | toomim wrote:
           | Did you read the article? This has nothing to do with mobile.
        
       | archildress wrote:
       | The iOS image recognition, done on-device as I understand it, is
       | one of the coolest things that it seems no one talks about.
        
         | rasen58 wrote:
         | Where does that fit into this macOS app?
        
       | hundchenkatze wrote:
       | This is pretty neat :) I read the blog post[0] about it too, and
       | I definitely feel your multiple chat app pains. I'm curious to
       | hear more about why you avoided Xcode and ViewControllers. In
       | general I know many people dislike Xcode, but I've been doing iOS
       | dev for a while now so I guess I'm used to it (it's a love have
       | situation for me at times)
       | 
       | [0] https://kofi.sexy/blog/multi
        
         | hkgumbs wrote:
         | Thanks! Honestly my reasoning for avoiding XCode is fairly thin
         | --I just hadn't used it before and didn't have it installed
         | when I started. I imagine if I took the time to learn it, it
         | would be fine. But I do also feel a bit weird about how
         | developing for certain platforms requires you to use a specific
         | IDE. I thought that was part of the goal of Swift (vs ObjC),
         | but I may be just reflecting my own biases :)
        
           | jaflo wrote:
           | Did you have experience developing for MacOS before?
        
             | hkgumbs wrote:
             | I built a few Swift CLIs before, but this was my first time
             | working with AppKit (the macOS GUI framework)
        
           | hundchenkatze wrote:
           | Yep the macOS + Xcode dependency is quite annoying. If you
           | want a, kind of, in between solution, the true dependency is
           | on the command-line tools[0]. These can be installed
           | independent of Xcode. You could piece together your own build
           | scripts or use something like Buck[1] to build it. If you
           | still want a full-blown IDE, checkout AppCode[2] from
           | JetBrains. It still depends on the aforementioned
           | commandline-tools though.
           | 
           | [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.
        
           | cerberusss wrote:
           | Recently I wrote a script in Swift, on macOS. It can be
           | developed and run without Xcode, in plain vi if you so wish.
           | It's pretty great, and I liked it a lot.
        
             | hkgumbs wrote:
             | Yup, that was exactly my workflow as well! And for building
             | CLIs it's quite nice. Once I started using AppKit though,
             | it felt like I kept running into things that weren't quite
             | finished.
        
       | jitl wrote:
       | See also the blog post: https://kofi.sexy/blog/multi
       | 
       | 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)
        
         | saagarjha wrote:
         | A couple of nitpicks about the process:
         | 
         | > NSMakeRect/NSMakePoint
         | 
         | Generally I prefer the actual constructors.
         | 
         | > NSWindow.BackingStoreType.buffered/NSApplication.ActivationPo
         | licy.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...
        
       | spilk wrote:
       | Sounds similar to the old Fluid website wrapper for MacOS X (
       | https://fluidapp.com/ )
        
       | tribeca18 wrote:
       | This is really cool! The inspiration behind creating this reminds
       | me of another app too: https://getstack.app
        
       ___________________________________________________________________
       (page generated 2020-05-22 23:00 UTC)