Skip to content
persello edited this page May 17, 2021 · 7 revisions

TImage

A remote image in the form of a SwiftUI View.

@available(iOS 14.0, macOS 11, tvOS 14.0, *)
public struct TImage: View, Equatable 

Inheritance

Equatable, View

Initializers

init(_:)

Creates a new instance of a Telescope TImage.

public init(_ remoteImage: RemoteImage?) 

Parameters

  • remoteImage: The remote image reference.

Properties

body

The content and behavior of the view.

public var body: some View 

Methods

scaledToFit()

Makes the TImage fit into its parent. Default behaviour is fill.

public func scaledToFit() -> TImage 

Returns

A new fitted TImage.

hideProgressView()

Hides the progress view while loading.

public func hideProgressView() -> TImage 

Returns

A TImage without ProgressView

resizable()

Makes the current image resizable.

public func resizable() -> TImage 

Returns

A resizable TImage.

placeholder(_:)

Adds an error placeholder view.

public func placeholder<Placeholder: View>(@ViewBuilder _ placeholder: @escaping () -> Placeholder) -> TImage 

Parameters

  • placeholder: The placeholder view.

Returns

A TImage with the specified placeholder.

Operators

==

public static func == (lhs: TImage, rhs: TImage) -> Bool