ActionSheetItemAppearance.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // ActionSheetItemAppearance.swift
  3. // Sheeeeeeeeet
  4. //
  5. // Created by Daniel Saidi on 2017-11-24.
  6. // Copyright © 2017 Daniel Saidi. All rights reserved.
  7. //
  8. import UIKit
  9. open class ActionSheetItemAppearance {
  10. // MARK: - Initialization
  11. public init() {}
  12. public init(copy: ActionSheetItemAppearance) {
  13. backgroundColor = copy.backgroundColor
  14. font = copy.font
  15. height = copy.height
  16. separatorInsets = copy.separatorInsets
  17. textColor = copy.textColor
  18. tintColor = copy.tintColor
  19. subtitleFont = copy.subtitleFont
  20. subtitleTextColor = copy.subtitleTextColor
  21. }
  22. // MARK: - Properties
  23. public var backgroundColor: UIColor?
  24. public var font: UIFont?
  25. public var height: CGFloat = 50
  26. public var separatorInsets: UIEdgeInsets = .zero
  27. public var textColor: UIColor?
  28. public var tintColor: UIColor?
  29. public var subtitleFont: UIFont?
  30. public var subtitleTextColor: UIColor?
  31. }
  32. // MARK: - Public Extensions
  33. public extension ActionSheetItemAppearance {
  34. public static var noSeparator: UIEdgeInsets {
  35. return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: UIScreen.main.bounds.width)
  36. }
  37. public func hideSeparator() {
  38. separatorInsets = ActionSheetItemAppearance.noSeparator
  39. }
  40. }