Skip to content

iCoder86/MenuAnimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

MenuAnimation

@IBAction func toggleMenuButton(_ sender:UIButton?) {
    if btnMenu.tag == 0 {
        self.btnMenu.tag = 1
        UIView.animate(withDuration: 0.3, animations: {
            self.btnShuffel.center = self.btnMenu.center
            self.btnFavorite.center = self.btnMenu.center
            self.btnRepeat.center = self.btnMenu.center
            
            self.btnShuffel.alpha = 0
            self.btnFavorite.alpha = 0
            self.btnRepeat.alpha = 0
        })
    }
    else {
        self.btnMenu.tag = 0
        UIView.animate(withDuration: 0.3, animations: {
            self.btnShuffel.center = self.btnShuffelPosition
            self.btnFavorite.center = self.btnFavoritePosition
            self.btnRepeat.center = self.btnRepeatPosition
            
            self.btnShuffel.alpha = 1
            self.btnFavorite.alpha = 1
            self.btnRepeat.alpha = 1
        })
    }
}

Reference

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages