ViewState

public enum ViewState : Equatable

视图状态枚举,兼容UIKit和SwiftUI

  • Undocumented

    Declaration

    Swift

    case ready
  • Undocumented

    Declaration

    Swift

    case loading
  • Undocumented

    Declaration

    Swift

    case success(_: Any? = nil)
  • Undocumented

    Declaration

    Swift

    case failure(_: Error? = nil)
  • 获取成功状态的对象,其他状态返回nil

    Declaration

    Swift

    public var object: Any? { get }
  • 获取失败状态的错误,其他状态返回nil

    Declaration

    Swift

    public var error: Error? { get }
  • 实现Equatable协议方法,仅比较状态,不比较值

    Declaration

    Swift

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