Lightweight toolkit for developing native Godot iOS/Apple plugins using pure Swift.
godot-swift-plugin is the iOS counterpart to Android's GodotPlugin architecture. It enables developers to write native Apple plugins (StoreKit, Game Center, Apple Sign-In, etc.) in pure Swift with zero engine bloat and fast compile times.
Generates the complete hybrid project (Swift package + Godot addon + stubs + sample scene):
curl -fsSL https://raw.githubusercontent.com/poingstudios/godot-swift-plugin/master/scripts/create_plugin.sh | bash(Or from a local clone: ./scripts/create_plugin.sh)
Initialize directly using Swift Package Manager CLI:
# 1. Create bare Swift library:
mkdir MyPlugin && cd MyPlugin
swift package init --name MyPlugin --type library
# 2. Automatically attach GodotSwiftPlugin & the godot-build command:
swift package add-dependency https://github.com/poingstudios/godot-swift-plugin --branch master
swift package add-target-dependency GodotSwiftPlugin MyPlugin --package godot-swift-pluginSubclass GodotPlugin. Methods marked @objc are automatically registered in Godot, and @Signal exposes signals:
import Foundation
import GodotSwiftPlugin
public final class MyPlugin: GodotPlugin {
public override class var pluginName: String { "MyPlugin" }
@Signal
public var scoreUpdated
@objc public func greet(name: String) -> String {
return "Hello, \(name)!"
}
@objc public func addScore(points: Int) -> Int {
scoreUpdated.emit(points)
return points
}
}Access your plugin via Engine.get_singleton():
func _ready() -> void:
if Engine.has_singleton("MyPlugin"):
var plugin := Engine.get_singleton("MyPlugin")
plugin.score_updated.connect(func(score): print("Score:", score))
print(plugin.greet("Godot"))
plugin.add_score(100)./scripts/build_local.sh allOr directly using Swift Package Manager's native command plugin:
swift package --disable-sandbox --allow-writing-to-package-directory godot-build allTarget options: all (macOS dylib + iOS XCFramework), macos, or ios.
All generated plugins include lightweight precompiled GDExtension stubs in addons/<plugin>/bin/stubs/ (macOS, Windows, Linux, Android, and iOS), silencing Godot's No GDExtension library found notice when running the editor on any desktop OS.
To recompile stubs locally:
./scripts/generate_stubs.shComprehensive guides are available in the documentation:
- Getting Started
- Architecture & Lifecycle
- Methods & Type Marshalling
- Signals & Events
- Android Parity Guide
MIT License. Copyright (c) 2026-present Poing Studios.