Skip to content

Commit

Permalink
Added the keyword 'public' to lines 4,5, and 6 (chronotruck#93)
Browse files Browse the repository at this point in the history
When using an instance of FPNTextField() eg. let phoneNumberTextField = FPNTextField(), you may want to save the code, name, and phoneCode to the db for future reference. In addition to having the user's phone number, declaring these as public gives you easy access to them once a selection is made inside the phoneNumberTextField

eg

phoneNumberTextField.set(phoneNumber: 1-212-555-1212)

let countryName = phoneNumberTextField.selectedCountry?.name // save the name of the user's country code US
let countryCode = phoneNumberTextField.selectedCountry?.code.rawValue //  save the name of the user's country United States
let phoneDialCode = phoneNumberTextField.selectedCountry?.phoneCode // save the prefix code +1
  • Loading branch information
lsamaria authored and Aurélien committed May 31, 2019
1 parent 7d1dd91 commit 32ca72e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/FPNCountryPicker/FPNCountry.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import UIKit

public struct FPNCountry {
var code: FPNCountryCode
var name: String
var phoneCode: String
public var code: FPNCountryCode
public var name: String
public var phoneCode: String
var flag: UIImage?

init(code: String, name: String, phoneCode: String) {
Expand Down

0 comments on commit 32ca72e

Please sign in to comment.