[ios] Expand circle buttons tappable area

By 5pt to not overlap with another buttons (`close` and `share` on the place page screen)

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn
2025-06-20 16:50:13 +04:00
committed by Konstantin Pastbin
parent 87cb0307cf
commit 927299f4a9

View File

@@ -1,5 +1,7 @@
final class CircleImageButton: UIButton {
private static let expandedTappableAreaInsets = UIEdgeInsets(top: -5, left: -5, bottom: -5, right: -5)
private let circleImageView = UIImageView()
override init(frame: CGRect) {
@@ -46,6 +48,11 @@ final class CircleImageButton: UIButton {
circleImageView.layer.cornerRadius = circleImageView.bounds.width / 2.0
}
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
let expandedBounds = bounds.inset(by: Self.expandedTappableAreaInsets)
return expandedBounds.contains(point)
}
func setImage(_ image: UIImage?) {
circleImageView.image = image
}