Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: reverse and swift #19830

Open
ghost opened this issue Apr 3, 2017 · 7 comments
Open

x/mobile: reverse and swift #19830

ghost opened this issue Apr 3, 2017 · 7 comments
Labels
Milestone

Comments

@ghost
Copy link

@ghost ghost commented Apr 3, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.8

What operating system and processor architecture are you using (go env)?

x-MacBook-Pro:gosync apple$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/apple/workspace/go"
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wp/ff6sz9qs6g71jnm12nj2kbyw0000gp/T/go-build775985182=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

More a question. Gomobile reverse works well for Android, but i was wondering how to do it for swift.

What did you expect to see?

What did you see instead?

@bradfitz bradfitz modified the milestones: Unplanned, Unreleased Apr 3, 2017
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Apr 3, 2017

As far as I know there is no Swift support, nor anybody working on it.

/cc @eliasnaur

@ghost
Copy link
Author

@ghost ghost commented Apr 3, 2017

I ask because swift is similar to golang and much more modern compared to objective-c. This makes it much easier to use.

https://github.com/golang/mobile/blob/master/internal/importers/objc/objc.go

@eliasnaur
Copy link
Contributor

@eliasnaur eliasnaur commented Apr 4, 2017

Is there a specific problem you're trying to solve that you can't today? Go Mobile only generates ObjC bindings, but I know several projects that have used those with Swift with relative ease (Apple specifically designed Swift to be easy to interface with legacy Obj-C code). Moreover, the way to interface swift with C (and thus, Cgo) is with Obj-C bridges anyway; as far as I know, Swift doesn't interface with C directly.

@ghost
Copy link
Author

@ghost ghost commented Apr 4, 2017

The issue is doing golang to native flow.

I can call from native to golang using the gomobile bind technqiue. That allows me to run a web view for example with a localhost webserver responding.
In the same project i need to call from golang to native using the reverse techniques. For example fire a notification to the user. I can do this with objective c. i am guessing that its possible to mix swift and objective c ?

@eliasnaur
Copy link
Contributor

@eliasnaur eliasnaur commented Apr 4, 2017

@bradfitz bradfitz added the mobile label Jul 20, 2017
@rusenask
Copy link

@rusenask rusenask commented Jan 12, 2018

Hi @gedw99, did you come up with any solution for this?

@ghost
Copy link
Author

@ghost ghost commented Jan 12, 2018

no. i swifted to using flutter for mobile and desktops.
you can access golang from flutter btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.