Delphi-accessible bridges to modern Swift-only Apple frameworks
Swift Bridges is a collection of bridging frameworks and Delphi import units that allow Delphi developers to use modern Apple frameworks that are written exclusively in Swift and therefore not directly accessible from Objective-C (and thus not from Delphi).
Apple has been moving many new APIs to Swift-only frameworks (e.g., SwiftUI, WidgetKit, TipKit, ShazamKit's newer classes). Since Delphi's iOS support is based on Objective-C interoperability, these APIs are normally unavailable to Delphi developers.
This repository provides:
- Xcode projects that create small Objective-C wrapper frameworks around selected Swift-only APIs.
- Ready-to-use Delphi import units generated from those wrappers.
- Demo projects showing real-world usage in Delphi apps.
The goal is to make the latest Apple platform features accessible to the Delphi community without requiring a full Swift rewrite.
| Framework | iOS SDK | Demo |
|---|---|---|
| DeclaredAgeRangeObjC | iOS 26.0 | ✅ |
| ShazamKitObjC | iOS 17.0 | ✅ |
Please see this issue regarding bridges that are in progress, or planned.
- macOS with Xcode (latest recommended).
- Embarcadero Delphi (12.x or newer is recommended)
- An Apple Developer account (required for some features like ShazamKit catalog access).
Most framework binaries/headers will be available in the Frameworks folder, however if you wish to build them yourself:
- Open the desired framework project (e.g.,
/Bridges/ShazamKitObjC/ShazamKitObjC.xcodeproj). - Build for device (arm64)
- The resulting
.frameworkbundle is ready for use under the folder~/Library/Developer/Xcode/DerivedData/(FrameworkProjectName)-xxxxxxxwhere(FrameworkProjectName)is the name of the bridging project (e.g ShazamKitObjC) andxxxxxxxxis a unique identifier created by Xcode. Under that folder will be/Build/Products/Debug-iphoneoswhere the.frameworkfolder is located - Copy the
.frameworkfolder mentioned in step 3 to a suitable location on your Windows machine for the Delphi compiler to find it using theFramework search pathvalue in the Project Options of your Delphi project.
If there is no existing Delphi import for a bridged framework, please see these instructions in the Octoid repo, paying particular attention to importing a third party framework.
See the demo projects in the Demos folder for examples, including project configuration requirements.
Contributions are very welcome! Ideas for new bridges, bug fixes, improved wrappers, or additional demos are all appreciated.
Please open an issue first to discuss any major additions, and see the contributions readme for conventions used in bridging projects in this repo, and other information
If you wish to contribute, or are just interested in the process, see "Building Bridges" in the documentation
- Huge THANK YOU to Chris Pimlott, whose WidgetKit tutorial inspired this work.
- Thanks to Grok, who worked tirelessly to help generate the Swift/Objective-C files and gave valuable hints for configuring Xcode projects.
This project is licensed under the MIT License - see the LICENSE file for details.