FlagPhoneNumber: Flags don't appear
Describe the bug
The flags don’t appear. Also I tried changing the Bundle path, but it always return self.flag = UIImage(named: "unknown", in: Bundle.FlagIcons, compatibleWith: nil)
To Reproduce Steps to reproduce the behavior:
- Load the VC whose has the txf
- Run the app
Expected behavior Appear the flag in the scrolldown
Screenshots
The flags don’t appear.

Smartphone (please complete the following information): iPhone X, iPhone 5s
FlagPhoneNumber (please complete the following information):
- Version from brunch: 4.2
- Version from brunch: Master
Additional context I tried all the steps of the other related issues: #15 and #57.
Thank you so much in advance!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 22 (6 by maintainers)
I’ve exactly the same issue, we I run the project on Xcode, the flag appear, but when I upload the app on testFlight, the flag doesn’t appear anymore
Copying FlagKit.xcassets to the app itself and adding this line to the AppDelegate didFinishLaunchingWithOptions fixed it for me
Bundle.FlagIcons = Bundle(for: type(of: self))It’s the same, sometimes the flags appear, others do not 😦
I fixed it by replacing flag assets by get country flag from system with country code
and the flag now is from type String so I changed the UIImageView to be UILabel and bind .text property to the new flag string. you can check the changes in this fork https://github.com/AhmedMohamedAllam/FlagPhoneNumber
@dbeleza and everyone else. What worked for me is :
Copying all the images in
FlagKit.xcassetsin my projectsAssetsand deleting all 1x and 3x files of all Flags. Just keep 2x Files.Changing the line 14 - 18 in
FPNCountry.swiftfromto
A workaround is like @Kriptite said:
Hi @grifas! Sorry for the delay! I have finally created a repo and it works with the version 0.7.2 but without success in older versions.
Thank you so much for the support!
Of course! Allow me a few days to create a basic project to integrate it and share it with you. Thank you very much for the quick response.