News for hackers. Stuff that matters.

Ask HN: hybrid app framework for an app that runs on iOS and Mac

I'm looking to build an app that will work on both iOS and Mac. Android and Windows support isn't needed.

What hybrid app frameworks exist for this purpose? Most of the ones I've heard of are moblie + mobile (iOS + Android) or desktop + desktop (Mac + Windows), not mobile + desktop.

I prefer to code in Swift, since I need access to a few platform APIs, and since I'm very comfortable with it, and with iOS APIs as well, more than HTML/CSS/JS.

It's a simple utility app, with a few screens, not performance-sensitive. Thanks.

( 9 comments | 5 points | on HN )
Re:Ask HN: hybrid app framework for an app that runs on iOS ... by bigmanwalter on Friday June 09, 2017 @09:39AM (#14521251)
I know you said no HTML, bit IMO it's the only way to do cross platform well.

I'm a big fan of Ionic, especially now that they released their Drag and Drop UI editor at https://creator.ionic.io/.

Re:Ask HN: hybrid app framework for an app that runs on iOS ... by kartickv on Saturday June 10, 2017 @02:49AM (#14526421)
Thanks. Please see https://news.ycombinator.com/item?id=14526419 for the problem with the web.

Maybe I'll just end up writing two separate apps in Swift.

Re:Ask HN: hybrid app framework for an app that runs on iOS ... by bigmanwalter on Tuesday June 13, 2017 @09:05AM (#14544408)
In the case of Ionic it uses Cordova to give access to native APIs. Even better, it provides a JS wrapper so that there is a common interface for both systems and you only need to write your code once!
Re:Ask HN: hybrid app framework for an app that runs on iOS ... by 1123581321 on Friday June 09, 2017 @08:24PM (#14525548)
Look at UIKit clones for Mac. There was one called Blueprint a few years ago. I'm not sure of the state of the art now.

A Mac app starter kit (icon management, menu, upgrading, etc.) With the iOS app ported in with a UIKit clone should get you what you want with much better performance than a web/JS-based solutio ln that will compromise your iOS app.

Re:Ask HN: hybrid app framework for an app that runs on iOS ... by isubkhankulov on Friday June 09, 2017 @02:36AM (#14519558)
afaik you can use swift for both mac and iOS however they're different platforms so there won't be 100% overlap. have you considered building a web app? you can run it in the browser on both desktop and mobile. you can also use a cordova based framework to wrap it in an app for the app store.
Re:Ask HN: hybrid app framework for an app that runs on iOS ... by kartickv on Saturday June 10, 2017 @02:48AM (#14526419)
Thanks, but I need access to some system APIs. Now, I can always bridge them to the web, with two implementations, one for iOS and one for macOS, but that seems like doing the framework's work myself. If I do that, I might as well do the whole thing in Swift.

Is there anything I'm missing?

Re:Ask HN: hybrid app framework for an app that runs on iOS ... by chris__butters on Friday June 09, 2017 @09:42AM (#14521268)
I agree, phonegap might be the best best for cross platform hybrid apps but doesn't officially cover desktop, although it shouldn't be too difficult to port it to use electron instead https://electron.atom.io
Re:Ask HN: hybrid app framework for an app that runs on iOS ... by kartickv on Friday June 09, 2017 @10:13PM (#14525831)
Electron is desktop-only, isn't it? I need to support iOS and Mac. Thanks.
Re:Ask HN: hybrid app framework for an app that runs on iOS ... by gspyrou on Friday June 09, 2017 @03:05AM (#14519642)