RSDTaskInfoStepObject

public struct RSDTaskInfoStepObject : RSDTaskInfoStep, RSDSchemaInfo, RSDEmbeddedIconVendor, Decodable

RSDTaskInfoStepObject is a concrete implementation of the RSDTaskInfoStep protocol.

  • A short string that uniquely identifies the task. The identifier is reproduced as the identifier for the associated RSDTaskResult.

    Declaration

    Swift

    public let identifier: String
  • The type of the step.

    Declaration

    Swift

    public let stepType: RSDStepType
  • The primary text to display for the task in a localized string.

    Declaration

    Swift

    public var title: String?
  • The subtitle text to display for the task in a localized string.

    Declaration

    Swift

    public var subtitle: String?
  • Additional detail text to display for the task.

    Declaration

    Swift

    public var detail: String?
  • Copyright information for the task.

    Declaration

    Swift

    public var copyright: String?
  • The estimated number of minutes that the task will take. If 0, then this is ignored.

    Declaration

    Swift

    public var estimatedMinutes: Int = 0
  • The icon used to display this task reference in a list of tasks.

    Declaration

    Swift

    public var icon: RSDImageWrapper?
  • A short string that uniquely identifies the associated result schema.

    Declaration

    Swift

    public var schemaIdentifier: String?
  • A revision number associated with the result schema.

    Declaration

    Swift

    public var schemaRevision: Int = 1
  • The task transformer for vending a task.

    Declaration

    Swift

    public var taskTransformer: RSDTaskTransformer!
  • The estimated fetch time is determined by the task transformer.

    Declaration

    Swift

    public var estimatedFetchTime: TimeInterval
  • Default initializer.

    Declaration

    Swift

    public init(with identifier: String)

    Parameters

    identifier

    A short string that uniquely identifies the step.

  • Initialize from a Decoder.

  • example:

       let json = """
            {
            "identifier": "foo",
            "type": "taskInfo",
            "schemaIdentifier": "bar",
            "schemaRevision": 2,
            "title": "Hello Foo!",
            "subtitle": "This is a subtitle.",
            "detail": "This is a test of foo.",
            "copyright": "This is a copyright string for foo.",
            "estimatedMinutes": 5,
            "icon": "fooIcon",
            "taskTransformer" : { "resourceName": "TaskFoo",
                                   "bundleIdentifier": "org.example.SharedResources" }
           }
           """.data(using: .utf8)! // our data in native (JSON) format
    
  • Throws

    DecodingError if there is a decoding error.

    Declaration

    Swift

    public init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder to use to decode this instance.

  • Fetch the task for this task info. Use the given factory to transform the task.

    Declaration

    Swift

    public func fetchTask(with factory: RSDFactory, callback: @escaping RSDTaskFetchCompletionHandler)

    Parameters

    factory

    The factory to use for creating the task and steps.

    callback

    The callback with the task or an error if the task failed, run on the main thread.

  • Instantiate a step result that is appropriate for this step.

    Declaration

    Swift

    public func instantiateStepResult() -> RSDResult

    Return Value

    RSDTaskResultObject with the identifier from this task reference.

  • Required method for the RSDStep protocol. No validation for this step.

    Declaration

    Swift

    public func validate() throws
  • Declaration

    Swift

    public static func ==(lhs: RSDTaskInfoStepObject, rhs: RSDTaskInfoStepObject) -> Bool
  • Declaration

    Swift

    public var hashValue : Int
  • Returns self as the only item in the list.

    Declaration

    Swift

    public var tasks: [RSDTaskInfoStep]