iOS Setup

Prerequisites

You’ll need the following before you can begin:

  • Xcode 10.3 or later.
  • Xcode project targeting iOS 10 or above. You will only be able to use features in iOS 11+, but you still can include Fritz in apps that target iOS 10+ and selectively enable for users on 11+.
  • Swift projects must use Swift 5.0 or later.
  • CocoaPods 1.6.0 or later.
  • The bundle identifier of your app.

Installing the SDK

Add the Fritz SDK to your app using the following instructions. Before you add the SDK, you’ll need to create a project.

1. Add the SDK via CocoaPods

  • Create a Podfile if you don’t have one: $ pod init.
  • Open your Podfile and add: $ pod 'Fritz'.
  • Save the file and run: $ pod install.

This creates a .xcworkspace file for your app. Use this file for all future development on your application.

2. Make sure your app is registered

After creating a project, you must register your app. If you have not done so, you can add an app from the Project Overview page.

3. Add Fritz-Info.plist to your app

Add the Fritz-Info.plist file to your app. Make sure to include it in all targets.

If you do not have the Fritz-Info.plist file, you can download it from the Project Settings page for your project. Click the plus button on the appropriate app and download.

4. Initialize in AppDelegate

Initialize the SDK in your AppDelegate. Afterward you’ll be able to use features or add your own custom models.

import UIKit
import Fritz

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(_ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?)
    -> Bool {
    FritzCore.configure()
    return true
  }
}

Initialize the SDK in your AppDelegate. Afterward you’ll be able to use features or add your own custom models.

// AppDelegate.h

@import UIKit;
@import Fritz;
@import CoreML;

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end
// AppDelegate.m
#import "AppDelegate.h"

@interface AppDelegate ()
@end

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [FritzCore configure];

    return YES;
}