exyte / fan-menu

Menu with a circular layout based on Macaw
MIT License
728 stars 58 forks source link

Change center button image on click on it. #43

Closed Gagan6696 closed 5 years ago

shipinev commented 5 years ago

Hi @Gagan6696. If you want to change the menu button image on the user tap event, first of all, you need to update FanMenuButton model and switch image property to a variable. Since you always know the menu button identifier, you can use onItemDidClick event handler, i.e.:

fanMenu.onItemDidClick = {
    if $0.id == "main" {
        $0.id = UIImage(named: "icon-name")
    }
}