Native 3D Embeds for iOS
With our Metal-based renderer, you can now embed native 3D content in your SwiftUI projects.
This native renderer enables you to bring all of the interactivity from your 3D designs made in Spline to Apple devices. It also takes full advantage of all the native performance in your Apple devices like the iPhone, iPad, or Mac.
Requirements
Follow the steps below to get set up to use the Spline iOS Runtime.
1. Sign up for an Apple ID or join the Apple Developer Program
To get started testing your app on your devices, youβll need a free Apple ID.
To publish your app on the App Store, you need to register with the Apple Developer Program.
For more information about the differences between an Apple ID and Apple Developer Program membership, refer to Appleβs documentation on Choosing a Membership.
Team IDs
In order for you to build your apps within Xcode, you might need a Team ID.
Learn how to find your Team ID on Appleβs documentation: Locate your Team ID.
2. Download and Install Xcode
The minimum Xcode version supported is 15.2
To use Spline native embeds, youβll need to integrate the Spline iOS Runtime into an Xcode project. This means you must install Xcode if you want to build an iOS application. Xcode is only available for macOS.
Download the latest version of Xcode from the Mac App Store.
Download the latest or beta versions of Xcode from the Apple Developer website.
Getting Started
Follow the steps below to get started using native 3D embeds on your Swift projects with Spline iOS Runtime.
Platform Support
Spline is using the latest technologies to render 3D content on Apple devices.
Device | Minimum Required OS | Minimum Required Chip |
---|---|---|
iPhone | iOS 16.0 and up | A13 and up |
iPad | iPadOS 16.0 and up | A13 and up |
Mac | macOS 13.0 and up (via Mac Catalyst or Designed for iPad) | Apple Silicon |
Vision Pro | VisionOS 1.0 | M2 |
Apple TV | Not supported | - |
Apple Watch | Not supported | - |
Language and Libraries Support
The Spline iOS Runtime uses SwiftUI and Swift.
1. Adding the Spline iOS Runtime package to Xcode
To add via Swift Package Manager, in Xcode, select File > Add Package Dependency.
In the package finder, select the search input and search using the full repository URL: https://github.com/splinetool/spline-ios
For more information, refer to Appleβs documentation on Adding package dependencies to your app
2. Importing the Spline iOS Runtime
To import the Spline iOS Runtime, make sure to always add the following code to the top of the file where Spline Runtime is used.
import SplineRuntime
3. Using the Spline iOS Runtime
3.1 Exporting from Spline
From the top toolbar, press the
Export
button to open the export panel;Under Apple Platforms, select the
Embed
option.
Make sure to come back to the export panel and press the Update
button to see all the updates made to the scene in your app.
To load your Spline scene locally, you can use the Download
button below the code snippet.
To disable the Spline logo, youβll need an active Professional or Team subscription.
Under the Loading option, you can choose the type of loader for your scene.
3.2 Integrating with your Xcode Project
From the Cloud
Copy the code snippet and paste it on your
ContentView
Swift file;
import SplineRuntime import SwiftUI struct ContentView: View { var body: some View { // // fetching from local // let url = Bundle.main.url(forResource: "scene", withExtension: "splineswift")! // fetching from cloud let url = URL(string: "https://build.spline.design/8DX7ysrAJ3oDSok9hNgs/scene.splineswift")! SplineView(sceneFileURL: url).ignoresSafeArea(.all) } }
If not using local files, you can either keep the
fetching from local
code commented or remove it completely.Use
.ignoresSafeArea(.all)
if you want to show your experience on full-screen without the title bars.When working with multiple cloud embeds, you can use the same code snippet and change the URL after the
string
.
Locally
Use the Download button below the code snippet to get a local copy of your Spline Scene as a
.splineswift
file;Import the
.splineswift
file into your Xcode projectβs root folder;Copy the code snippet and paste it on the
ContentView
;Comment out the
fetching from cloud
code and uncomment the fetching from local code.
import SplineRuntime import SwiftUI struct ContentView: View { var body: some View { // fetching from local let url = Bundle.main.url(forResource: "scene", withExtension: "splineswift")! // fetching from cloud // let url = URL(string: "https://build.spline.design/8DX7ysrAJ3oDSok9hNgs/scene.splineswift")! SplineView(sceneFileURL: url).ignoresSafeArea(.all) } }
When working with multiple local files, you can change the file name after
forResource
. If the file name isscene.splineswift
the code should look like:forResource: "scene"
4. Publishing and distributing your app
For more information on publishing to the App Store, refer to Appleβs documentation on Distributing your app for beta testing and releases.
Download Xcode Demo
See how it works by downloading an Xcode demo project using cloud iOS embeds.
Get Started with the following steps:
On Xcode, go to File > Open and select the unzipped folder with your project;
Select your build device β you can use your physical device (iPhone, iPad, Mac) or a simulator;
Press βΆοΈ to build your project.
Before Building
You might need to go into
Signing & Capabilities
, and underSigning
add your team manually.Optionally, make sure to change the
Bundle Identifier
to a unique one.
3D Scenes:
Avatar 1: https://app.spline.design/file/a2770bba-eb91-4dce-9cec-44857322d7ad
Avatar 2: https://app.spline.design/file/5f77c44e-411e-4420-93ac-438fe058c4ae
Avatar 3:https://app.spline.design/file/30f38922-2b3f-488e-bc78-14dd25fd2ba1
Possible Warnings
When building your app, even if the app builds properly, there are a few errors that might be displayed on the embed. Refer below to see the warnings and their explanation.
"Spline scene file is in an unknown format."
The exported file is too old, the runtime is too old, or the file might have become corrupted.
"Spline scene file URL could not be reached."
Itβs displayed when the runtime fails to download a .splineswift
file from the web. It can be because of an invalid URL, or just a non-functioning network connection.
Feature Support Roadmap
Full coverage of all Spline features for Metal Renderer is expected to be ready in April-May 2024. Here is a list of each feature's current status. This list will be updated weekly until everything is fully supported.
Feature | Status | Notes |
---|---|---|
Parametric Shapes | β | |
Non-Parametric Shapes | β β° | 3D Paths, Lathe, and Subdiv Meshes are baked (Temporarily) - Full support is coming soon |
Materials | β | Note 1: Some settings in the Outline layer are not supported (yet). Note 2: Some material layers are not supported in VisionOS Volumes. |
Physics | β | |
Game Controls | β | |
Gaussian Splatting | β | Note: Volumes in VisionOS donβt support Gaussian Splatting at the moment. |
Variables | β | |
Events & States | β | |
Animated Models | β | |
Multi Scenes | β | |
UI Scenes | π§ |
Generate an App
Another way to export your 3D content for Apple Platforms like iOS is by generating a pre-built Xcode project directly from Spline.
Learn more about