PermissionChoice
A class that uniquely identifies a specific, statically defined permission choice.
Declaration
struct PermissionChoiceMentioned in
Overview
Each PermissionQuestion contains a set of possible answer choices, each corresponding to a globally unique identifier that you can interpret.
The code below is an example of how to use PermissionChoice to set permission choices for a person using your app.
let approveOneHour = PermissionChoice(id: AnswerIdentifier.approveOneHour,
title: "Approve for one hour", answer: .approval)
let approveAllDay = PermissionChoice(id: AnswerIdentifier.approveAllDay,
title: "Approve all day", answer: .approval)
let approveIndefinitely = PermissionChoice(id: AnswerIdentifier.approveIndefinitely,
title: "Approve indefinitely", answer: .approval)
let decline = PermissionChoice(id: AnswerIdentifier.decline,
title: "Decline", answer: .denial)If your application only requires a yes or no response, you can use the two predefined PermissionChoice options: approve and decline.