I would like to fire an event on touch when a user taps the title of the navigation bar of one of my views.
I'm at a bit of a loss on whether I can access the view of the title of the UINavigationBar in order to wire up a touch event to it.
Is this even possible?
Navbar tersebut disusun sesuai dengan standar borang penilaian Akreditasi Program Studi BAN PT. NavBar berisi informasi yang memudahkan proses akreditasi dimana setiap standar dijadikan menu yang memudahkan sistem pengaksesan informasi secara online tanpa harus mengecek dokumen secara manual.
Back button adalah aplikasi menarik yang berfungsi untuk menambahkan tombol kembali melayang di perangkat Android. Inilah opsi yang bagus jika tombol kembali fisik pada ponsel Anda rusak tetapi fitur-fitur...
You can add a gesture recognizer to be a single tap to the title of the navigation controller. I found that in the navigationBar subviews, the title is the one at index 1, the left button's index is 0 and the right button's index is 2.
UITapGestureRecognizer *navSingleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(navSingleTap)]; navSingleTap.numberOfTapsRequired = 1; [[self.navigationController.navigationBar.subviews objectAtIndex:1] setUserInteractionEnabled:YES]; [[self.navigationController.navigationBar.subviews objectAtIndex:1] addGestureRecognizer:navSingleTap];
and then implement the following somewhere in your implementation.
-(void)navSingleTap
So you can use this for a single tap, or you can implement any gesture recognizer you want on that title.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With