Home

Awesome

<img src="Polls/Images.xcassets/AppIcon.appiconset/app-3x.png" width=90 height=90 />

Polls Client

Build Status

This is a Swift iPhone and iPad client for the Polls API - a simple application allowing users to view polls and vote in them.

Polls is an example application utilising the Hyperdrive API client. Hyperdrive will communicate to the Polls API without any hard-coded knowledge about how the API is implemented, just an understanding of the semantics the API is using.

The application does this by learning how the API works at run-time. This can be achived in one of two ways:

Both the API and the application support both of these ways, you can switch between these modes in the application settings.

<img width=375 height=667 src="Screenshot.png" alt="Screenshot of Polls iOS Application" />

Quick Start

You will need to install CocoaPods and then run the following steps to checkout the project and install the dependencies.

$ git clone https://github.com/apiaryio/polls-app
$ cd polls-app
$ pod install
$ open Polls.xcworkspace

Architecture

This application uses the MVVM (Model View View-Model) software architecture. Where each view controller has an appropriate view model which contains all of the model logic. The view model in this case will encapsulate the logic required to communicate to the API.

The Polls application is constructed from three view controllers and view models:

API Root

The Polls iOS client can be configured to use any API root, or switch between connecting to a Hypermedia API or the JSON Polls API described via an API Blueprint. You can switch between these modes by entering the applications settings.

Defaults:

License

Polls is released under the MIT license. See LICENSE.