In this blog we'll walk through getting started using Xuni iOS in Xcode, from downloading Xuni to building your first iOS app.
Xuni is distributed as a set of frameworks for the iOS platform. To obtain them, you should download and install Xuni which gives you the frameworks as well as our samples. Once you've installed Xuni, you'll be able to import these frameworks into your Xcode projects. In part 4, we'll look at how to add them to your projects.
As you become more familiar with Xuni, it's likely that you'll want a reference for the various features available. Xuni is available for multiple platforms, so there are multiple versions of the documentation. For iOS users, the most relevant information will be available in these two locations:
The Xuni iOS documentation includes code for Objective-C and Swift, and you'll also notice some C#. This code is meant for Xamarin.iOS users, and, for the average iOS developer, this won't come into play.
If you're evaluating Xuni iOS for the first time, the simplest and quickest way to test the controls on your personal device or the iOS simulator is to run the samples. When you install Xuni, the samples get installed at \Documents\Xuni\iOS\Samples\. You can also check out the latest samples from GoXuni on GitHub. That way you can view the code on GitHub without storing anything locally. At either location, we have several sample projects: one for each major control. These projects will work in Xcode. The projects that are included with the installer you can build and run immediately. You can also start digging into the code to play with the controls and see how they work. Xuni controls require a runtime license key, which our samples have included. Part 4 will focus on licensing new projects. There's also the Xuni Explorer demo app, which you can install from the AppStore. It's an easy way of testing out what controls and features are available without wading into any code. Now you can easily run our samples, but eventually you'll want to create your own projects using Xuni controls.
For this part, I've created a video to demonstrate adding Xuni to an Xcode project. These videos walk you through:
Getting Started with Xuni iOS and Xcode.
Licensing is a required step to evaluate or use Xuni's iOS controls within your own app. The Xuni controls contain runtime license validation per app. As I mentioned above, the samples already have a license key unique to that sample so they run "out of the box." You can generate runtime keys on goxuni.com. For this step I'll provide both a video guide and set of directions you can follow below.
Getting Started with Xuni iOS and Xcode. To generate a runtime key for your app:
For Objective C: a. Import XuniCoreKit.h and License.h
#import <XuniCoreKit/XuniCoreKit.h>
#import "License.h"
b.In the AppDelegate's didFinishLaunchingWithOptions method, set the XuniLicenseManager key to the key you generated earlier:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[XuniLicenseManager setKey:key];
return YES;
}
For Swift: a. Import XuniCoreKit
import XuniCoreKit
b.In the AppDelegate's didFinishLaunchingWithOptions method, set the XuniLicenseManager key to the key you generated earlier:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
XuniLicenseManager.setKey(License().key)
return true
}
Now you should be up and running with Xuni iOS. If you decide to purchase Xuni, you'll be given a serial number. You can register that serial number on your My Account page, and when you generate new app keys, you'll be able to select your serial number rather than selecting Evaluation. For full steps on licensing, check out the documentation. Thanks for reading and thanks for evaluating Xuni!