Created
February 28, 2020 17:24
-
-
Save bergusman/e061a8d5b22df6aed79389e444b5ebdd to your computer and use it in GitHub Desktop.
UITabBar with custom height
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TabBar: UITabBar { | |
override func sizeThatFits(_ size: CGSize) -> CGSize { | |
guard let window = UIApplication.shared.keyWindow else { | |
return super.sizeThatFits(size) | |
} | |
var sizeThatFits = super.sizeThatFits(size) | |
sizeThatFits.height = 58 + window.safeAreaInsets.bottom | |
return sizeThatFits | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment