PermissionRequestTableViewCell

open class PermissionRequestTableViewCell: UITableViewCell

A cell of this class provides some information about a system service and has an Allow button that can be pressed to request permission to the respective system service.

Use setupForService(service:permissioner:viewController:) to setup the cell. It will automatically use the permissioner to ask for permission when the user taps the “Allow” button, show when enabling is not possible and also show an alert informing about how to recover from the error.

  • Undocumented

    Declaration

    Swift

    open class PermissionRequestTableViewCell: UITableViewCell
  • Undocumented

    Declaration

    Swift

    open class PermissionRequestTableViewCell: UITableViewCell
  • Undocumented

    Declaration

    Swift

    open class PermissionRequestTableViewCell: UITableViewCell
  • Undocumented

    Declaration

    Swift

    open class PermissionRequestTableViewCell: UITableViewCell
  • Configure the cell to represent a given service and make its button request access to the given service via the permissioner provided.

    Declaration

    Swift

    open func setup(for service: SystemService, permissioner: SystemServicePermissioner, viewController vc: UIViewController)

    Parameters

    service

    The service to represent

    permissioner

    The permissioner to use to request permission

  • Perform the action assigned to the button; you normally don’t need to use this method yourself.

    Declaration

    Swift

    open func performAction(_ sender: UIButton)
  • Indicated that something went wrong when requesting for permission to a given service.

    This method renders the error in place of the system service description, turning the text red, and calling showRecoveryInstructionsForService(service:fromViewController) to show next steps.

    Declaration

    Swift

    open func indicateError(_ error: Error, for service: SystemService)

    Parameters

    error

    The error that occurred

    service

    The system service that was affected

  • Show how to recover from failure to enable a certain service.

    Declaration

    Swift

    open func showRecoveryInstructions(for service: SystemService, from viewController: UIViewController)

    Parameters

    service

    The system service that was affected

    viewController

    The view controller to use for instruction presentation