Strange animation


#21

Hi ravenshore

Thank you for all!!

I found it!!

Storyboards Label works!!!

Super!! Thank you very much!!!

import UIKit

class ViewController: UIViewController {
var Label1: UILabel!

@IBOutlet weak var Label2: UILabel!

var whichTap: Int = 0

override func viewDidLoad() {
    super.viewDidLoad()
    
    
    // Do any additional setup after loading the view, typically from a nib.
    println("Halo-halo-halo")
    
    Label1 = UILabel()
    
    //addLabel()
    
    var tapGesture = UITapGestureRecognizer(target: self, action: Selector("handleTapGesture:"))
    view.addGestureRecognizer(tapGesture)

    
    
    }


func handleTapGesture(sender: UITapGestureRecognizer){
   println("taptup")
    
    addLabel()
}



func addLabel(){
   
    Label1.text = "My first"
    Label1.font = UIFont.systemFontOfSize(36)
    
    Label1.sizeToFit()
    //Label1.drawRect(CGRectMake(200, 80, 150, 70))?
    Label1.center = CGPoint(x: 100, y: 40)
    view.addSubview(Label1)
    
    UIView.animateWithDuration(0.5, delay: 0.0, usingSpringWithDamping: 0.9, initialSpringVelocity: 0.0, options: nil, animations: {
        self.Label1.center = CGPoint(x: 100, y: 40 + 200)
    }, completion: nil)

    
   
    Label2.alpha = 0
    Label2.center = CGPoint(x: 200, y: 90)
    
    UIView.animateWithDuration(2.0, delay: 0.5, usingSpringWithDamping: 0.2, initialSpringVelocity: 0.0, options: nil, animations: {
        self.Label2.center = CGPoint(x:UIScreen.mainScreen().bounds.width/2, y: UIScreen.mainScreen().bounds.height/2)
        self.Label2.alpha = 1
        }, completion: nil)

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
    println("Welcome")
}
}

Thank you!!!