From 6c60c83512c7c93966efef2f95441e4c589fb908 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 13 Jun 2014 14:54:38 +0300 Subject: [PATCH] readme updated --- application/Readme.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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