Skip to content

Get Started#

This step-by-step walkthrough covers how to create an iOS app using the Abound SDK.

When you're finished, you'll have an iOS app that can capture 3D models using the LiDAR Scanner.

You'll learn how to:

  • Install the Abound SDK.
  • Create an Abound account.
  • Configure your Abound API key.
  • Create and display a scanning view controller.
  • Deploy and run on an iOS device.

Requirements#

To complete this guide, make sure you have:

  • Xcode 13.4 or above.
  • iPhone 12 Pro, iPhone 12 Pro Max, or iPad Pro (2020 or later) running iOS 14.0 or above.

This tutorial takes 15 minutes to complete.

TL;DR

If you want to jump straight in:

  1. Add the Swift package dependency: github.com/aboundlabs/abound-ios-sdk.
  2. Add camera and location permissions.
  3. Create an Abound account and API key.
  4. Configure the SDK with your API key and present an AboundScanController:
    import Abound
    ...
    AboundServices.provideAPIKey("sk_your_api_key")
    present(AboundScanController(), animated: true)
    
  5. Read the reference documentation for further information.

Step 1: Create an Xcode project#

First, let's create a new iOS app using Xcode.

  • Open Xcode and select File > New > Project...
  • In the dialog that appears, select the iOS tab.
  • In the Application section, select App and then click Next.
  • Type a Product Name, e.g. MyCapture.
  • Choose Storyboard under Interface.
  • Choose Swift under Language and then click Next.
  • In the dialog that appears, select a location to save your project and then click Create.

Step 2: Add the Abound SDK#

Now that you have a project, you need to add the Abound SDK package to it.

  • Open File > Add Packages...
  • In the Search or Enter Package URL text box, enter the following:
    https://github.com/aboundlabs/abound-ios-sdk
    
  • Click Add Package.
  • Wait for the package to download.
  • In the dialog that appears, click Add Package.

In the Project Navigator, you should now see the Abound package under Package Dependencies.

Next, we need to disable bitcode for the project.

  • Select your project in the navigator area.
  • In the Build Settings pane, click All then Combined.
  • Under Build Options, change the Enable Bitcode setting to No.
  • Build the app by selecting Product > Build (or pressing ⌘B).

Step 3: Configure permissions#

Before using the camera and location services, we need to give your users a brief explanation of how they will be used.

  • Under Targets, click on your app's name.
  • Open the Info pane.
  • Move your mouse over the Custom iOS Target Properties table and click on to add a Key.
  • Type Privacy - Camera Usage Description and then press Tab and type the following.
    Scanning your space.
    
  • Click on again to add another Key.
  • Type Privacy - Location When In Use Usage Description and then press Tab and type the following.
    Scanning your space.
    

Step 4: Get an API key#

Now that the SDK is installed, you'll need an API key.

  • Create an Abound account, if you don't have one already.
  • Sign in to the Abound dashboard.
  • Click on Developer tab.
  • Click Generate API Key in the API Keys section.
  • Type an App Name, e.g. MyCapture, and then click Generate.
  • Select your API Key and press ⌘C to copy it to the clipboard.

Step 5: Add the API key#

Next, we'll provide your API key to the SDK.

  • In Xcode, open ViewController.swift and then add the highlighted code below.
  • Replace sk_your_api_key with the API key you generated in the previous step.
ViewController.swift
import UIKit
import Abound

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        AboundServices.provideAPIKey("sk_your_api_key")    // (1)
    }
}
  1. Make sure to replace sk_your_api_key with your API key found on the dashboard.
ViewController.h
#import "ViewController.h"

#import <Abound/Abound.h>

@interface ViewController ()

@end

- (void)viewDidLoad {
    [super viewDidLoad];

    [AboundServices provideAPIKey:@"sk_your_api_key"];    // (1)
}
  1. Make sure to replace sk_your_api_key with your API key found on the dashboard.

Step 6: Add the scan UI#

Now we're ready to add the scanning user interface.

We'll configure it by setting a message to display to the user before they start the scan.

  • Open ViewController.swift and enter the following code.
ViewController.swift
class ViewController: UIViewController {

    // ...

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)

        let scanController = AboundScanController()
        scanController.instructions = "Scan your space."
        present(scanController, animated: true)
    }
}
ViewController.h
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    AboundScanController* scanController = [[AboundScanController alloc] init];
    scanController.instructions = @"Scan your space.";
    [self presentViewController:scanController animated:YES completion:nil];
}

Info

See the SDK reference for more information about AboundScanContoller.


Step 7: Run your app#

That's it! You're ready to run your app.

At this stage, you'll be able to walk around and scan your environment but won't be able to save your scan. We'll add that capability in the next tutorial.

  • Connect your device to your computer with a USB cable.
  • Make sure your device is selected in the toolbar Scheme menu.
  • Run the app by clicking ▶ (or pressing ⌘R).

Tips for improving your scan

  • Make sure your device's camera lenses are clean.
  • Scan bright, well-lit areas.
  • Aim to keep between 0.5 to 3 meters between you and the surface you're scanning.
  • Avoid shiny, reflective, or transparent surfaces such as metal, mirrors, or windows.
  • Avoid objects that move such as people or animals.

Next steps#

In this tutorial, you created an app that can capture 3D scans.

To learn more about how to save these scans and access them via the dashboard, continue to the next tutorial.


Please send any feedback or suggestions to feedback@aboundlabs.com.