# Sample Projects Source: https://www.nianticspatial.com/docs/nsdk/sample_projects/?platform=swift # Swift Sample Projects | | The NSDK Swift samples are designed to demonstrate the uses of each feature in our SDK. The sample project launches multiple small samples that you can try out and look though the code to learn how to get started with any feature. | | --- | --- | ## Installing the Samples The samples are available on our github https://github.com/nianticspatial/nsdk-samples-swift #### How to clone/download the samples: `git clone https://github.com/nianticspatial/nsdk-samples-swift` or Download the repo from https://github.com/nianticspatial/nsdk-samples-swift using the **code/download** button on **github**. To open the samples project from within xcode: 1. Open the **File** menu and select **Open...**. 2. Browse to the the root of the repository and look for the xcode project file : `ArdkSamples.xcodeproj`. Or run the open command on your terminal: `open *REPOSITORY_ROOT_LOCATION*/ArdkSamples/ArdkSamples.xcodeproj` > **Info:** > > **Authentication** > > The sample app uses authenticated sessions to access your organization's data from Niantic's backend services. For more information, see the [Auth guide](https://www.nianticspatial.com/docs/nsdk/auth_getting_started/). ## Samples ### VPS2 Sites | | **Attention**This sample requires [Auth Login](./auth_getting_started.md)).This sample shows a list of sites in the selected Organization and allows you to choose a VPS Asset from the Sites API as a localization target, then interfaces with your phone's map to guide you to it.To use this sample:Build to your device and open the app. Make sure to allow location and camera permissions.Choose an Organization where the site you're looking for is.Choose the site you'll want to localize to.Tap the Localize Anchor buttonPhysically visit the location and point the camera at the scaned location. A red arrow will appear pointing you in the general direction.Wait for the status to change to **Tracking**.A 3d mesh of the scan should appear on top of the real world location as well as a map showing your phone's position. | | --- | --- | ### Meshing | | This sample demonstrates how to use meshing to generate a physics mesh in your scene. It shows the mesh using a Normal shader, the colors represent Up, Right and Forward. | | --- | --- | ### Device Mapping | | This sample demonstrates how to create a VPS map locally. This is created and stored on the device and can be used to align and persist content. | | --- | --- | ### Depth | | This sample demonstrates how to get the depth buffer and display it as an overlay in the scene. | | --- | --- | ### Scene Segmentation | | This sample demonstrates scene segmentation by applying a shader that colors anything recognized on-screen as part of a semantic channel. To use this sample:Select a semantic channel from the drop down list.Look for the corresponding object(s) on your phone camera. | | --- | --- | ### Capture | | This scene allows you to capture a real-world location for playback. To use this sample:Press **Start capture** in the space you would like to create the dataset.Walk through the scene as normal.Press **Stop capture** when done.Press **Export** to obtain a file that can be used for playback. | | --- | --- | ### VPS2 | | The VPS2 sample demonstrates Site-based localization. Sign in, select a Site, and localize using its Site ID. After VPS2 reports a localized asset, use that asset's tracking data to place map-relative content.For implementation guidance, see [Get started with Sites](./how-to/sites/getting_started.md) and [Place virtual content with VPS2](./how-to/vps2/placing_virtual_content.mdx). | | --- | --- | ### Auth | | This sample demonstrates different methods of authentication and authorization when working with NSDK.There are two options:A developer login that provides full access to all features.Connection to a sample Enterprise backend where the user is anonymized. | | --- | --- |