Skip to content
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

Tap geustrue of UIView back button is not fired #13

Closed
dobiho5 opened this issue Jun 20, 2020 · 2 comments
Closed

Tap geustrue of UIView back button is not fired #13

dobiho5 opened this issue Jun 20, 2020 · 2 comments

Comments

@dobiho5
Copy link

dobiho5 commented Jun 20, 2020

Thanks for your awesome library.

I have a question how to get tap event from view back button on viewController.swift
Simulator_Screen_Shot_-iPhone_Xs-_2020-06-20_at_10_52_37

I made iboutlet for UIView, and get tap gesture. But UIView do not fire tap gesture.

When I put UIView on Headerviewcontroller , it is fired. How can I get this UIView tap gesture fired? Please help me. Thanks in advance.

@IBOutlet weak var viewBackBtn: UIView!

 override func viewDidLoad() {
    super.viewDidLoad()

   viewBackBtn.isUserInteractionEnabled = true
    let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didBackBtnTapped(_ :)))
    tap.numberOfTouchesRequired = 1
    viewBackBtn.addGestureRecognizer(tap)
}
@dobiho5 dobiho5 changed the title view back button is not fired view back button tap geustrue is not fired Jun 20, 2020
@dobiho5 dobiho5 changed the title view back button tap geustrue is not fired Tap geustrue of UIView back button is not fired Jun 20, 2020
@OfTheWolf
Copy link
Owner

@dobiho5
You are right. ContainerVC is in front of it. So You can not tap. You can bring your views to front to be able to tap it.
view.bringSubviewToFront(viewBackBtn)

@dobiho5
Copy link
Author

dobiho5 commented Jun 22, 2020

@OfTheWolf
Wow! It works.
Thanks you for your quick response and great code. I closed issue.

@dobiho5 dobiho5 closed this as completed Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants