Swiftpack.co - Adobels/BSCountryViewController as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Adobels.
Adobels/BSCountryViewController 0.1.5
A standard view controller whose interface lets the user select a country or group of countries.
⭐️ 1
🕓 4 years ago
iOS
.package(url: "https://github.com/Adobels/BSCountryViewController.git", from: "0.1.5")

BSCountryViewController

CI Status CI Status Version Platform

Requirements

Minimum: Swift 5.1.0, Xcode 11.0.0, iOS 9.0.0

Installation

CocoaPods

BSCountryViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'BSCountryViewController'

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but Alamofire does support its use on supported platforms.

Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/Adobels/BSCountryViewController.git", .upToNextMajor(from: "1.0.0"))
]

Usage

    import UIKit
    import BSCountryViewController

    class ViewController: UIViewController {
        
        @IBAction func didTapPresentCountriesPickerButton() {
            let vc = BSCountryViewController()
            vc.delegate = self
            present(vc, animated: true, completion: nil)
        }
    }

    extension ViewController: BSCountryViewControllerDelegate {
        func didSelectRegions(_ regions: [String]) {
            debugPrint("--- didSelectRegions ---")
            debugPrint(regions)
        }
        
        func didTapDoneButton(with regions: [String]?) {
            debugPrint("--- didTapDoneButton ---")
            debugPrint(regions ?? "regions array is nil")
            dismiss(animated: true, completion: nil)
        }
    }

Screenshot

BSCountryViewController screenshot animated gif

GitHub

link
Stars: 1
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

4 years ago

Add Swift Package Manager

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics