korhan-Ö
11/5/2016 - 8:23 AM

#ButtonAction.c

let tap1: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: "tapYakinimdaButtonAction")
yakinimdaBtn.buttonBt.addGestureRecognizer(tap1)


func tapYakinimdaButtonAction() {
        
        UIView.animateWithDuration(0.2, animations: {
            
            //code
            self.yakinimdaBtn.imageView.alpha=0.5
            self.yakinimdaBtn.labelLb.alpha=0.5
            
            self.yakinimdaBtn.imageView.transform = CGAffineTransformMakeScale(1.25, 1.25)
            self.yakinimdaBtn.labelLb.transform = CGAffineTransformMakeScale(1.25, 1.25)
            
            }
            ,completion: {finished in
                
                UIView.animateWithDuration(0.1, animations: {
                    
                    self.yakinimdaBtn.imageView.alpha=1.0
                    self.yakinimdaBtn.labelLb.alpha=1.0
                    
                    //code
                    self.yakinimdaBtn.imageView.transform = CGAffineTransformMakeScale(1.0, 1.0)
                    self.yakinimdaBtn.labelLb.transform = CGAffineTransformMakeScale(1.0, 1.0)
                    
                    }, completion: {finished in
                
                self.performSegueWithIdentifier("loadingPageToYakinimdaPush", sender: nil)
                })
                
        })
    }
yakinimdaBtn.buttonBt.addTarget(self, action: "tapYakinimdaButtonAnimation", forControlEvents: .TouchDown)

    func tapYakinimdaButtonAnimation() {
        
        UIView.animateWithDuration(0.2, animations: {
            
            //code
            self.yakinimdaBtn.imageView.alpha=0.5
            self.yakinimdaBtn.labelLb.alpha=0.5
            
            self.yakinimdaBtn.imageView.transform = CGAffineTransformMakeScale(1.25, 1.25)
            self.yakinimdaBtn.labelLb.transform = CGAffineTransformMakeScale(1.25, 1.25)
            
            }
            ,completion: {finished in
                
                UIView.animateWithDuration(0.1, animations: {
                    
                    self.yakinimdaBtn.imageView.alpha=1.0
                    self.yakinimdaBtn.labelLb.alpha=1.0
                    
                    //code
                    self.yakinimdaBtn.imageView.transform = CGAffineTransformMakeScale(1.0, 1.0)
                    self.yakinimdaBtn.labelLb.transform = CGAffineTransformMakeScale(1.0, 1.0)
                    
                    })
                
        })
    }