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
nameThe 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
urlThe url of a image.
placeholderThe 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
urlStringThe string represent a valid URL For a image
placeholderThe 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
nameThe 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.
bundleThe 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
nameThe 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
cgImageThe Quartz image object.
scaleThe 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.
orientationThe 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
imageThe initial image to display in the image view. You may specify an image object that contains an animated sequence of images.
highlightedImageThe 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?) -> ImageParameters
urlThe url of a image.
placeholderThe 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?) -> ImageParameters
urlStringThe string represent a valid URL For a image
placeholderThe 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?) -> ImageParameters
valueThe 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?) -> ImageParameters
valueThe 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) -> ImageParameters
valueA 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) -> ImageParameters
valueA 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]?) -> ImageParameters
valueAn 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]?) -> ImageParameters
valueAn 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) -> ImageParameters
valueThe 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) -> ImageParameters
valuethe 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) -> ImageParameters
valueA 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?) -> ImageParameters
valueThe 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?) -> ImageParameters
valueThe image displayed in the image view.
placeholderThe 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) -> ImageParameters
capInsetsThe values to use for the cap insets.
resizingModeThe 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) -> ImageParameters
renderingModeThe rendering mode to use for the new image.
Return Value
self
-
Starts animating the images in the receiver.
Declaration
Swift
@discardableResult public func startAnimating() -> ImageReturn Value
self
-
Stops animating the images in the receiver.
Declaration
Swift
@discardableResult public func stopAnimating() -> ImageReturn Value
self
-
Stops animating the images in the receiver.
Declaration
Swift
@discardableResult public func isAnimating() -> BoolReturn Value
self
-
Get the size of the image displayed in the image view.
Declaration
Swift
public func imageSize() -> CGSizeReturn Value
The size of the image displayed in the image view.
Image Structure Reference