ActionSheetButton.swift 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // ActionSheetButton.swift
  3. // Sheeeeeeeeet
  4. //
  5. // Created by Daniel Saidi on 2017-11-26.
  6. // Copyright © 2017 Daniel Saidi. All rights reserved.
  7. //
  8. /*
  9. This class is a base class for all action sheet buttons. It
  10. is not intended to be used directly. Instead, use the built
  11. in buttons or subclass this class to create your own button.
  12. */
  13. import UIKit
  14. open class ActionSheetButton: ActionSheetItem {
  15. // MARK: - Initialization
  16. public init(title: String, value: Bool?) {
  17. super.init(title: title, value: value)
  18. }
  19. // MARK: - Properties
  20. open override var itemType: ItemType { return .button }
  21. // MARK: - Functions
  22. open override func applyAppearance(_ appearance: ActionSheetAppearance) {
  23. self.appearance = ActionSheetButtonAppearance(copy: appearance.okButton)
  24. }
  25. open override func applyAppearance(to cell: UITableViewCell) {
  26. super.applyAppearance(to: cell)
  27. cell.textLabel?.textAlignment = .center
  28. }
  29. }