KarimEbrahemAbdelaziz / SwiftyMenu

Simple and Elegant Drop down menu for iOS 🔥💥
MIT License
577 stars 56 forks source link

SwiftyMenu/SwiftyMenu.swift:410: Fatal error:Unexpectedly found nil while implicitly unwrapping an Optional value #46

Open JidongHe opened 4 months ago

JidongHe commented 4 months ago

In my project,I try init this menu by code and by storyboard , all of them clash when self.willExpand() in the file from pods. my code is `func setupMenu(){

    dropList.delegate = self
    dropList.items = sortTypeItems

    dropList.configure(with: menuAttributes)
    dropList.willExpand = {
        print("****SwiftyMenu Code Will Expand!****")
    }
}` 

and terminal print "SwiftyMenu Code Will Expand!" successful,then next second,project get clash

KarimEbrahemAbdelaziz commented 4 months ago

Hello @JidongHe ,

May I know what is the usecase for using delegate and closures at the same time?

I would recommend using only one approach if possible for now. And can you please share the full setup if?

Thank you.