-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to closed when in tap outside ? #75
Comments
At the moment there is no such possibility. |
@smart-technology Shouldn't be too difficult to implement this feature yourself. Just register a tap recognizer in your view controllers which triggers |
My solution for this. I've added the following code in ENSideMenu.swift main init: and adjust the menu width and animation like this: public convenience init(sourceView: UIView, menuViewController: UIViewController, menuPosition: ENSideMenuPosition) { func updateFrame() { private func toggleMenu (shouldOpen: Bool) { I hope its help! |
@pappzsolt100 your solution is not perfect and so complex. Quick workaround, but it's not clear too: outterView = UIView(frame: CGRectMake(sideMenuContainerView.frame.width, 0,
sourceView.frame.width - sideMenuContainerView.frame.width,
sourceView.frame.height))
outterView.backgroundColor = UIColor.clearColor()
let tapRecognizer = UITapGestureRecognizer(target: self, action: "hideSideMenu")
outterView.addGestureRecognizer(tapRecognizer)
outterView.userInteractionEnabled = false
sourceView.addSubview(outterView) and change user interaction of outerView in private func toggleMenu (shouldOpen: Bool) {
outterView.userInteractionEnabled = shouldOpen it's all ! |
Works great! |
@PankovSerge it works fine. Thanks. |
@PankovSerge where does your code go in to? |
@lakhshya Where did you put this code? |
Define outterView in ENSideMenu Add @PankovSerge 's code in the public init of ENSideMenu |
@lakhshya WORKS PERFECT! thankyou. |
i can't click on item over outterView. I use .removeView method, but its work only one time. |
Thank you..its WORK!!! |
The solution of @PankovSerge works perfectly. Just in case if you have modified the width of ENSideMenu like
again in the end of |
Thanks @zishanj !! 👍 |
Swift 3.0 with animated dimming
and in toggleMenu
|
Where I put this code in this class pls :import UIKit public protocol ENSideMenuDelegate: class { public protocol ENSideMenuProtocol: class { public enum ENSideMenuAnimation : Int {
public extension UIViewController {
} open class ENSideMenu : NSObject, UIGestureRecognizerDelegate {
} extension ENSideMenu: UIDynamicAnimatorDelegate { |
hi how i can close menu when in tap outside menu ?
The text was updated successfully, but these errors were encountered: