Bridge ObjectiveC and Swift classes and structs with JavaScript using JXKit
.
Browse the API Documentation.
Formalize threading model.
JXContext
.Support mode in which all JS executes on a given background queue and hops to another queue for native code.
Support native Actors and perform async calls.
Add JXContext.current for native code called from JS.
Support Swift delegates in JavaScript.
I don't think there's any way to get around requiring the developer to write an implementing of the delegate protocol. But we may be able to give her a simple API with which to invoke the corresponding JS code for each delegate callback. E.g.:
func sender(_ sender: Sender, didSomethingWithResult result: Result) -> Return {
return jsDelegate.invoke('senderDidSomethingWithResult', [sender, result]).convey(to: Return.self)
}
Consider a SourceKit plugin option to auto-generate Swift bridging code.
Test enhancing and overriding reflected ObjectiveC API with explicit bridging.
Support ObjectiveC trailing error: NSError**
parameters.
^@
is an object pointer) and convert to a throwing function.Support ObjectiveC delegates in JavaScript.
Support ObjectiveC trailing blocks in JavaScript.
?
).Consider implementing ObjectiveC reflected API using a JavaScript Proxy rather than writing out a full class definition.
link |
Stars: 1 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics