Skip to content

Instantly share code, notes, and snippets.

@calt
Last active January 9, 2024 05:58
Show Gist options
  • Save calt/7ea29a65b440c2aa8a1a to your computer and use it in GitHub Desktop.
Save calt/7ea29a65b440c2aa8a1a to your computer and use it in GitHub Desktop.
UITabBar with custom height in Swift, does not work for iOS 14 or later.
// Does not work on iOS 14.0 or later, keeping the gist just for reference.
extension UITabBar {
override open func sizeThatFits(size: CGSize) -> CGSize {
super.sizeThatFits(size)
var sizeThatFits = super.sizeThatFits(size)
sizeThatFits.height = 71
return sizeThatFits
}
}
@ardacmen
Copy link

ardacmen commented Apr 12, 2023

@Wei18 thank you! still working for swift 5+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment