diff --git a/application/Readme.md b/application/Readme.md index 0a2283a2b..c5c581225 100644 --- a/application/Readme.md +++ b/application/Readme.md @@ -2,4 +2,30 @@ ```js var appModule = require("application"); appModule.init([native app instance]); +``` + +iOS example: +```js +var app = require("application"); + +var MyViewController = UIKit.UIViewController.extends({ + viewDidLoad: function() { + this.title = "Home"; + + var bm = require("ui/button"); + var button = new bm.Button(); + button.text = "test"; + button.ios.frame = Foundation.CGRectMake(100, 100, 100, 40); + button.on("click", function(arg){ + require("ui/dialogs").alert("Some message"); + }); + button.addToParent(this.view); + } +}); + +app.onLaunch = function(){ + return new MyViewController(); +} + +app.init(); ``` \ No newline at end of file