PPOption.swift 525 B

12345678910111213141516171819202122
  1. import UIKit
  2. /**
  3. Representation of an action that can be taken when tapping a button
  4. on PPOptionsViewController.
  5. */
  6. public struct PPOption {
  7. /// Title to be shown on a button
  8. let title: String
  9. /// Action that will be executed when user selects the option.
  10. let handler: () -> ()
  11. let icon: UIImage?
  12. public init(withTitle title: String, withIcon icon: UIImage?, handler: @escaping () -> ()) {
  13. self.title = title
  14. self.handler = handler
  15. self.icon = icon
  16. }
  17. }