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 to false for images loaded from an asset catalog with varying resolutions for each screen scale. false by default.

    Return Value

    The new RoundedCornersFilter instance.

  • The filter closure used to create the modified representation of the given image.

    Declaration

    Swift

    public var filter: (Image) -> Image { get }
  • The unique idenitifier for an ImageFilter conforming to the Roundable protocol.

    Declaration

    Swift

    public var identifier: String { get }