I having trouble in understanding First Responder. My Understanding is as follows.
First Responder is the first object in the responder chain which gets first oppurtunity to handle Any UIEvent.
UIKit starts finding the location of the tap. It uses a hit test API of the UIView that traverses to the deepest level of the hierarchy to find the specific touch. After finding the view, it assigns the first responder of the touch event to that view.
So when we find the view on which touch occurs then checking isFirstResponder to that view is still false. Can someone explain me? Why isFirstResponder still holding false? Even if this is the first view whose touch began is calling.
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
if touches.first?.view?.isFirstResponder == true {
print("Top View is firstResponder ")
}
super.touchesBegan(touches, with: event)
}
I have checked with the above code by overriding this method on top view which added on UIViewController View.