My issue was a bit different.
While I did do btn.clipsToBounds = true
I wasn't setting doing:
btn.layer.cornerRadius = 20
Because I had different screen sizes. Instead I followed this answer and did:
override func layoutSubviews() {
seeMoreButton.layer.cornerRadius = seeMoreButton.bounds.size.height / 2
}
It wasn't working because I forgot to add super.layoutSubviews()
. The correct code is:
override func layoutSubviews() {
super.layoutSubviews()
seeMoreButton.layer.cornerRadius = seeMoreButton.bounds.size.height / 2
}