Version: Unity 6.6 Alpha (6000.6)
Language : English
Swift Xcode project type for iOS and tvOS
Migrate to a Swift Xcode project type

Introduction to the Swift Xcode project type for iOS and tvOS

Starting with version 6.5, Unity supports generating Swift Xcode projects for iOS and tvOS using a SwiftUI-based template. This project type modernizes Unity’s Apple platform integration while preserving Unity’s runtime, IL2CPPA Unity-developed scripting back-end which you can use as an alternative to Mono when building projects for some platforms. More info
See in Glossary
pipeline, and native plug-inA set of code created outside of Unity that creates functionality in Unity. There are two kinds of plug-ins you can use in Unity: Managed plug-ins (managed .NET assemblies created with tools like Visual Studio) and Native plug-ins (platform-specific native code libraries). More info
See in Glossary
ecosystem.

For more information, refer to Swift (Apple Developer).

Features of a Swift project type

A Swift project in Unity is an Xcode project with the following features:

  • The application entry point and app lifecycle are implemented in Swift through a SwiftUI-based template.
  • The Unity Player, UnityFramework.framework, is linked into the main Swift binary.
  • The main app initialization starts from MainApp/MainApp.swift.
  • You can write native plug-insA platform-specific native code library that is created outside of Unity for use in Unity. Allows you can access features like OS calls and third-party code libraries that would otherwise not be available to Unity. More info
    See in Glossary
    in Swift, Objective-C, Objective-C++, C, or C++.
  • Provides a public API for native plug-in developers.

The features of the Unity Player work the same as they do in the Objective-C project type, with some known exceptions. Project types are interchangeable, so you can choose the one that suits your needs.

Benefits of using a Swift project type

Using a Swift project provides the following advantages from both Apple’s ecosystem and Unity’s integration perspectives.

Apple’s ecosystem benefits

Swift is Apple’s primary modern language, offering:

  • Better memory safety and fewer runtime crashes.
  • Improved performance and compile-time checks.
  • SwiftUI support.
  • Integration with modern Apple SDKs.

Unity development benefits

While the Unity runtime is primarily C++ (UnityRuntime.framework), the platform adoption layer is written in Swift. This enables:

  • A modernized iOS or tvOS Xcode project template.
  • A cleaner, Swift-first approach and Swift-native plug-in workflows.
  • Improved alignment with Apple platform standards.
  • A future-proof development architecture.
  • A dedicated Unity public API for plug-ins.

Consider the following use cases of migrating to a Swift project type in Unity:

  • Use a Swift project type for new iOS and tvOS Unity projects.
  • You have existing projects that integrate Swift-based SDKs.
  • Teams that are standardizing on Swift for Apple development.

Migrate an Objective-C project to Swift

To migrate an existing project from Objective-C to Swift, refer to Migrate to a Swift Xcode project type.

Guidance for native plug-in developers

When you develop native plug-ins for Unity on Apple platforms, your plug-in might need to work across a wide compatibility matrix. Design your plug-ins for this matrix, not for a single target. For more information, refer to Introduction to native plug-ins on iOS.

Additional resources

Swift Xcode project type for iOS and tvOS
Migrate to a Swift Xcode project type