I have a rectangle image (jpg) and want to use it to fill the background of a button with rounded corner in xcode.
I wrote the following:
UIButton *b
Try my code. Here you can set all properties of UIButton like text colour, background colour, corner radius, etc.
extension UIButton { func btnCorner() { layer.cornerRadius = 10 clipsToBounds = true backgroundColor = .blue } }
Now call like this
yourBtnName.btnCorner()