ActionSheetDangerButton.swift 767 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // ActionSheetDangerButton.swift
  3. // Sheeeeeeeeet
  4. //
  5. // Created by Daniel Saidi on 2017-11-27.
  6. // Copyright © 2017 Daniel Saidi. All rights reserved.
  7. //
  8. /*
  9. Danger buttons have no special behavior, but can be used to
  10. indicate that the effect of the action sheet is destructive.
  11. The value of a danger button is `true` by default.
  12. */
  13. import UIKit
  14. open class ActionSheetDangerButton: ActionSheetButton {
  15. // MARK: - Initialization
  16. public init(title: String) {
  17. super.init(title: title, value: true)
  18. }
  19. // MARK: - Functions
  20. open override func applyAppearance(_ appearance: ActionSheetAppearance) {
  21. self.appearance = ActionSheetDangerButtonAppearance(copy: appearance.dangerButton)
  22. }
  23. }