Repeat
public struct Repeat : Shortcut
Repeats the contained actions, running them either a specified number of times or once for each item in an input list.
Input: (Anything) a list of items (optional)
Result: (Anything) Every item passed to the “End Repeat” action
-
The contents of the shortcut.
Declaration
Swift
public var body: some Shortcut { get } -
Initializes the shortcut.
Declaration
Swift
public init<Content>(count: Int, groupingIdentifier: UUID = UUID(), @ShortcutBuilder builder: (_ repeatIndex: Variable) -> Content) where Content : ShortcutParameters
countThe number of times to repeat the actions.
groupingIdentifierAn optional UUID, useful for building deterministic output.
builderThe shortcut builder that creates shortcuts.
repeatIndexThe index of current iteration as a variable.
-
Initializes the shortcut.
Declaration
Swift
public init<Content>(iterating variable: Variable, groupingIdentifier: UUID = UUID(), @ShortcutBuilder builder: (_ repeatIndex: Variable, _ repeatItem: Variable) -> Content) where Content : ShortcutParameters
variableAn input list to iterate.
groupingIdentifierAn optional UUID, useful for building deterministic output.
builderThe shortcut builder that creates shortcuts.
repeatIndexThe index of current iteration as a variable.
repeatItemThe currently iterated item as a variable.
View on GitHub
Repeat Structure Reference