cornerRadius - One for all

PHOTO EMBED

Sun Apr 07 2024 05:59:48 GMT+0000 (Coordinated Universal Time)

Saved by @Saurabh_Lodhi #swift

import UIKit

struct Utility{
    
    static func setCornerRadius(to anyObject: AnyObject,_ cornerRadius: CGFloat, _ borderWidth: CGFloat, _ borderColor: UIColor){
        anyObject.layer.cornerRadius = cornerRadius
        anyObject.layer.borderWidth = borderWidth
        anyObject.layer.borderColor = borderColor.cgColor
    }
    
}
content_copyCOPY

Gives corner radius to anyObject like UIView, UIButton, UITableView, UICollectionView etc