Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 65 additions & 1 deletion PhoneNumberKit/UI/CountryCodePickerOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ import UIKit
/// - Parameter tintColor: Default TintColor used on the view
/// - Parameter cellBackgroundColor: UIColor for the cell background
/// - Parameter cellBackgroundColorSelection: UIColor for the cell selectedBackgroundView
/// - Parameter cellLayoutMargins: Insets for the cell content
/// - Parameter rowHeight: Fixed height for every cell, excluding `rowSpacing`
/// - Parameter rowSpacing: Gap below every cell, in the background color, replacing the separator line
/// - Parameter sectionHeaderFont: UIFont for the alphabetical section headers and the section index bubble letter
/// - Parameter sectionHeaderColor: UIColor for the alphabetical section headers
/// - Parameter topSectionHeaderFont: UIFont for the "Current" and "Common" section headers
/// - Parameter topSectionHeaderColor: UIColor for the "Current" and "Common" section headers
/// - Parameter sectionHeaderHeight: Height of the alphabetical section header text, excluding `sectionHeaderLayoutMargins`
/// - Parameter topSectionHeaderHeight: Height of the "Current" and "Common" section header text, excluding `sectionHeaderLayoutMargins`
/// - Parameter sectionHeaderLayoutMargins: Insets for the section header text
/// - Parameter sectionFooterHeight: Height of the gap below every section
/// - Parameter sectionIndexColor: UIColor for the section index titles
/// - Parameter sectionIndexFont: UIFont for the section index titles; setting it swaps the system index for a letters-only one with a bubble
/// - Parameter sectionIndexBubbleTextColor: UIColor for the letter in the section index bubble
/// - Parameter sectionIndexBubbleBackgroundColor: UIColor for the section index bubble
/// - Parameter sectionIndexBubbleShadowColor: UIColor for the section index bubble shadow
public struct CountryCodePickerOptions {
public init() { }

Expand All @@ -30,7 +46,23 @@ public struct CountryCodePickerOptions {
detailTextLabelFont: UIFont? = nil,
tintColor: UIColor? = nil,
cellBackgroundColor: UIColor? = nil,
cellBackgroundColorSelection: UIColor? = nil) {
cellBackgroundColorSelection: UIColor? = nil,
cellLayoutMargins: NSDirectionalEdgeInsets? = nil,
rowHeight: CGFloat? = nil,
rowSpacing: CGFloat? = nil,
sectionHeaderFont: UIFont? = nil,
sectionHeaderColor: UIColor? = nil,
topSectionHeaderFont: UIFont? = nil,
topSectionHeaderColor: UIColor? = nil,
sectionHeaderHeight: CGFloat? = nil,
topSectionHeaderHeight: CGFloat? = nil,
sectionHeaderLayoutMargins: NSDirectionalEdgeInsets? = nil,
sectionFooterHeight: CGFloat? = nil,
sectionIndexColor: UIColor? = nil,
sectionIndexFont: UIFont? = nil,
sectionIndexBubbleTextColor: UIColor? = nil,
sectionIndexBubbleBackgroundColor: UIColor? = nil,
sectionIndexBubbleShadowColor: UIColor? = nil) {
self.backgroundColor = backgroundColor
self.separatorColor = separatorColor
self.textLabelColor = textLabelColor
Expand All @@ -40,6 +72,22 @@ public struct CountryCodePickerOptions {
self.tintColor = tintColor
self.cellBackgroundColor = cellBackgroundColor
self.cellBackgroundColorSelection = cellBackgroundColorSelection
self.cellLayoutMargins = cellLayoutMargins
self.rowHeight = rowHeight
self.rowSpacing = rowSpacing
self.sectionHeaderFont = sectionHeaderFont
self.sectionHeaderColor = sectionHeaderColor
self.topSectionHeaderFont = topSectionHeaderFont
self.topSectionHeaderColor = topSectionHeaderColor
self.sectionHeaderHeight = sectionHeaderHeight
self.topSectionHeaderHeight = topSectionHeaderHeight
self.sectionHeaderLayoutMargins = sectionHeaderLayoutMargins
self.sectionFooterHeight = sectionFooterHeight
self.sectionIndexColor = sectionIndexColor
self.sectionIndexFont = sectionIndexFont
self.sectionIndexBubbleTextColor = sectionIndexBubbleTextColor
self.sectionIndexBubbleBackgroundColor = sectionIndexBubbleBackgroundColor
self.sectionIndexBubbleShadowColor = sectionIndexBubbleShadowColor
}

public var backgroundColor: UIColor?
Expand All @@ -51,5 +99,21 @@ public struct CountryCodePickerOptions {
public var tintColor: UIColor?
public var cellBackgroundColor: UIColor?
public var cellBackgroundColorSelection: UIColor?
public var cellLayoutMargins: NSDirectionalEdgeInsets?
public var rowHeight: CGFloat?
public var rowSpacing: CGFloat?
public var sectionHeaderFont: UIFont?
public var sectionHeaderColor: UIColor?
public var topSectionHeaderFont: UIFont?
public var topSectionHeaderColor: UIColor?
public var sectionHeaderHeight: CGFloat?
public var topSectionHeaderHeight: CGFloat?
public var sectionHeaderLayoutMargins: NSDirectionalEdgeInsets?
public var sectionFooterHeight: CGFloat?
public var sectionIndexColor: UIColor?
public var sectionIndexFont: UIFont?
public var sectionIndexBubbleTextColor: UIColor?
public var sectionIndexBubbleBackgroundColor: UIColor?
public var sectionIndexBubbleShadowColor: UIColor?
}
#endif
Loading
Loading