chronotruck / FlagPhoneNumber

A formatted phone number UITextField with country flag picker.
Apache License 2.0
437 stars 318 forks source link

slow when pass #141

Open aleks990822 opened 4 years ago

aleks990822 commented 4 years ago

when I pass to the controller with FPNTextfield, the controller have delayed

@IBOutlet weak var number:FPNTextField!
  override func viewDidLoad() {
       super.viewDidLoad()

    number.delegate = self
    number.displayMode = .list
    listController.setup(repository: number.countryRepository)
    // Custom the size/edgeInsets of the flag button
    number.flagButtonSize = CGSize(width: 35, height: 35)
    number.flagButton.imageEdgeInsets = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
    // The placeholder is an example phone number of the selected country by default. You can add your own placeholder :
    number.hasPhoneNumberExample = true

}
UtkuDalmaz commented 4 years ago

I am having the same issue @grifas

carlosmonzon commented 4 years ago

I've got the same issue. The problem is when the FPNTextField is initialised is loading all the flag in memory. The following PR should fix that issue:

https://github.com/chronotruck/FlagPhoneNumber/pull/149