How can I set UIButton image, which Image is round shape with border I write related code but image not displaying in proper round shape.. Here is my code..
if you want second type of output you should decrease the size of image.( eg 32x32 or 40x40) and instead of doing
btnMyProfile.imageView?.layer.cornerRadius = (btnMyProfile.imageView?.frame.width)! / 2
you should do
btnMyProfile.imageView?.layer.cornerRadius = image.size.width / 2
the rest of your code seems OK..