I am using custom tab bar without controller. Here is the code I use to detect when item is selected.
func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) {
switch(item.tag) {
case 1:
// do something
case 2:
// do something
case 3:
// do something
default:
return
}
}
My problem is that I have to press a bit longer to select an item. It does not recognize simple click like button click. Anyone know how to solve it.
Thank you for any suggestion or idea.
I faced similar problem in UIScrollView or UITableView. If your tab bar is within any of these controls deselect property "delaysContentTouches" in interface builder
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.