OfTheWolf / TwitterProfile

Nested scrolling with pager just like in Twitter and Instagram profile.
MIT License
266 stars 45 forks source link

Tap geustrue of UIView back button is not fired #13

Closed dobiho5 closed 4 years ago

dobiho5 commented 4 years ago

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)
}
OfTheWolf commented 4 years ago

@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 commented 4 years ago

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