Use a UITabBar without UITabBarController to control a UIWebView

前端 未结 4 1635
说谎
说谎 2020-12-14 13:12

I want to use a UITabBar to let the user navigate a single UIWebView. Is this possible or would I be better off using a UIToolbar? If

4条回答
  •  醉梦人生
    2020-12-14 13:16

    I had to add in the viewDidLoad() function the reference for the delegate:

    self.tabBar.delegate = self
    

    Otherwise the function func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) would never be called.

提交回复
热议问题