Latest 0.1.7
Homepage https://github.com/sh3at90/CountrySelectorLib
License MIT
Platforms ios 10.0
Dependencies libPhoneNumber-iOS
Authors
  • Choose the country (flag, Mobile Code, Mobile Number Example)
  • Support localization
  • Support multiple controls ActionSheet , UIAlertViewController , SearchBarController

Installation

using pods

pod 'CountrySelectorLib', '~> 0.1.7'

Usage

Action Sheet

action sheet

import CountrySelectorLib

 let counterySelectorSearchBar  = CounterySelectorSearchBar( )     
 counterySelectorSearchBar.showAlertViewController(parent:self,actionSheetStyle: .actionSheet)

// there are another optional parameters

 counterySelectorSearchBar.showAlertViewController(parent: self, actionSheetStyle: .actionSheet, hideSarchBar: true, cancelTitle: "Cancel", searchTitle: "Search For Country")

Alert View

alertview

import CountrySelectorLib

 let counterySelectorSearchBar  = CounterySelectorSearchBar( )     
 counterySelectorSearchBar.showAlertViewController(parent:self,actionSheetStyle: .alert)

// there are another optional parameters

 counterySelectorSearchBar.showAlertViewController(parent: self, actionSheetStyle: .alert, hideSarchBar: true, cancelTitle: "Cancel", searchTitle: "Search For Country")

SearchBarController

serachviewcontroller

import CountrySelectorLib
showCounteryCodeViewController(delegate: self)

// there are another optional parameters

showCounteryCodeViewController(delegate: self, cancelTitle: "Cancel", searchPlaceHolder: "Search", viewControllerTilte: "Search For Country")

you should implement Delegate

extension ViewController: CounterySelectorDelegate {
    func selectCountery(countery: Country) {
        self.counteryImage.image = countery.counterFlag
        self.countryNameLabel.text = countery.name
        self.counteryCodeLabel.text = countery.phoneCode
        self.mobileNumberExample.text = countery.phoneNumberExample
       self.dismiss(animated: true, completion: nil)
    }
}

Latest podspec

{
    "name": "CountrySelectorLib",
    "version": "0.1.7",
    "summary": "CountrySelectorLib is library for select country code and flag with multiple ios controls ex actionAheet , alertview and searchController",
    "description": "CountrySelectorLib is library for select country code and flag with multiple ios controls ex actionAheet , alertview and searchController",
    "homepage": "https://github.com/sh3at90/CountrySelectorLib",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "": ""
    },
    "source": {
        "git": "https://github.com/sh3at90/CountrySelectorLib.git",
        "tag": "0.1.7"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "CountrySelectorLib/**/*.{lproj,storyboard,xcdatamodeld,xib,json,swift}",
    "dependencies": {
        "libPhoneNumber-iOS": []
    },
    "resources": "CountrySelectorLib/**/*.{xcassets,png,json}"
}

Pin It on Pinterest

Share This