@@ -219,7 +219,7 @@ See the [UICatalog](https://github.com/kishikawakatsumi/JavaScriptBridge/tree/ma
219219You can define custom class in JavaScript.
220220It is needs to interact system provided framework.
221221
222- ` JSB.defineClass(declaration, instanceMembers) ` function defines Objective-C class in JavaScript.
222+ ` JSB.defineClass(declaration, instanceMembers, staticMembers ) ` function defines Objective-C class in JavaScript.
223223Pass the class declaration string to first argument.
224224
225225Second argument is instance method definitions as hash.
@@ -229,19 +229,25 @@ The hash object inclueds function object, each keys are to be used as method nam
229229
230230``` javascript
231231var MainViewController = JSB .defineClass (' MainViewController : UITableViewController' , {
232- viewDidLoad : function () { // Instance Method Definitions
232+ // Instance Method Definitions
233+ viewDidLoad : function () {
233234 self .navigationItem .title = ' UICatalog' ;
234235 },
235236 viewWillAppear : function (animated ) {
236237 self .tableView .reloadData ();
237238 }
239+ }, {
240+ // Instance Method Definitions
241+ attemptRotationToDeviceOrientation : function () {
242+ ...
243+ }
238244});
239245```
240246
241247** Example**
242248
243249``` javascript
244- var MainViewController = JSB .define (' MainViewController : UITableViewController <UITableviewDataSource, UITableviewDelegate>' , // Declaration
250+ var MainViewController = JSB .defineClass (' MainViewController : UITableViewController <UITableviewDataSource, UITableviewDelegate>' , // Declaration
245251// Instance Method Definitions
246252{
247253 viewDidLoad : function () {
@@ -262,6 +268,10 @@ var MainViewController = JSB.define('MainViewController : UITableViewController
262268 var targetViewController = self .menuList [indexPath .row ][' viewController' ];
263269 self .navigationController .pushViewControllerAnimated (targetViewController, true );
264270 }
271+ },
272+ {
273+ // Class Method Definitions
274+ ...
265275});
266276```
267277
@@ -279,7 +289,7 @@ var ControlsViewController = JSB.require('controlsViewController');
279289var WebViewController = JSB .require (' webViewController' );
280290var MapViewController = JSB .require (' mapViewController' );
281291
282- var MainViewController = JSB .define (' MainViewController : UITableViewController' , {
292+ var MainViewController = JSB .defineClass (' MainViewController : UITableViewController' , {
283293 viewDidLoad : function () {
284294 self .navigationItem .title = ' UICatalog' ;
285295 ...
0 commit comments