Created
September 23, 2019 07:30
-
-
Save cyrilchandelier/6927afab653608e536a17b44ffc04d07 to your computer and use it in GitHub Desktop.
A Swift UIButton extension to ensure the hit-zone is at least 44x44
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I guess you should apply inset divided by two to get a 44 x 44 square
let expandedBounds = bounds.insetBy(dx: min(bounds.width - 44.0, 0) / 2, dy: min(bounds.height - 44.0, 0) / 2)