Flare is a powerful design and animation tool for app and game designers alike. The primary goal of Flare is to allow designers to work directly with assets that run in their final product, eliminating the need to redo that work in code.
Swift runtime for Flare: export files from Flare and run them on iOS!
Only Binary format is supported right now, but JSON support is in the works.
If you encounter any problems report them in the issue tracker and, if applicable, include your Flare file.
The repository contains an XCode Project structured as follows:
- FlareSwift - Swift Framework for loading and drawing Flare files
This project contains multiple targets:
FlareSwift- builds the Framework that runs on physical devices.FlareSwiftDev- builds the Framework that runs on Simulators.- Example - A simple example demonstrating how to add a FlareSkViewController in a Single View App ViewController. It draws inside the FlareSkView associated with the
FlareSkViewController. - ExampleController - Demonstrates how to create a CustomController that is an extension of FlareSkViewController. This class takes advantage of the available APIs by overriding
advanceControls(), using a custom callback for swapping animations on completed (i.e.onCompleted()), and adding aplay()function that plays a new animation allowing the user to specify the interpolation mix and time.
- Clone the repository:
git clone git@github.com:2d-inc/Flare-Swift.git
- Open
FlareSwift.xcodeproj - In the XCode window, select the scheme for the device you want to run on:
- Use
FlareSwiftto build the Framework for a physical device - Use
FlareSwiftDevto build the Framework for a Simulator
- Use
N.B: first time building the Framework takes a while, as it is initializing and building all the dependencies. Use the Report Navigator to have an overview of what's happening.
- Build the Framework (⌘ + B)
The Framework can be found in the Products folder.
Access the Products folder from XCode by right clicking on it > Show in Finder.
- Drag-and-drop the
.frameworkfile into the XCode window.- In the import dialog, select "Copy items if needed" and the target in "Add to Targets"
- Add the Framework to the Build Phases:
- Select the Project in the Project Navigator
- Select your Target
- Build Phases
- Add the Framework to the Embed Frameworks phase.
The examples are configured to be run on a Simulator.
If you want to run them on a physical device, follow these steps:
- Select the example project in the Project Navigator
- Select the project target from the target list
- Under the
Framework, Libraries and Embedded Contentmenu:- Select
FlareSwiftDev.frameworkand press the minus (-) button to remove it - Use the plus (
+) button to addFlareSwift.framework
- Select
- Run the example N.B. if the Framework needs to run a clean build for the device, this process might take a while. Use the Report Navigator to look at what's happening.
See the LICENSE file for license rights and limitations (MIT).
The Bezier folder is a port of bezier.dart, and is complying with their LICENSE.txt (BSD 2-Clause License).
