for molecularly clipping image

This commit is contained in:
Kevin G Christiano 2020-09-09 16:03:12 -04:00
parent dc3a2c87ab
commit 2adf3b7c4f
2 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import Foundation
public var contentMode: UIView.ContentMode?
public var localBundle: Bundle?
public var cornerRadius: CGFloat?
public var clipsImage: Bool?
public init(image: String, imageFormat: String? = nil, width: CGFloat? = nil, height: CGFloat? = nil) {
self.image = image
@ -40,5 +41,6 @@ import Foundation
case height
case contentMode
case cornerRadius
case clipsImage
}
}

View File

@ -254,6 +254,10 @@ import UIKit
clipsToBounds = true
layer.cornerRadius = cornerRadius
}
if let clipsImage = imageModel.clipsImage {
clipsToBounds = clipsImage
}
}
// MARK: - load functions