The SDK requires iOS 13+ target, has Swift API, and is available via Swift Package Manager or for direct download.

Integration methods

There are two ways to integrate Smartlook into your app.

Swift Package Manager

Add Smartlook Analytics Swift Package:

https://github.com/smartlook/analytics-swift-package

Direct integration

Smartlook can also be added directly to the app project by downloading our latest iOS SDK (2.0.1):

<<current-ios-2-0-sdk-download>>

unzipping the file, and adding SmartlookAnalytics.xcframework to the Xcode project.

Setup and Start Recording

To setup and start recording with Smartlook, Smartlook must be imported and configured, e.g., in AppDelegate and its didFinishLaunching method:

πŸ“˜

API Key

To setup Smartlook, the unique project API Key is needed. It can be found in the mobile project settings in the Smartlook Dashboard.

import Smartlook

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  
  Smartlook.instance.preferences.projectKey = "project_key"
  Smartlook.instance.start() 

  return true
}

Smartlook now starts recording the app. The recordings will appear in the Smartlook player shortly.

πŸ“˜

Recording when on mobile network

SDK will upload sessions only on WiFi. When uploading on mobile connections is requested, too, it must be enabled in the project settings in the dashboard. More details about the recording process can be found in the Conceptual documentation

🚧

Xcode's Main Thread Checker

When starting in debug mode, your iOS app may stop for a few seconds after this it will start and print a warning when Smartlook is included.
It is caused by Xcode's Main Thread Checker diagnostics. Read more about why it happens and how to handle it in this Technical Note.