I am using single button to display login fields. If we click once, login view move left side, and sign up view will display, then, if we click again, sign up view will move right side, login view will display. My coding is below. But Animation is not working. Kindly guide me.
var bottom_click : Bool = true
@IBAction func not_member_button(sender: UIButton) {
if(bottom_click == false) {
UIView.animateWithDuration(0.7, delay: 0.0, options: .CurveEaseOut, animations: {
self.login_view.frame = CGRectMake(16, 150, 288, 187)
self.crea_acc_view.frame = CGRectMake(370, 150, 288, 245)
}, completion: { finished in
//println("Basket doors opened!")
})
sender.titleLabel?.text = "Not a member? Sign Up" //Its not working. If we delete this, animation is working
bottom_click = true
}
else {
UIView.animateWithDuration(0.7, delay: 0.0, options: .CurveEaseOut, animations: {
self.login_view.frame = CGRectMake(-500, 150, 288, 187)
self.crea_acc_view.frame = CGRectMake(16, 150, 288, 245)
}, completion: { finished in
//println("Basket doors opened!")
})
sender.titleLabel?.text = "Already member? Login" // Its is not working. If we delete this, animation is working
bottom_click = false
}
}