Prompt
public class Prompt
Prompt class
*
-
Undocumented
Declaration
Swift
public class Prompt -
Initialize the prompt with a display style
*
Declaration
Swift
convenience public init(withStyle style: PromptStyle)Parameters
withStylePromptStyle
-
Asks a question that requires a
Stringresponse. A valid response must be provided before the user can proceed.*
Declaration
Swift
public func askString(question: String, message: String? = nil, block: Block? = nil) -> StringParameters
questionThe question to ask the user to respond to.
messageOptional message to override the default message if the response is invalid.
blockOptional block
Return Value
String
-
Asks a question that requires an
Intresponse. A valid response (i.e. an integer) must be provided before the user can proceed.*
Declaration
Swift
public func askInt(question: String, message: String? = nil, block: Block? = nil) -> IntParameters
questionThe question to ask the user to respond to.
messageOptional message to override the default message if the response is invalid.
blockOptional block
Return Value
Integer
-
Asks a question that requires a
Boolresponse. A valid response that can be converted to a boolean must be provided before the user can proceed.*
Declaration
Swift
public func askBool(question: String, message: String? = nil, block: Block? = nil) -> Bool?Parameters
questionThe question to ask the user to respond to.
messageOptional message to override the default message if the response is invalid.
blockOptional block
Return Value
Boolean
-
Asks a multiple choice question that requires a single response (via entering an integer). A valid response must be provided.
*
Declaration
Swift
public func askSingleChoice(text: String, choices: Choices, message: String? = nil, block: Block? = nil) -> ChoiceInfo?Parameters
questionThe question to ask the user to respond to.
choicesAn array of choices to present to the user.
messageOptional message to override the default message if the response is invalid.
blockOptional block
Return Value
(Index, String) - The index of the selected choice and the choice as a string
Prompt Class Reference