ActionSheetCancelButton.swift 755 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // ActionSheetCancelButton.swift
  3. // Sheeeeeeeeet
  4. //
  5. // Created by Daniel Saidi on 2017-11-26.
  6. // Copyright © 2017 Daniel Saidi. All rights reserved.
  7. //
  8. /*
  9. Cancel buttons have no special behavior, but can be used in
  10. sheets where a user applies changes by tapping an OK button.
  11. The default cancel button value is `nil`.
  12. */
  13. import UIKit
  14. open class ActionSheetCancelButton: ActionSheetButton {
  15. // MARK: - Initialization
  16. public init(title: String) {
  17. super.init(title: title, value: nil)
  18. }
  19. // MARK: - Functions
  20. open override func applyAppearance(_ appearance: ActionSheetAppearance) {
  21. self.appearance = ActionSheetCancelButtonAppearance(copy: appearance.cancelButton)
  22. }
  23. }