wrote method to check if touch in view