Closed HackShitUp closed 7 years ago
Yes, you can easily overlay IGCMenu on UITableViewController. You have to just add button on controller view and make sure to bring button on top as
[self.view bringSubviewToFront:menuButton];
and it will work as expected.
@sunilsharma08 it's not working, I think I'm initializing the button wrong? (I don't have a UIButton in the storyboard).
You have to add button either in storyboard or programmatically and the pass the button reference to IGCMenu property menuButton
as
igcMenu.menuButton = yourMenuButton;
This library does not make the bottom center button.It takes reference of your button and draws menu from that.
Ok, I got it to show the menu button's options (ie: buy, home, etc.), but the menuButton doesn't appear even though I initialized it programatically. Here's the code:
var menuButton: UIButton!
Then in viewDidLoad():
menuButton = UIButton()
menuButton.frame = CGRectMake(UIScreen.mainScreen().bounds.size.width/4, 100, 375, 667*1.25)
For IGCMenu...
//Pass refernce of menu button igcMenu.menuSuperView = UIApplication.sharedApplication().keyWindow!
// Bring to sub view UIApplication.sharedApplication().keyWindow!.bringSubviewToFront(menuButton)
I'm only using UIApplication.sharedApplication().keyWindow because this app already has UITabBarController in it.
I think you forgot to add menu button to key window and add menu button in viewWillAppear
not in viewDidLoad
as
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
UIApplication.sharedApplication().keyWindow?.addSubview(menuButton)
}
and in you are making button size really very big CGRectMake(UIScreen.mainScreen().bounds.size.width/4, 100, 375, 667*1.25)
so in some device the button will cover whole screen. Try with small menu button size
CGRectMake(UIScreen.mainScreen().bounds.size.width/2 - 30, UIScreen.mainScreen().bounds.size.height - 80 , 60, 60)
This is awesome. But is it possible to overlay this on a UITableViewController?