12345678910111213141516171819202122232425262728 |
- //
- // RoundedCorners+ImageView.swift
- // LMS
- //
- // Created by Suraj Kumar Mandal on 03/10/23.
- //
- import Foundation
- import UIKit
- class RoundedTopCornersImageView: UIImageView {
- override class var layerClass: AnyClass {
- return CAShapeLayer.self
- }
-
- override func layoutSubviews() {
- super.layoutSubviews()
-
- let maskLayer = CAShapeLayer()
- maskLayer.path = UIBezierPath(
- roundedRect: bounds,
- byRoundingCorners: [.topLeft, .topRight],
- cornerRadii: CGSize(width: 10.0, height: 10.0) // Adjust the corner radius as needed
- ).cgPath
-
- layer.mask = maskLayer
- }
- }
|