RoundedCornersFilter
public struct RoundedCornersFilter : ImageFilter, Roundable
Rounds the corners of an image to the specified radius.
-
The radius of the filter.
Declaration
Swift
public let radius: CGFloat
-
Whether to divide the radius by the image scale.
Declaration
Swift
public let divideRadiusByImageScale: Bool
-
Initializes the
RoundedCornersFilter
instance with the given radius.Declaration
Swift
public init(radius: CGFloat, divideRadiusByImageScale: Bool = false)
Parameters
radius
The radius.
divideRadiusByImageScale
Whether to divide the radius by the image scale. Set to
true
when the image has the same resolution for all screen scales such as @1x, @2x and @3x (i.e. single image from web server). Set tofalse
for images loaded from an asset catalog with varying resolutions for each screen scale.false
by default.Return Value
The new
RoundedCornersFilter
instance. -
The unique idenitifier for an
ImageFilter
conforming to theRoundable
protocol.Declaration
Swift
public var identifier: String { get }