Convert Countries, Country Codes, Continents,... with a single line of code.

Overview

NVMRegion_header

iOS · macOS · watchOS · tvOS


A pure Swift library that allows you to easily convert Countries to Country Codes and Country Codes to Countries.

There is also support for other types. Currently all supported types are Countries, Alpha2Codes, Alpha3Codes and Numerics.

This project is created and maintained by Novem.


Installation

Swift Package Manager

You can use The Swift Package Manager (SPM) to install NVMRegion by adding the following description to your Package.swift file:

import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .package(url: "https://github.com/NVMNovem/NVMRegion", from: "1.0.0"),
    ]
)

Then run swift build.

You can also install using SPM in your Xcode project by going to "Project->NameOfYourProject->Swift Packages" and placing "https://github.com/NVMNovem/NVMRegion" in the search field. Then select the option that is most suited for your needs.

Usage Guide

Code

To use NVMRegion, there is no initalizing required. If you want to add custom Country Aliases, you need to add the in the initalizing of your app. Example use case for a custom country name for Belgium. The example will allow the translated version "België" to be converted to a Country: "Belgium".

@main
struct MyApp: App {    
    init() {
        NVMRegion.implementCountryAliases(["België" : .Belgium])
    }
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

This will make it possible to create a Country() object from "België". This is not required for default country names. NVMRegion also tries to find the most fitted country for each given string.

Country("België")

This will return a valid Country() object

(
Belgium
Continent: Europe
Alpha2 Code: BE
Alpha3 Code: BEL
Numeric: N056
)
You might also like...
A μlibrary in Swift containing all the countries with their localized name, ISO code, phone code, country code, flag image and emoji.

CountryKit CountryKit A μlibrary in Swift containing all the countries with their localized name, ISO code, phone code, country code, flag image and e

Countries - Simple iOS Project for search on Countries

Do like Countries 🏴‍☠️ Simple iOS Project for search on Countries The project c

Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle
Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle

Swiftly convert country codes and cultural terms to all 269 emoji flags without hassle

A simple, customizable Country picker for picking country or dialing code. 🇮🇳 🇯🇵 🇰🇷 🇩🇪 🇨🇳 🇺🇸 🇫🇷 🇪🇸 🇮🇹 🇷🇺 🇬🇧
A simple, customizable Country picker for picking country or dialing code. 🇮🇳 🇯🇵 🇰🇷 🇩🇪 🇨🇳 🇺🇸 🇫🇷 🇪🇸 🇮🇹 🇷🇺 🇬🇧

CountryPicker A simple, customizable Country picker for picking country or dialing code. This library is for country picker used in many app for selec

A customisable view for entering arbitrary length pins, codes or passwords in iOS. Supports iOS 12 one time codes.
A customisable view for entering arbitrary length pins, codes or passwords in iOS. Supports iOS 12 one time codes.

CBPinEntryView CBPinEntryView is a view written in Swift to allow easy and slick entry of pins, codes or passwords. It allows backspacing, dismissal o

CHIOTPField is a set of textfields that can be used for One-time passwords, SMS codes, PIN codes, etc. Mady by @ChiliLabs - https://chililabs.io
CHIOTPField is a set of textfields that can be used for One-time passwords, SMS codes, PIN codes, etc. Mady by @ChiliLabs - https://chililabs.io

CHIOTPField CHIOTPField is a set of textfields that can be used for One-time passwords, SMS codes, PIN codes, etc. All fields support insertion of one

A category on NSString to convert Emoji Cheat Sheet codes to their equivalent Unicode characters

NSString+Emojize A category on NSString to turn codes from Emoji Cheat Sheet into Unicode emoji characters. Getting Started In order to use NSString+E

Lightweight touch visualization library in Swift. A single line of code and visualize your touches!
Lightweight touch visualization library in Swift. A single line of code and visualize your touches!

TouchVisualizer is a lightweight pure Swift implementation for visualising touches on the screen. Features Works with just a single line of code! Supp

SSToastMessage is written purely in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.
SSToastMessage is written purely in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.

SSToastMessage SSToastMessage is written in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to b

Create gradients and blur gradients without a single line of code
Create gradients and blur gradients without a single line of code

EZYGradientView is a different and unique take on creating gradients and gradients with blur on the iOS platform. The default CAGradientLayer implemen

A simple solution to show a toast message by writing single one line of code
A simple solution to show a toast message by writing single one line of code

easySwiftToast A very simple solution to show a toast message by writing single one line of code. Installation easySwiftToast is available through Coc

Lightweight touch visualization library in Swift. A single line of code and visualize your touches!
Lightweight touch visualization library in Swift. A single line of code and visualize your touches!

TouchVisualizer is a lightweight pure Swift implementation for visualising touches on the screen. Features Works with just a single line of code! Supp

An auto-layout base UITextView subclass which automatically grows with user input and can be constrained by maximal and minimal height - all without a single line of code

Deprecated This library is no longer maintained and is deprecated. The repository might be removed at any point in the future. MBAutoGrowingTextView A

Rosetta Enforcer is a macOS utility designed to help developers convert Universal Binary application to Single Architecture, vice versa.
Rosetta Enforcer is a macOS utility designed to help developers convert Universal Binary application to Single Architecture, vice versa.

Rosetta Enforcer Rosetta Enforcer is a macOS utility designed to help developers convert Universal Binary application to Single Architecture, vice ver

A pure Swift library for using ANSI codes. Basically makes command-line coloring and styling very easy!

Colors A pure Swift library for using ANSI codes. Basically makes command-line coloring and styling very easy! Note: Colors master requires Xcode 7.3

A pure Swift library for using ANSI codes. Basically makes command-line coloring and styling very easy!

Colors A pure Swift library for using ANSI codes. Basically makes command-line coloring and styling very easy! Note: Colors master requires Xcode 7.3

A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.
A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.

TimeZonePicker A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your

DevSwitch - An iOS app for switching between countries on the App Store with ease.
DevSwitch - An iOS app for switching between countries on the App Store with ease.

Archived as of 24/04/2021. Apple has again broken the URLs required for storefront switching. I've decided to archive DevSwitch due to this. If Apple

Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...

Alerts & Pickers Advanced usage of native UIAlertController with TextField, TextView, DatePicker, PickerView, TableView, CollectionView and MapView. F

Owner
Novem
Novem
A μlibrary in Swift containing all the countries with their localized name, ISO code, phone code, country code, flag image and emoji.

CountryKit CountryKit A μlibrary in Swift containing all the countries with their localized name, ISO code, phone code, country code, flag image and e

Alessandro 24 Nov 11, 2021
Countries - Simple iOS Project for search on Countries

Do like Countries ??‍☠️ Simple iOS Project for search on Countries The project c

Amir Ardalan 0 Feb 27, 2022
A simple, customizable Country picker for picking country or dialing code. 🇮🇳 🇯🇵 🇰🇷 🇩🇪 🇨🇳 🇺🇸 🇫🇷 🇪🇸 🇮🇹 🇷🇺 🇬🇧

CountryPicker A simple, customizable Country picker for picking country or dialing code. This library is for country picker used in many app for selec

Suryakant 243 Dec 8, 2022
🎯 Swift country and phone code Picker

CountryPicker Picker code Swift 3 / 4 / 5. Example To run the example project, clone the repo, and run pod install from the Example directory first. U

null 207 Dec 22, 2022
A simple, customizable view for efficiently collecting country information in iOS apps.

CountryPickerView CountryPickerView is a simple, customizable view for selecting countries in iOS apps. You can clone/download the repository and run

Kizito Nwose 459 Dec 27, 2022
A country picker view controller for iOS

Planet A country picker view controller for iOS. Installation CocoaPods You can use CocoaPods to install Planet by adding it to your Podfile: platform

kWallet 71 Jul 11, 2022
MICountryPicker is a country picker controller for iOS8+ with an option to search.

MICountryPicker MICountryPicker is a country picker controller for iOS8+ with an option to search. The list of countries is based on the ISO 3166 coun

Mustafa Ibrahim 90 Mar 27, 2021
A drop in single image picker.

PHSingleImagePicker A low memory, single image picker wrapper that provide a significant smaller file size while also preserve high image quality. Int

Phanith NY 0 Nov 6, 2021
React-native-place-picker: Pick any place with single click 🚀

React-native-place-picker: Pick any place with single click ??

b0iq 59 Dec 29, 2022
Countries - The application lists countries parsed from GeoDB Cities API and lets the user see the details of countries

Countries The application lists countries parsed from GeoDB Cities API and lets

Tuncer 0 Jan 8, 2022