Skip to content

Getting Started

jeremyosterhoudt edited this page Dec 12, 2017 · 16 revisions

PredixUIKit

The PredixUIKit for iOS is the easiest way to use ready-to-use user interface (UI) components that easily integrate with the Predix SDK for iOS and follow the Predix Design System.

Features

For a complete list of features, see the features list from the main documentation page

Prerequisites

This guide is for users familiar with Xcode, the Swift programming language, and the Swift coding concepts. If you are not already familiar with these technologies and concepts you may want to consider reading Apple's Getting Started documentation before continuing with this guide.

Before You Begin:

  • Read the README file.
  • You are using a Mac (you can not develop iOS/MacOS/TVOS/WatchOS applications on Windows or Linux).
  • Download Xcode 9.2 or later
  • Download and install the latest version of Carthage
  • If you are behind a firewall/proxy ensure access GitHub from the Mac Terminal

Install and Configure the PredixUIKit

  1. If you haven’t already, install the latest version of Carthage
  2. Create a folder where you are going to create your project
  3. Create a file named cartfile (the cartfile needs to be a plain text file. TextEdit can can do this by selecting Format->Make Plain Text)
  4. Enter the following dependencies into the cartfile:
binary "https://raw.githubusercontent.com/PredixDev/PredixSDKForiOS/master/Carthage/ios.json" >= 0.7
github "danielgindi/Charts" >= 3.0.4
github "PredixDev/PredixMobileUIKit" >= 0.3
  1. Open the Terminal and navigate to the folder where you created the cartfile
  2. Run carthage update
  3. Once carthage has finished running move on to the next section

Create a New Project

Open XCode and create a Single View App Xcode

File > New > Project > iOS > Single View App

Including the Dependencies in your Application

  1. Open your application's project in Xcode
  2. Locate the PrediMobileUIKit.xcodeproj in finder and drag it into your Xcode project under the main project. If you used carthage the directory will be ./Carthage/Checkout/PredixMobileUIKit

Find project in finder

  1. Select your base Xcode project
  2. Select the General tab in the editor window
  3. Scroll down to the Embedded Binaries section and press the + button

Where to add binary

  1. Press the Add Other... button
  2. Navigate to the base directory you created when you started the guide and then find the PredixSDK.framework and PredixMobileUIKit.framework and then select open. If you used carthage the frameworks can be found in ./Carthage/Build/iOS

Add the frameworks

Using the Frameworks in Interface Builder

  1. Open the projects Storyboard and select the View Controller
  2. Set the following:
class: PredixDonutView
module: PredixMobileUIKit

If the set up is successful, you will see the following image in the Interface Builder:

Add the frameworks

Including the Frameworks in Xcode

  1. Open the projects ViewController.swift file and include the following imports:
import UIKit
import PredixMobileUIKit
import PredixSDK
  1. Compile the project.

If your build is not successful, please try these tips

  1. Select you project, then your target and finally the Build Settings tab.
  2. In the search box enter "framework search path"
  3. Make sure the property for the framework search path is $(PROJECT_DIR)/../Carthage/Build/iOS if you used Carthage (you may need to adjust this to point to the folder where the frameworks are if you compiled and downloaded the projects yourself).

Trouble shooting

Next Steps

download the complete Carthage example project

Getting Started

Features

  • Data Visualization (Coming soon!)
  • UAA Authentication View (Coming soon!)
  • Time Series View (Coming soon!)

How-To Guides:

  • Getting Started
  • Authentication (Coming soon!)
  • Time Series View (Coming soon!)
  • Data Visualization (Coming soon!)
  • Troubleshooting Tips (Coming soon!)

API Documentation:

Clone this wiki locally