Back to Plugins

Swift Package Exporter
Generate SwiftUI from your design tokens.
design tokensno codeiosexporterswiftuixcodehandoffdesign systemswiftpackagecode-generators
Plugin Preview
About this plugin
Generate SwiftUI from your design tokens and export as package. Once included in Xcode, developers will have access to design tokens directly through Xcode's editor and code complete.
To get started install the plugin and run it on this sample file.
Learn more: https://figmatoswift.com
👉 Supported Styles
Styles defined in your document will be automatically recognized by the plugin including:
- ✅ Text
- ✅ Solid Colors
- ✅ Linear Gradients
- ✅ Angular Gradients
- ✅ Drop Shadows
- ✅ Layer Blurs
- ✅ Grid styles
* Radial and diamond gradients are not currently supported.
* Inner shadow and background blur are not currently supported.
👉 Images
Requirements for adding images to Swift package:
- Only vector images are supported
- Images must be defined as components
- Images must be wrapped in a frame named Images.swift
👉 Adding the Package to Xcode
- Unzip the exported file and drag the entire DesignSystem folder into the Xcode project navigator right below the project name.
- Add the DesignSystem package to Frameworks, Libraries and Embedded Content inside your projects general settings.
- Import the DesignSystem module in any views that you want to use design tokens with
import DesignSystem
👉 Example Usage
.font(Font.DesignSystem.headline1)
.foregroundColor(Color.DesignSystem.primary)
.modifier(Effect.DesignSystem.Elevation1())
.padding(Spacing.DesignSystem.xSmall4)
Image.DesignSystem.welcome
👉 FAQs & Known Issues
- Style names that contain numbers can sometimes cause issues in Xcode. For ex "blue/1" and "blue/-1" will cause an error)
- Apple docs on adding custom fonts to Xcode
- The Mac App Store version of Xcode has a bug that prevents packages from working. Download Xcode directly from Apple's Developer site to resolve. Apple Developer Site
Feedback and Support
- For more information please visit: http://figmatoswift.com
- For feedback, questions or support please reach out on Twitter or Email
Plugin Details
Version | 3 |
---|---|
Created | November 12, 2021 |
Last Updated | June 5, 2023 |
Category | Software development |
Creator | Todd Hamilton |
Stats | 1210 installs, 83 likes |
Pricing | Free |
Technical Details
- API:1.0.0
- UI:dist/ui.html
- main:dist/code.js
- Editor Types:figma
More Like This
Discover other plugins in the Software development category.