Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Latest commit

 

History

History
55 lines (38 loc) · 3.14 KB

building-documentation.md

File metadata and controls

55 lines (38 loc) · 3.14 KB

Accessing ARHeadsetKit Documentation and Tutorials

Follow the steps below to view ARHeadsetKit's tutorials in the Xcode documentation viewer.

Creating an Xcode project

  1. In Xcode, go to File -> New -> Project.
  2. Ensure you are under the "iOS" template section.
  3. The "App" template is selected by default. Leave this template selected.
  4. Click "Next". Enter "ARHeadsetKit Documentation" as the product's name.
  5. Under "Team", select your Apple account.
  6. Click "Next" and save the project.

If this is your first time using Xcode, perform the following steps to ensure the project can compile:

  1. Connect your iPhone or iPad to your Mac.
  2. At the top of the Xcode window, a simulator will be selected as the run destination. Change that to your device.
  3. Press Cmd + B. No errors should appear in Xcode.

Adding the Swift package

  1. In the menu bar, go to File -> Add Packages. A window for searching Swift packages will pop up.
  2. In the search bar on the top right, paste this link: https://github.com/philipturner/ARHeadsetKit
  3. Set "Dependency Rule" to "Branch". Ensure "main" is in the text box to the right of that.
  4. Click "Add Package" on the bottom right. Click "Add Package" again in the window that pops up.

Building documentation

  1. Press Ctrl + Cmd + Shift + D. The documentation viewer will pop up.
  2. In the navigator on the left, there is a section titled "Workspace Documentation". "ARHeadsetKit Documentation" will appear underneath it, with a blue Xcode logo next to it.
  3. Unravel the contents of "ARHeadsetKit Documentation" and click "Welcome to ARHeadsetKit".
  4. Go to Chapter 1: Essentials. Click on "Setting Up ARHeadsetKit".
  5. A tutorial will pop up. Download the project files, which contain sample code. After practicing how to update documentation (shown below), proceed with the tutorial.

When first opening sample code from a tutorial, there may be an error with loading Swift packages. If that happens, close out of the project and open it a second time.

Updating Documentation

Periodically, do the following to make sure ARHeadsetKit and its tutorials are up to date:

  1. In the bottom left of the Xcode window, right-click "ARHeadsetKit" under "Package Dependencies".
  2. Click "Update Package". In the top of the Xcode window, you will see tasks related to package loading in progress.
  3. Once the package has finished updating, press Ctrl + Cmd + Shift + D.
  4. If you are working on a project that uses ARHeadsetKit, go to that one and repeat steps 1–2.

Going Further

To view documentation for a specific symbol while working on source code:

  1. Right-click on any ARHeadsetKit type or function in your Swift source code.
  2. Click "Quick Help".
  3. In the popup, click "Open in Developer Documentation".

Xcode's documentation viewer only supports Swift code, not ARHeadsetKit's Metal utility functions. Metal code will only show documentation in the "Quick Help" panel.

Note: The "Open in Developer Documentation" link may not appear for Swift types and functions when another Xcode project was opened recently. If that happens, restart Xcode and open just the project you intend to work on. After that, you may open others.