DisplayAgentDelegate

public protocol DisplayAgentDelegate : AnyObject

The DisplayAgent delegate is used to notify observers when a template directive is received.

  • Tells the delegate that the specified template should be displayed.

    Declaration

    Swift

    func displayAgentShouldRender(template: DisplayTemplate, completion: @escaping (AnyObject?) -> Void)

    Parameters

    template

    The template to display.

  • Tells the delegate that the specified template should be removed from the screen.

    Declaration

    Swift

    func displayAgentDidClear(templateId: String)

    Parameters

    templateId

    The template id to remove from the screen.

  • Tells the delegate that the displayed template should move focus with given direction.

    Declaration

    Swift

    func displayAgentShouldMoveFocus(templateId: String, direction: DisplayControlPayload.Direction, header: Downstream.Header, completion: @escaping (Bool) -> Void)

    Parameters

    templateId

    The template id to move focus.

    direction

    Direction to move focus.

    header

    The header of the originally handled directive.

    completion

    Whether succeeded or not.

  • Tells the delegate that the displayed template should scroll with given direction.

    Declaration

    Swift

    func displayAgentShouldScroll(templateId: String, direction: DisplayControlPayload.Direction, header: Downstream.Header, completion: @escaping (Bool) -> Void)

    Parameters

    templateId

    The template id to scroll.

    direction

    Direction to scroll.

    header

    The header of the originally handled directive.

    completion

    Whether succeeded or not.

  • Provide a context of display-agent.

    Declaration

    Swift

    func displayAgentRequestContext(templateId: String, completion: @escaping (DisplayContext?) -> Void)

    Parameters

    templateId

    The template id to send context.

  • Should update proper displaying view with given template.

    Declaration

    Swift

    func displayAgentShouldUpdate(templateId: String, template: DisplayTemplate)

    Parameters

    templateId

    The template id to update.

    template

    The template to update.