Latest 1.3.1
Homepage https://github.com/nationbuilder/nationbuilder-ios
License MIT
Platforms ios 9.0, requires ARC
Authors

NationBuilder iOS SDK

CI Status
Version
License
Platform

Usage

To try out the sample app (NB Sample), follow these steps.

  1. Make sure you clone this repo and download Xcode. You’ll eventually need to
    run and build the NBClientExample project. Before that you need to install some
    dependencies:

    ~> sudo gem install -N cocoapods
    nationbuilder-ios> pod install
  2. Open NBClient.workspace. Make sure to delete the configuration file at
    ./NBClientExample/NBClientExample/NationBuilder-Info-Local.plist. Build and
    run using the NBClientExample scheme.

  3. Using the NationBuilder Control Panel, go to Settings > Apps > Install new app install. Install the NBClientExample app for your nation.

  4. Open the previously built NB Sample app in the iOS Simulator.

  5. In the app, click the signin button on the top left. Provide your nation’s
    slug. In an in-app Safari window (SFSafariViewController), sign into your
    account on your nation and authorize the app.

Refer to the documentation section and the implementation checklist on
how to use the SDK to build your app. Note that the sample app intends to be a
modest example of using the NBClient library. It intends to use modern iOS
conventions, no external dependencies, and stock UIKit classes.

Code Samples

If the code in the sample app is too much for you, we have code samples in
Objective-C and Swift that just contain a
sample UIAppDelegate subclass.

Swift

Swift support is now available. It has only been tested on Xcode 6.3+. There
are a couple additional things to do for using Swift with the SDK, and they
are listed in the code sample.

Features

Authentication & Authorization:

Via an in-app Safari window (SFSafariViewController), sign into your nation
and authorize the application.

authentication gif

Account Management & Persistence:

Sign into multiple nations or different accounts on the same nation. Accounts
get stored and persist across app uses. Note the authentication happens via an
in-app Safari window (SFSafariViewController).

accounts gif

Methods for API Endpoints:

Use the client to fetch and manipulate data via the NationBuilder API, to save
you time to focus on building the rest of your app.

people crud gif

Installation

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

pod 'NBClient', '~> 1.3.0'

Requirements

The SDK requires iOS 9 and above. All included UI components (the accounts
component, the sample app) are universal, supporting both iPhone and iPad.

Documentation

Detailed guides and code samples are at NationBuilder [iOS developer
documentation][]. Or, if you prefer reading on Github or want to contribute
edits, the guides are also available on Github.

Testing

You can pass the arguments in .travis.yml to xctool (brew install xctool)
to run manually. The simpler alternative is to run tests in Xcode for the
NBClient scheme.

License

NBClient is available under the MIT license. See the LICENSE file for more info.

Credits

The NBClient/UI component uses the Stroke 7 Icon Font Set by Pixeden.

Next: Installing ➔

Latest podspec

{
    "name": "NBClient",
    "version": "1.3.1",
    "license": "MIT",
    "summary": "An iOS client to the NationBuilder API.",
    "homepage": "https://github.com/nationbuilder/nationbuilder-ios",
    "authors": {
        "Peng Wang": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nationbuilder/nationbuilder-ios.git",
        "tag": "1.3.1"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "default_subspecs": [
        "Core",
        "UI",
        "Locale/en"
    ],
    "subspecs": [
        {
            "name": "Core",
            "dependencies": {
                "NBClient/Locale": []
            },
            "frameworks": [
                "Security",
                "UIKit"
            ],
            "source_files": "NBClient/NBClient/*.{h,m}",
            "exclude_files": "NBClient/UI",
            "private_header_files": "NBClient/NBClient/*_Internal.h"
        },
        {
            "name": "UI",
            "dependencies": {
                "NBClient/Core": []
            },
            "frameworks": [
                "UIKit",
                "CoreText"
            ],
            "source_files": "NBClient/NBClient/UI/*.{h,m}",
            "resources": [
                "NBClient/NBClient/UI/*.xib",
                "NBClient/NBClient/UI/NBClient_UI.xcassets",
                "NBClient/NBClient/UI/pe-icon-7-stroke.ttf"
            ]
        },
        {
            "name": "Locale",
            "subspecs": [
                {
                    "name": "All",
                    "preserve_paths": "NBClient/NBClient/*.lproj",
                    "resources": "NBClient/NBClient/*.lproj"
                },
                {
                    "name": "en",
                    "preserve_paths": "NBClient/NBClient/en.lproj",
                    "resources": "NBClient/NBClient/en.lproj"
                }
            ]
        }
    ]
}

Pin It on Pinterest

Share This