Horje
add top corner radius swift Code Example
add top corner radius swift
extension UIView {
   func roundCorners(corners: UIRectCorner, radius: CGFloat) {
        let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
        let mask = CAShapeLayer()
        mask.path = path.cgPath
        layer.mask = mask
    }
}
add top corner radius swift
let view = UIView()
view.layer.cornerRadius = 10

@available(iOS 11.0, *)
view.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]




1

Related
swift stirng to date Code Example swift stirng to date Code Example
increase the size of the image in Swiftui Code Example increase the size of the image in Swiftui Code Example
set image width and height swiftui Code Example set image width and height swiftui Code Example
center text swiftui Code Example center text swiftui Code Example
add corner radius to uiview swift Code Example add corner radius to uiview swift Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
14