Ramotion / circle-menu

:octocat: ⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion
https://www.ramotion.com/circle-menu-open-source-iphone-app-development-library/
MIT License
3.44k stars 357 forks source link

Function buttonDidSelected not working #50

Open Malenea opened 6 years ago

Malenea commented 6 years ago

Is not triggering at all?

func circleMenu(_ circleMenu: CircleMenu, buttonDidSelected button: UIButton, atIndex: Int) {
        print("button did select: \(atIndex)")
    }
0ber commented 6 years ago

Demo project works fine screen recording 2018-03-22 at 09 59 am

Malenea commented 6 years ago

Ok so it might be on my side, I'll look into it and make a feedback if ever I find the why. Wich is weird cause the willSelected works like a charm.

Thanks for your reply though.

0ber commented 6 years ago

maybe you forgot set delegate

button.delegate = self 
Malenea commented 6 years ago

Nope delegate was set. Just checked.

I will investigate why and tell you as soon as I find out what I did wrong.

ghost commented 6 years ago

Same issue for me

tusharjindal353 commented 6 years ago

same issue for me

realmtai commented 6 years ago

See CircleMenu.swift:374

        if customNormalIconView != nil && customSelectedIconView != nil {
            DispatchQueue.main.asyncAfter(deadline: .now() + duration, execute: {
                self.delegate?.circleMenu?(self, buttonDidSelected: sender, atIndex: sender.tag)
            })
        }

Well, customNormalIconView and customSelectedIconView can't be nil. It's unclear to me. I'm using ionicons-fonts not images. I can't see the reason why I need to set any images. (https://github.com/Ramotion/circle-menu/commit/7f2a3f8a89f00198d87583cbea2cc642cc99a00b) It might be legacy code form wayback when the delegate methods were introduced or software engineering bureaucracy. Either way, good job Alex.k for making this project possible. Only he could just push a tiny bit further. :p

realmtai commented 6 years ago

🎉🎉🎉