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\
Swift 5:
Just put this in your View Controller that handles your tabBar.
guard let tab1frame = self.tabBar.items![0].value(forKey: "view") as? UIView else {return}
then use like so:
let tab1CentreXanc = tab1frame.centerXAnchor
let tab1CentreY = tab1frame.centerYAnchor
let tab1FRAME = tab1frame (centerX and Y and other parameters such as ".origins.x or y"
Hope that helps.
If you want to reference the parameters from other tabs, just change the index from [0] to whatever you want