4 ms·
From the Conceptual Overview [1] > The gomatcha.io/bridge package handles the interface between Objective-C and Go. Go values become MatchaGoValue in Objective
by alfonsodev 9y ago
From the Conceptual Overview [1]
> The gomatcha.io/bridge package handles the interface between Objective-C and Go. Go values become MatchaGoValue in Objective-C, and Objective-C values become *bridge.Value in Go. Methods and functions can then be called on these objects using reflection.
Does this mean that you can call any of the Objective-c frameworks from Go lang side? if so, and if working well that would be a huge improvement compared with react-native.
- jd20 9y agoLooking at the examples for calling ObjC from Go, it looks like you still need a native piece of code to register the ObjC function being called and act as a shim (so same as RN I think). Looking at it from another perspective, there's a practical difficulty to being able to dynamically invoke any ObjC function from Go: the ObjC compiler would still need to know what libraries to link, and header files to include.
- overcyn 9y agoThe reflection is limited to calling methods on objects. So it would be difficult to directly interface with Apple frameworks. You couldn't build closures or respond to delegate callbacks for example.
- alfonsodev 9y agogood point and that applies for both Objective-c and Swift?