Giter Club home page Giter Club logo

countrypickerview's People

Contributors

aligermiyanoglu avatar carsonxyz avatar dulgan avatar hojatdelfan avatar itsniper avatar kdovbush avatar kizitonwose avatar remy-shopopop avatar senuraa avatar serjooo avatar ss18 avatar subhajitregor avatar tejasna avatar zfoltin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

countrypickerview's Issues

crash in search and select code

Application tried to present modal view controller on itself. Presenting controller is <UISearchController: 0x7ff30a247c40>.'

SearchBar search style

How can I change searchStyle of searchBar?

I've tried viewController.searchController?.searchBar.searchBarStyle = .minimal in delegate's didShow method, but in this case user will see transition from old to new style. willShow is too early, searchController is not initializated.

Unable to initilize Countrypicker View

I am trying to initialise country picker view as suggested in the demo.
let countryPicker = CountryPickerView()
But the compiler asks for the Missing argument for parameter 'countryCodes' in call.
I am able to run the demo project successfully. But not able to use it in my project.
Any help will be appreciated.

Cannot change the country code label color

I found this when I tried it in a UITextField with dark background.
Also we can give user the support to change the Font.
I created a pull request adding these feature

crash in search and select code

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modal view controller on itself. Presenting controller is <UISearchController: 0x7ffccd57b340>.'
//my code
var CountryPickerCode = CountryPickerView()
override func viewDidLoad() {
super.viewDidLoad()
CountryPickerCode = CountryPickerView(frame: CGRect(x: 0, y: 0, width: txtCode.frame.size.width-10, height: txtCode.frame.size.height-10))
CountryPickerCode.delegate=self
txtCode.leftView = CountryPickerCode
txtCode.leftViewMode = .always
}
func countryPickerView(_ countryPickerView: CountryPickerView, didSelectCountry country: Country) {

    self.CountryCode=country.phoneCode
    txtCode.leftView=CountryPickerCode
    txtCode.leftViewMode = .always

}

Changing Navigation bar color

Navigation bar changes color after tap on search field and tap Cancel. after that if return to parent view, navigationBar color changed and there. After second time, in the bottom of navigationBar appears black line.

Swift 5 not supported

Library does not support swift 5 and it is a problem. Possible estimates?
Edit. Closing, will fork and compile in swift 5.0

The name of the Iran country is wrong

Hello
Please change the name of Iran country from "Iran, Islamic Republic of Persian Gulf" to "Islamic Republic of Iran" in CountryCodes.json file.
Of course "Iran" itself can be used

Scrolling lags.

Why scrolling is lagging? I am getting these outputs in console and scroll lags noticeably. Is this alright and nothing can be done?
[UIWorkIntervalTiming] workIntervalStart: startTimestamp > targetTimestamp; rolling forward by 0.066730
2019-07-21 21:35:28.575370+0300 testing[629:19916] [UIWorkIntervalTiming] workIntervalStart: startTimestamp > targetTimestamp; rolling forward by 0.049998
2019-07-21 21:35:32.110095+0300 testing[629:19916] [UIWorkIntervalTiming] workIntervalStart: startTimestamp > targetTimestamp; rolling forward by 0.299243
2019-07-21 21:35:33.497742+0300 testing[629:19916] [UIWorkIntervalTiming] workIntervalStart: startTimestamp > targetTimestamp; rolling forward by 0.199321
2019-07-21 21:35:34.913068+0300 testing[629:19916] [UIWorkIntervalTiming] workIntervalStart: startTimestamp > targetTimestamp;

Unable to present countryList from NavigationController

In my app every viewController is present modally, But my countryList view controller is pushed from left on Login screen, I don't know why ? I had also tried passing nil to hostViewController in viewWillAppear and vice versa, but doesn't work.
In my other two classes Registration and Update profile countryList is present modally perfectly.
Please see the attached image of my storyboard.

Screenshot 2019-05-22 at 2 54 26 PM

when will bitcode be enabled

Hello, when will bitcode be enabled for countryPickerview? This makes our project enable to archive. Can you fix it soon?
ld: bitcode bundle could not be generated because '/...-hkkklqumysmrlnaulunyqgxvswbc/Build/Products/Release-iphoneos/CountryPickerView/CountryPickerView.framework/CountryPickerView' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file '/..-hkkklqumysmrlnaulunyqgxvswbc/Build/Products/Release-iphoneos/CountryPickerView/CountryPickerView.framework/CountryPickerView' hkkklqumysmrlnaulunyqgxvswbc/Build/Products/Release-iphoneos/CountryPickerView/CountryPickerView.framework/CountryPickerView' for architecture arm64

Why I get check icon next to country

I press customCountry button which launches country list. For some strange issue I can see one country as already being checked... In some devices this country is in the middle of the list, and on some it is the first country.

Also if I remove countries from list or add some, it also affects country List and makes a single country checked. I would like to know why some countries become selected even without pressing them? It is definitively a bug which really creates problems for our use case... I would like to contribute for fixing this version.

does not conform to protocol

Hi, I'm using Xcode 9.2 and Swift 4
When I'm trying to implement delegate method didSelectCountry, I get the error:

Type 'MBRegisterTableViewController' does not conform to protocol 'CountryPickerViewDelegate'

but I already have

func countryPickerView(_ countryPickerView: CountryPickerView, didSelectCountry country: Country) {}

Using this in Obj-C

Hi
Is there a way to use this lib in an objective C project ?
Thanks for any input.

How to change padding in UIView?

How can I change margin of country label and flag inside UIView which is used as CountryPickerView? Right now flag does not have any margin to the parent view..

Full country Name

How to show Full country Name.
Country phone Code Hiding is not working.

set custom locale or change text

How can I change locale with selection? User can select different languages in our app and we override strings. How can I also override default locale in countryPickerView? If that is impossible, how can I access strings of countryPickerView and set them myself? I need to change text of Back, search and Cancel

Flag for Iraq

The flag of Iraq is still the old one. Please update the image of the Iraq flag.

Weird delegate issue

I'm facing a weird issue with delegates of the view, I added the function and I still get it's required and added wrongly when click fix, anyone knows what's wrong?
screen shot 2018-05-08 at 12 58 09 am

Cant print phone number together with the selected country

import UIKit
import CountryPickerView
class LoginController: UIViewController{

@IBOutlet weak var phoneNumber: UITextField!
override func viewDidLoad() {
    super.viewDidLoad()

    
    
    // Do any additional setup after loading the view, typically from a nib.
    
    phoneNumber.setBottomBorder(backGroundColor: .white, borderColor: GREEN_THEME)
    let cpv = CountryPickerView(frame: CGRect(x: 0, y: 0, width: 120, height: 20))
    phoneNumber.leftView = cpv
    phoneNumber.leftViewMode = .always
    
    

    
   
    
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

@IBAction func loginAction(_ sender: Any) {
    print("\(phoneNumber.text)")
 
}

}

`

South Korea data is wrong.

In CountryCodes.json, South korea data is now like this.
{
"name": "Korea, Republic of South Korea",
"dial_code": "+82",
"code": "KR"
}
But, South Korea's official name is "Republic of Korea", or "Korea, Republic of Korea".

Does it support Arabic?

Even if I change the locale into Arabic, this picker view is showing only English Country name.

Present CountryList From NavigationController

i have a UINavigationController that presents A ModalViewController , the ModalViewController contains the CountryPickerView, so when the CountryPickerView is tapped, the CountryPickerViewController is pushed behind the ModalViewController and not Presented , this how the Library is built and can be easily Fixed, by adding a choice of Present or push

public func showCountriesList(from viewController: UIViewController) {
        let countryVc = CountryPickerViewController(style: .grouped)
        countryVc.countryPickerView = self
        if let viewController = viewController as? UINavigationController {
            delegate?.countryPickerView(self, willShow: countryVc)
            viewController.pushViewController(countryVc, animated: true) {
                self.delegate?.countryPickerView(self, didShow: countryVc)
            }
        } else {
            let navigationVC = UINavigationController(rootViewController: countryVc)
            delegate?.countryPickerView(self, willShow: countryVc)
            viewController.present(navigationVC, animated: true) {
                self.delegate?.countryPickerView(self, didShow: countryVc)
            }
        }
    }

i can present it Manually Ofc and it works since the ModalViewController is not part of the UINavigationController , but i can't override the tapGesture thats provided by the View.

any help would be Wonderful

Carthage doesn't work

error;
019-02-15 15:50:52.666326+0300 "[15045:5380788] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/containers/Bundle/Application/8952FEB6-1515-4844-B9AF-18975BCBF6C3/xxx.app/Frameworks/CountryPickerView.framework/CountryPickerView.bundle> (not yet loaded)' with name 'CountryPickerView''
@kizitonwose
Can you try carthage?

Can't dismiss the CountryPickerViewController if the navigation bar is hidden

Steps to reproduce

  1. UIViewController embedded in the navigation controller with a hidden navigation bar
  2. Text field has the CountryPickerView as a left view
  3. User taps on the country code view.

Actual behavior
The CountryPickerViewController is pushed (because of the navigation controller), but there is no navigation bar with back button (see attached screenshot).

Expected behavior
The CountryPickerViewController has navigation bar with back or close button.

Additional context
Currently I can't find an easy way to present a picker controller if UINavigationController is a top view controller. This can be done by calling showCountryList method, but this method is called automatically if you tap on the text field left view.
It would be better to have an optional parentViewController property in the CountryPickerView class, that will allow you to specify which controller should present the CountryPickerViewController. If the property is nil, execute the current solution.

Screenshots
Simulator Screen Shot - iPhone X - 2019-03-18 at 19 26 00

UISearchControllerDelegate - searchBarTextDidBeginEditing must be declared public

Version - 2.2.5
Installed through CocoaPods -
pod 'CountryPickerView', '~> 2.2.5'

Circle ci builds started to fail after updating to 2.2.5, local builds are fine, only when the archive is made on ci server the following error occurs, any advice or direction is much appreciated!

Stack trace -

[06:43:20]: ▸ Copying CountryPickerView-umbrella.h
[06:43:20]: ▸ Compiling CountryPickerView.swift
[06:43:20]: ▸ Compiling CountryPickerViewController.swift
[06:43:20]: ▸ ❌ /Users/distiller/project/Pods/CountryPickerView/CountryPickerView/CountryPickerViewController.swift:231:18: method 'searchBarTextDidBeginEditing' must be declared public because it matches a requirement in public protocol 'UISearchBarDelegate'
[06:43:20]: ▸ private func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
[06:43:20]: ▸ ~~~~~~~ ^
[06:43:20]: ▸ ❌ /Users/distiller/project/Pods/CountryPickerView/CountryPickerView/CountryPickerViewController.swift:237:18: method 'searchBarCancelButtonClicked' must be declared public because it matches a requirement in public protocol 'UISearchBarDelegate'
[06:43:20]: ▸ private func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
[06:43:20]: ▸ ~~~~~~~ ^
[06:43:20]: ▸ ❌ /Users/distiller/project/Pods/CountryPickerView/CountryPickerView/CountryPickerViewController.swift:248:18: method 'willPresentSearchController' must be declared public because it matches a requirement in public protocol 'UISearchControllerDelegate'
[06:43:20]: ▸ private func willPresentSearchController(_ searchController: UISearchController) {
[06:43:20]: ▸ ~~~~~~~ ^
[06:43:20]: ▸ ❌ /Users/distiller/project/Pods/CountryPickerView/CountryPickerView/CountryPickerViewController.swift:252:18: method 'willDismissSearchController' must be declared public because it matches a requirement in public protocol 'UISearchControllerDelegate'
[06:43:20]: ▸ private func willDismissSearchController(_ searchController: UISearchController) {
[06:43:20]: ▸ ~~~~~~~ ^
[06:43:20]: ▸ Compiling Delegate+DataSource.swift
[06:43:20]: ▸ Compiling Extensions.swift
[06:43:20]: ▸ Compiling NibView.swift
[06:43:20]: ▸ ** ARCHIVE FAILED **
[06:43:20]: ▸ The following build commands failed:
[06:43:20]: ▸ CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
[06:43:20]: ▸ CompileSwift normal arm64 /Users/distiller/project/Pods/CountryPickerView/CountryPickerView/CountryPickerViewController.swift
[06:43:20]: ▸ (2 failures)

Search bar issue

Hey 👋 first of all thank you for this library! I'm using the latest version on iOS 12.1 and the problem with searchbar still occurs (I saw that it was already closed here #13). Can you fix it? :)

image

Logo Proposal

Hello...
Came across your very nice project and as logo designer who loves to contribute to open source projects, I want to help contribute by creating a unique logo for your project which will give it its own identity.
Working on some cool logo design ideas currently... I will post the idea concepts here once i complete it, so you can give me your feedback to make any changes or tweak to suit your needs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.