Skip to content

DelphiWorlds/SwiftBridges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift Bridges

Delphi-accessible bridges to modern Swift-only Apple frameworks

Overview

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.

Current Bridges

Framework iOS SDK Demo
DeclaredAgeRangeObjC iOS 26.0
ShazamKitObjC iOS 17.0

Please see this issue regarding bridges that are in progress, or planned.

Getting Started

Prerequisites

  • 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).

Building a Bridge Framework (Xcode)

Most framework binaries/headers will be available in the Frameworks folder, however if you wish to build them yourself:

  1. Open the desired framework project (e.g., /Bridges/ShazamKitObjC/ShazamKitObjC.xcodeproj).
  2. Build for device (arm64)
  3. The resulting .framework bundle is ready for use under the folder ~/Library/Developer/Xcode/DerivedData/(FrameworkProjectName)-xxxxxxx where (FrameworkProjectName) is the name of the bridging project (e.g ShazamKitObjC) and xxxxxxxx is a unique identifier created by Xcode. Under that folder will be /Build/Products/Debug-iphoneos where the .framework folder is located
  4. Copy the .framework folder mentioned in step 3 to a suitable location on your Windows machine for the Delphi compiler to find it using the Framework search path value in the Project Options of your Delphi project.

Creating a Delphi import

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.

Using in a Delphi Project

See the demo projects in the Demos folder for examples, including project configuration requirements.

Contributing

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

Building Bridges

If you wish to contribute, or are just interested in the process, see "Building Bridges" in the documentation

Acknowledgements

  • 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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Bridging frameworks for Swift-only frameworks, Delphi imports and demos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors