UIImage

class UIImage : NSObject, NSSecureCoding

UIImage utility extension

  • Crop an image by size

    Declaration

    Swift

    func cropToBounds(width: Double, height: Double) -> UIImage

    Parameters

    width

    image width

    height

    image height

    Return Value

    a new UIImage image

  • Resize an image by width

    Declaration

    Swift

    func resizeWithWidth(width: CGFloat) -> UIImage?

    Parameters

    width

    the total image width

    Return Value

    a new UIImage image