Getting the frame of a particular tab bar item

前端 未结 12 1046
礼貌的吻别
礼貌的吻别 2021-02-02 07:42

Is there a way to find the frame of a particular UITabBarItem in a UITabBar?

Specifically, I want to create an animation of an image \"falling\

12条回答
  •  旧时难觅i
    2021-02-02 08:06

    Another possible but sloppy solution would be the following:

    guard let view = self.tabBarVC?.tabBar.items?[0].valueForKey("view") as? UIView else 
    {
        return
    }
    let frame = view.frame
    

提交回复
热议问题