6 ms·
As someone who has used several cross-platform frameworks (Titanium, Cordova/PhoneGap, investigating Xamarin), I have a question about going "full native": how
by bmj 13y ago
As someone who has used several cross-platform frameworks (Titanium, Cordova/PhoneGap, investigating Xamarin), I have a question about going "full native": how do you handle shared core code? Our app has an engine that drives the business logic, and the cross-platform frameworks have been useful because we don't have to deal with modifying the core codebase for different platforms [0]. Is it possible to create platform-agnostic libraries that can be shared?
[0] Despite the many claims of "cross-platform UIs," we have many cases in our UI layer of doing different things on different platforms.
- untog 13y agoIf have read before that C++ can be used to share logic. An interesting development with iOS7 is that it has a JavaScript runtime of some sort (I don't know the details) - perhaps it will be possible to use JS for cross-platform code.
- notjosh 13y agoYou're thinking of JavaScriptCore. It allows Objective-C objects to be used inside of JavaScript (and vice versa). It's actually a pretty cool technology. I gave a talk about it this month at Berlin CocoaHeads, and I'm gonna put some blog posts together about it soon!
- mattgreenrocks 13y agoI presume the JSCore runtime bridges objects back and forth? Very cool!
- tluyben2 13y agoXamarin is great for sharing code. You just rewrite the GUI layer per platform. It's great, cannot really say it any differently.
- CmonDev 13y agoAnd that GUI layer could be just Views in the end, since it seems you can even re-use ViewModels/Controllers.
- mattgreenrocks 13y agoThis is the exact use case for Hexagonal/Clean Architecture: http://blog.groupbuddies.com/posts/20-clean-architecture http://blog.groupbuddies.com/posts/20-clean-architecture It is contentious on HN, but I implore you to draw your own conclusions.