Swift -Tabbar item frame is returning questionable value when converting frame to window
问题 I have a tabBar with 5 items. To get the frame of the first tabBar item and set something based on that frame I use this which works perfectly: guard let firstTab = tabBarController?.tabBar.items?[0].value(forKey: "view") as? UIView else { return } guard let window = UIApplication.shared.windows.filter({$0.isKeyWindow}).first else { return } let windowRect = lastTab.convert(firstTab.frame, to: window) print(firstTab) // (2.0, 1.0, 79.00000000298023, 48.0) print(windowRect) // (4.0, 689.0, 79