4 ms·
And there's no need to make bridges. Simply access the native API from javascript/typescript
by jbverschoor 8y ago
And there's no need to make bridges. Simply access the native API from javascript/typescript
- k__ 8y agoNativeScript simply binds to all native APIs by default?
- jinglebells 8y agoEffectively yes, but not like that. You can access all native APIs with a marshalling layer which maps Javascript to Objective C or JAVA. For example, when the Javascript parser sees var className = NSStringFromClass(NSArray); The ObjectiveC side executes NSString *className = NSStringFromClass([NSArray class]); Then creates a link between the JS object and the ObjectiveC object. Any methods/properties you access on the JS object, get executed or read from the native component. It's really quite clever and why we use Nativescript to bring corporate apps to market quickly and cross platform while not worrying about the limitations of the Javascript bit, because you can always access the native APIs anyway.
- k__ 8y agoHaha, nice. First time I heared about this killer-feature :D