Action

public struct Action<T>

Simulate actions on views or objects

  • Simulate tap on a button

    Declaration

    Swift

    @discardableResult public func tap(event: UIControlEvents = .touchUpInside) -> Action

    Parameters

    event

    Event type to trigger

  • Simulate scroll to a given point

    Declaration

    Swift

    @discardableResult public func scroll(to point: CGPoint, decelerate: Bool = false) -> Action

    Parameters

    to

    Target offset value

    decelerate

    Enables deceleration after dragging

  • Simulate scroll to a given page horizontally

    Declaration

    Swift

    @discardableResult public func scroll(horizontalPageIndex index: Int, decelerate: Bool = false) -> Action

    Parameters

    to

    Target page index

    decelerate

    Enables deceleration after dragging

  • Simulate scroll to a given page vertically

    Declaration

    Swift

    @discardableResult public func scroll(verticalPageIndex index: Int, decelerate: Bool = false) -> Action

    Parameters

    to

    Target page index

    decelerate

    Enables deceleration after dragging

  • Simulate tap on a cell in collection view

    Declaration

    Swift

    @discardableResult public func tap(item: Int, section: Int = 0) -> Action

    Parameters

    item

    Index of an item to tap on

    section

    Index of the section to tap on

  • Simulate tap on a gesture recognizer

    Declaration

    Swift

    @discardableResult public func triggerTap(taps: Int = 1, touches: Int = 1) -> Action

    Parameters

    taps

    Number of taps

    touches

    Number of touches

  • Returns all actions and selectors for a gesture recognizer This method uses private API’s and will most likely cause your app to be rejected if used outside of your test target

    Declaration

    Swift

    public func getTargetInfo() -> TargetActionInfo

    Return Value

    [(target: AnyObject, action: Selector)] Array of action/selector tuples

  • Executes all targets on a specific gesture recognizer

    Declaration

    Swift

    @discardableResult public func execute() -> Action
  • Simulate tap on a cell in table view

    Declaration

    Swift

    @discardableResult public func tap(row: Int, section: Int = 0) -> Action

    Parameters

    row

    Index of the row to tap on

    section

    Index of the section to tap on