ActionSheetDangerButton.swift 719 B

1234567891011121314151617181920212223242526272829
  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. They are basically just OK buttons with a "red alert" style.
  12. The value of a danger button is `ButtonType.ok`.
  13. */
  14. import UIKit
  15. open class ActionSheetDangerButton: ActionSheetOkButton {
  16. // MARK: - Functions
  17. open override func applyAppearance(_ appearance: ActionSheetAppearance) {
  18. self.appearance = customAppearance ?? ActionSheetDangerButtonAppearance(copy: appearance.dangerButton)
  19. }
  20. }