-
-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Description
We have problems with the following code:
var RootViewController = UIViewController.extend({
viewDidLoad: function() {
UIViewController.prototype.viewDidLoad.apply(this, arguments);
var label = new UILabel(CGRectMake(0, 0, 250, 60));
label.text = "Hello, World!";
label.center = this.view.center;
label.textAlignment = NSTextAlignment.NSTextAlignmentCenter;
UIView.animateWithDurationDelayOptionsAnimationsCompletion(3, 0, UIViewAnimationOptionCurveEaseIn, function() {
console.log("Set animation 1 properties");
label.transform = CGAffineTransformMakeRotation(1);
UIView.animateWithDurationDelayOptionsAnimationsCompletion(3, 0, UIViewAnimationOptionCurveEaseOut, function() {
console.log("Set animation 2 properties");
UIView.setAnimationRepeatCount(3);
label.alpha = 0.2;
}, function() {
console.log("Animation 2 Completed!");
})
}, function() {
console.log("Animation 1 Completed!");
});
this.view.addSubview(label);
}
});
var AppDelegate = UIResponder.extend({
applicationDidFinishLaunchingWithOptions: function(application, launchOptions) {
this._window = new UIWindow(UIScreen.mainScreen().bounds);
this._window.backgroundColor = UIColor.whiteColor();
this._window.rootViewController = new RootViewController();
this._window.makeKeyAndVisible();
return true;
}
}, {
protocols: [ UIApplicationDelegate ]
});
UIApplicationMain(0, null, null, NSStringFromClass(AppDelegate.class()));