As seen on AgilityFeat's Blog
iOSify - HTML/CSS/JS to Objective C
This is a boilerplate which offers a way to develop an HTML 5 app and later package it in such a way that it is usable in iOS using the
WKWebView Objective C view controller.
How it works
Develop your app within the
src folder. When ready fire up iOSify's grunt task et voilá, you get a header file and an Objective C class automagically generated within the
Be sure you have
NodeJS and the npm package
grunt-cli installed beforehand.
Details on how to install these packages can be found here:
Once you have NodeJS and Grunt installed, navigate to the root of this package and run from your terminal:
$ npm install
You should see details of the dependencies being installed.
Once the install command finishes executing you are ready to iOSify to your heart's content.
iOSifying all the things
iosify.js and change the variable
class_name to be the name you want the generated Objective C class to have.
For example change
var class_name = 'MyCube';
var class_name = 'OrganicBananaGame';
Then, simply navigate to the root folder of this package and run the following command:
Yes, it's that easy! Now you will find the generated
OrganicBananaGame.m files inside the
Be sure your app's main html file is called
index.html. To change this behavior you'll have to edit the