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.
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.
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