Image

public struct Image : View

Wrapper of UIImageView A view that displays a single image or a sequence of animated images in your interface.

         Image("name")
         Image("./doc/name.jpg")
         Image("https://www.example.com")
  • The node behind the Image.

    Declaration

    Swift

    public var node: ArgoKitNode? { get }
  • Initializer

    Declaration

    Swift

    public init()
  • Initializer

    Declaration

    Swift

    public init(_ name: @autoclosure @escaping () -> String?)

    Parameters

    name

    The name of the image asset or file. For images in asset catalogs, specify the name of the image asset. For PNG image files, specify the filename without the filename extension. For all other image file formats, include the filename extension in the name.

  • Initializer

    Declaration

    Swift

    public init(url: @autoclosure @escaping () -> URL?, placeholder: @autoclosure @escaping () -> String?)

    Parameters

    url

    The url of a image.

    placeholder

    The name of the placeholder image asset or file. For images in asset catalogs, specify the name of the image asset. For PNG image files, specify the filename without the filename extension. For all other image file formats, include the filename extension in the name.

  • Initializer

    Declaration

    Swift

    public init(urlString: @autoclosure @escaping () -> String?, placeholder: @autoclosure @escaping () -> String?)

    Parameters

    urlString

    The string represent a valid URL For a image

    placeholder

    The name of the placeholder image asset or file. For images in asset catalogs, specify the name of the image asset. For PNG image files, specify the filename without the filename extension. For all other image file formats, include the filename extension in the name.

  • Initializer

    Declaration

    Swift

    public init(_ name: @autoclosure @escaping () -> String?, bundle: @autoclosure @escaping () -> Bundle?)

    Parameters

    name

    The name of the image asset or file. For images in asset catalogs, specify the name of the image asset. For PNG image files, specify the filename without the filename extension. For all other image file formats, include the filename extension in the name.

    bundle

    The bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle.

  • Initializer

    Declaration

    Swift

    @available(iOS 13.0, *)
    public init(systemName name: @autoclosure @escaping () -> String?)

    Parameters

    name

    The name of the system symbol image. Use the SF Symbols app to look up the names of system symbol images. You can download this app from the design resources page at developer.apple.com.

  • Initializer

    Declaration

    Swift

    public init(cgImage: CGImage, scale: CGFloat, orientation: UIImage.Orientation = .up)

    Parameters

    cgImage

    The Quartz image object.

    scale

    The scale factor to assume when interpreting the image data. Applying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property.

    orientation

    The orientation of the image data. You can use this parameter to specify any rotation factors applied to the image.

  • Initializer

    Declaration

    Swift

    public init(image: @autoclosure @escaping () -> UIImage?, highlightedImage: @autoclosure @escaping () -> UIImage? = nil)

    Parameters

    image

    The initial image to display in the image view. You may specify an image object that contains an animated sequence of images.

    highlightedImage

    The image to display when the image view is highlighted. You may specify an image object that contains an animated sequence of images.

  • Sets the displayed image.

    Declaration

    Swift

    @discardableResult
    public func image(url: @autoclosure @escaping () -> URL?, placeholder: @autoclosure @escaping () -> String?) -> Image

    Parameters

    url

    The url of a image.

    placeholder

    The name of the placeholder image asset or file. For images in asset catalogs, specify the name of the image asset. For PNG image files, specify the filename without the filename extension. For all other image file formats, include the filename extension in the name.

    Return Value

    self

  • Sets the displayed image.

    Declaration

    Swift

    @discardableResult
    public func image(urlString: @autoclosure @escaping () -> String?, placeholder: @autoclosure @escaping () -> String?) -> Image

    Parameters

    urlString

    The string represent a valid URL For a image

    placeholder

    The name of the placeholder image asset or file. For images in asset catalogs, specify the name of the image asset. For PNG image files, specify the filename without the filename extension. For all other image file formats, include the filename extension in the name.

    Return Value

    self

  • Sets the highlighted image displayed in the image view.

    Declaration

    Swift

    @discardableResult
    public func highlightedImage(_ value: @autoclosure @escaping () -> UIImage?) -> Image

    Parameters

    value

    The highlighted image displayed in the image view.

    Return Value

    self

  • Sets the configuration values to use when rendering the image.

    Declaration

    Swift

    @available(iOS 13.0, *)
    @discardableResult
    public func preferredSymbolConfiguration(_ value: @autoclosure @escaping () -> UIImage.SymbolConfiguration?) -> Image

    Parameters

    value

    The configuration values to use when rendering the image.

    Return Value

    self

  • Sets a Boolean value that determines whether user events are ignored and removed from the event queue.

    Declaration

    Swift

    @discardableResult
    public func userInteractionEnabled(_ value: @autoclosure @escaping () -> Bool) -> Image

    Parameters

    value

    A Boolean value that determines whether user events are ignored and removed from the event queue.

    Return Value

    self

  • Sets a Boolean value that determines whether the image is highlighted.

    Declaration

    Swift

    @discardableResult
    public func isHighlighted(_ value: @autoclosure @escaping () -> Bool) -> Image

    Parameters

    value

    A Boolean value that determines whether the image is highlighted.

    Return Value

    self

  • Sets an array of UIImage objects to use for an animation.

    Declaration

    Swift

    @discardableResult
    public func animationImages(_ value: @autoclosure @escaping () -> [UIImage]?) -> Image

    Parameters

    value

    An array of UIImage objects to use for an animation.

    Return Value

    self

  • Sets an array of UIImage objects to use for an animation when the view is highlighted.

    Declaration

    Swift

    @discardableResult
    public func highlightedAnimationImages(_ value: @autoclosure @escaping () -> [UIImage]?) -> Image

    Parameters

    value

    An array of UIImage objects to use for an animation when the view is highlighted.

    Return Value

    self

  • Sets the amount of time it takes to go through one cycle of the images.

    Declaration

    Swift

    @discardableResult
    public func animationDuration(_ value: @autoclosure @escaping () -> TimeInterval) -> Image

    Parameters

    value

    The amount of time it takes to go through one cycle of the images.

    Return Value

    self

  • Specifies the number of times to repeat the animation.

    Declaration

    Swift

    @discardableResult
    public func animationRepeatCount(_ value: @autoclosure @escaping () -> Int) -> Image

    Parameters

    value

    the number of times to repeat the animation.

    Return Value

    self

  • Sets a color used to tint template images in the view hierarchy.

    Declaration

    Swift

    @discardableResult
    public func tintColor(_ value: @autoclosure @escaping () -> UIColor) -> Image

    Parameters

    value

    A color used to tint template images in the view hierarchy.

    Return Value

    self

  • Sets the displayed image.

    Declaration

    Swift

    @discardableResult
    public func image(_ value: @autoclosure @escaping () -> UIImage?) -> Image

    Parameters

    value

    The image displayed in the image view.

    Return Value

    self

  • Sets the displayed image.

    Declaration

    Swift

    @discardableResult
    public func image(_ value: @autoclosure @escaping () -> UIImage?, placeholder: @autoclosure @escaping () -> UIImage?) -> Image

    Parameters

    value

    The image displayed in the image view.

    placeholder

    The placeholder image displayed in the image view if the value invalid

    Return Value

    self

  • Resizable image.

    Declaration

    Swift

    @discardableResult
    public func resizable(capInsets: UIEdgeInsets = UIEdgeInsets(), resizingMode: UIImage.ResizingMode = .stretch) -> Image

    Parameters

    capInsets

    The values to use for the cap insets.

    resizingMode

    The mode with which the interior of the image is resized.

    Return Value

    self

  • Adjust the rendering mode of the image.

    Declaration

    Swift

    @discardableResult
    public func renderingMode(_ renderingMode: UIImage.RenderingMode = .automatic) -> Image

    Parameters

    renderingMode

    The rendering mode to use for the new image.

    Return Value

    self

  • Starts animating the images in the receiver.

    Declaration

    Swift

    @discardableResult
    public func startAnimating() -> Image

    Return Value

    self

  • Stops animating the images in the receiver.

    Declaration

    Swift

    @discardableResult
    public func stopAnimating() -> Image

    Return Value

    self

  • Stops animating the images in the receiver.

    Declaration

    Swift

    @discardableResult
    public func isAnimating() -> Bool

    Return Value

    self

  • Get the size of the image displayed in the image view.

    Declaration

    Swift

    public func imageSize() -> CGSize

    Return Value

    The size of the image displayed in the image view.