Hacker News new | ask | show | jobs
by kainosnoema 4036 days ago
It may not always be better since you'll likely never be able to call from Go into Cocoa libs, but if you can write a shared library and use it on the server, iOS and Android, then it's a big win. Linking a Swift app against the shared Go library and calling directly from Swift into Go sounds pretty great to me.
2 comments

>call from Go into Cocoa libs

It can be done, thus:

    #cgo LDFLAGS: -Wl,-U,_iosmain,-U,_PopUpDialogBox


Any developer who wants to do this needs only to create these #cgo statements for whatever Cocoa API they want to use, and they become available from the Go context ..
> It may not always be better since you'll likely never be able to call from Go into Cocoa libs

IIRC, Go can call any Objective-C code through cgo.