for molecularly clipping image
This commit is contained in:
parent
dc3a2c87ab
commit
2adf3b7c4f
@ -21,6 +21,7 @@ import Foundation
|
|||||||
public var contentMode: UIView.ContentMode?
|
public var contentMode: UIView.ContentMode?
|
||||||
public var localBundle: Bundle?
|
public var localBundle: Bundle?
|
||||||
public var cornerRadius: CGFloat?
|
public var cornerRadius: CGFloat?
|
||||||
|
public var clipsImage: Bool?
|
||||||
|
|
||||||
public init(image: String, imageFormat: String? = nil, width: CGFloat? = nil, height: CGFloat? = nil) {
|
public init(image: String, imageFormat: String? = nil, width: CGFloat? = nil, height: CGFloat? = nil) {
|
||||||
self.image = image
|
self.image = image
|
||||||
@ -40,5 +41,6 @@ import Foundation
|
|||||||
case height
|
case height
|
||||||
case contentMode
|
case contentMode
|
||||||
case cornerRadius
|
case cornerRadius
|
||||||
|
case clipsImage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -254,6 +254,10 @@ import UIKit
|
|||||||
clipsToBounds = true
|
clipsToBounds = true
|
||||||
layer.cornerRadius = cornerRadius
|
layer.cornerRadius = cornerRadius
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let clipsImage = imageModel.clipsImage {
|
||||||
|
clipsToBounds = clipsImage
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - load functions
|
// MARK: - load functions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user