Skip to content

Commit

Permalink
Merge pull request #10 from subhajitregor/master
Browse files Browse the repository at this point in the history
Added support for changing font and color
  • Loading branch information
kizitonwose authored Jul 1, 2018
2 parents a1479c9 + 9a489b5 commit 10bd3b9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CountryPickerView/CountryPickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ public class CountryPickerView: NibView {
didSet { setup() }
}

/// Change the font of phone code
public var font = UIFont.systemFont(ofSize: 17.0) {
didSet { setup() }
}
/// Change the text color of phone code
public var textColor = UIColor.black {
didSet { setup() }
}


/// The spacing between the flag image and the text.
public var flagSpacingInView: CGFloat {
get {
Expand Down Expand Up @@ -90,6 +100,8 @@ public class CountryPickerView: NibView {

func setup() {
flagImageView.image = selectedCountry.flag
countryDetailsLabel.font = font
countryDetailsLabel.textColor = textColor
if showPhoneCodeInView && showCountryCodeInView {
countryDetailsLabel.text = "(\(selectedCountry.code)) \(selectedCountry.phoneCode)"
return
Expand Down

0 comments on commit 10bd3b9

Please sign in to comment.