Click on buttons not work on ios11
Closed this issue · 4 comments
Hi, nice framework! The animation works fine but click on other 5 buttons not work. The func igcMenuSelected is not called. I´ve copy your code 1to1 but the func is not called.
Any ideas?
Thanks for support!
Make sure that you set delegate
.
Yes i think i am sure that all is correct but not working. I use an new empty ViewController:
import IGCMenu
class testingMenuVC: UIViewController, IGCMenuDelegate {
var igcMenu: IGCMenu?
var menuIsOpen = 0
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var menuViewBtn: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
setupMenu()
}
func setupMenu() {
igcMenu = IGCMenu()
igcMenu?.menuButton = self.menuViewBtn
igcMenu?.menuSuperView = self.view
igcMenu?.disableBackground = true
igcMenu?.numberOfMenuItem = 3
//igcMenu?.backgroundType = .BlurEffectDark // THIS CODE SHOW ERROR TOO
igcMenu?.menuItemsNameArray = ["Btn1", "Btn2", "Btn3"]
let homeBackgroundColor = UIColor(colorLiteralRed: (255/255.0), green: (177/255.0), blue: (94/255.0), alpha: 1.0)
let searchBackgroundColor = UIColor(colorLiteralRed: (255/255.0), green: (139/255.0), blue: (7/255.0), alpha: 1.0)
let favoritesBackgroundColor = UIColor(colorLiteralRed: (255/255.0), green: (177/255.0), blue: (94/255.0), alpha: 1.0)
igcMenu?.menuBackgroundColorsArray = [homeBackgroundColor, searchBackgroundColor, favoritesBackgroundColor]
igcMenu?.delegate = self
}
func igcMenuSelected(selectedMenuName: String, atIndex index: Int) {
UIAlertView(title: "", message: "(selectedMenuName) at index (index) is selected.", delegate: nil, cancelButtonTitle: "Ok").show()
}
@IBAction func testClick(_ sender: Any) {
if(self.menuIsOpen == 0){
self.menuIsOpen = 1
igcMenu?.showCircularMenu()
}else{
self.menuIsOpen = 0
igcMenu?.hideCircularMenu()
}
}
}
Any ideas?
Problem is with the delegate method name in Swift delegate method will be
func igcMenuSelected(_ selectedMenuName: String!, at index: Int) {
UIAlertView(title: "", message: "(selectedMenuName) at index (index) is selected.", delegate: nil, cancelButtonTitle: "Ok").show()
}
and replace this line
igcMenu?.backgroundType = .BlurEffectDark
with
igcMenu?.backgroundType = BlurEffectDark
Really nice ! Thank you so much it works now! Little chance in UIAlertView message: "("+String(selectedMenuName)+") at index ("+String(index)+") is selected."
but now all works fine.