ActionSheetDangerButton.swift 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 should be styled as "dangerous" (e.g. red text), using
  12. the appearance proxy.
  13. The value of a danger button is `.ok`.
  14. */
  15. import UIKit
  16. open class ActionSheetDangerButton: ActionSheetOkButton {
  17. // MARK: - Deprecated - Remove in 1.4.0 ****************
  18. @available(*, deprecated, message: "applyAppearance will be removed in 1.4.0. Use the new appearance model instead.")
  19. open override func applyAppearance(_ appearance: ActionSheetAppearance) {
  20. self.appearance = customAppearance ?? ActionSheetDangerButtonAppearance(copy: appearance.dangerButton)
  21. }
  22. // MARK: - Deprecated - Remove in 1.4.0 ****************
  23. // MARK: - Functions
  24. open override func cell(for tableView: UITableView) -> ActionSheetItemCell {
  25. return ActionSheetDangerButtonCell(style: .default, reuseIdentifier: cellReuseIdentifier)
  26. }
  27. }
  28. // MARK: -
  29. open class ActionSheetDangerButtonCell: ActionSheetButtonCell {}