Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.
The app was made in Interface Builder with IBAnimatable
without a single line of code. Due to the size of the GIF file on Dribbble, it only demonstrates a subset of features. We can also find the full HD version on YouTube or MP4 on Github
Here is the full design in a Storyboard in Interface Builder.
With IBAnimatable
, we can design a UI in Interface Builder like what we can do in Sketch, and prototype animations in a Swift playground like what we can do in Framer. Also, we can use the output of the design directly in the production ready App.
As a designer, we love Sketch, which is a simple but yet super powerful tool to create UI. However, Sketch can't design interaction, navigation, transition and animation, and we may need another tool like Framer to design some of them. Moreover, to make an App Store ready App, we need to use Xcode and Interface Builder to implement the UI and animations. To speed up the process and minimize the waste, we create IBAnimatable
to make Interface Builder designable and animatable.
Please check out swift3 branch, we are working on cool stuff.
- From prototype to shippable App Store ready App - What you design in Interface Builder is what the App exactly looks.
- Designer-friendly - Sketch style configuration panel on Attributes inspector () to lower the learning curve for using Interface Builder.
- Animation design support in Swift playground - Similar to Framer, we can prototype animations in Swift playground to save time for running on a simulator or actual iOS devices.
- Built-in Auto Layout support - We can use Auto Layout and Size Classes with
IBAnimatable
to support orientations and multiple iOS devices. - Navigation and transition support - We can use default navigation pattern in the App.
IBAnimatable
also has custom transition animators and segues to support transition animations and gesture interactions. - Protocol-oriented programming -
IBAnimatable
uses a protocol-oriented programming paradigm. With Swift protocol extension, it is easy to support more designable or animatable features. We can even use these protocol extensions to create other custom UI elements instead of using the default ones fromIBAnimatable
.
- Prototyping - Create interactive prototypes to validate ideas quickly.
- Redesigning in Interface Builder - Redesign the UI from Sketch and animations from Framer without writing any code.
- Making custom UI elements - Use
IBAnimatable
protocols to make custom UI elements. e.g. Buttons with a default color palette.
FullyMostly documented API Reference- How to design and prototype custom transition animation and gesture interaction in Interface Builder with IBAnimatable
The easy way to learn and understand how powerful of IBAnimatable
is to run the example App and play around the settings in Interface Builder. Just a few steps we can run the App as below, to see more features, we can tap on "Forget Password" button to unlock them. π
- Clone the repository
$ git clone https://github.com/IBAnimatable/IBAnimatable.git
- Open the workspace in Xcode
$ cd IBAnimatable
$ open IBAnimatableApp.xcodeproj
- Compile and run the app on your simulator or iOS device
To use IBAnimatable
to design the UI and animations in Interface Builder, just follow a few steps as below:
- Open a Storyboard or Xib file.
- Drag and drop a UIKit element e.g.
UIView
to aUIViewController
. - In Identity inspector (), configure the UI element to
Animatable
custom UI class e.g.AnimatableView
, you can find allAnimatable
classes in APIs.md. - Configure the UI and animations in Attribute Inspector.
We can configure the animation settings in Attribute inspector. However, Interface Builder doesn't support previewing Animations, but we can still prototype animations in Swift playground. There are three sample pages to demonstrate how to design animation in Swift playground. You can find them in IBAnimatable.playground.
- Open IBAnimatableApp.xcodeproj
- Select IBAnimatable Framework scheme and build it with
Command + b
- Select IBAnimatable.playground, choose one page in Swift playground, then click on "Assistant editor" button to split the playground. After that, select "Timeline" on the top of right-hand side to preview the animation. We can use Xcode menu "Editor" -> "Execute" to re-run the playground.
As you saw above, we can prototype an App fully in Interface Builder without a single line of code, but IBAnimatable
also provides APIs to let us fully control the UI and animations. IBAnimatable
provides simple APIs like pop()
. We can easily call them in one line.
view.pop() // pop animation for the view
view.squeezeFadeInLeft() // squeeze and fade in from left animation
You can play around with all these predefined animations in the Swift playground Page - Predefined Animations
There are some properties we can change to customize the animation. What we need to do is to set the properties and call animate()
method to start the animation.
// Setup the animation
view.animationType = "SqueezeInLeft"
view.delay = 0.5
view.damping = 0.5
view.velocity = 2
view.force = 1
// Start the animation
view.animate()
You can play around with all animations with different properties in the Swift playground Page - Animation Properties
Sometimes, we need to run another animation after the previous one. With IBAnimatable
, we can easily chain animations together to provide a sleek user experience.
// Simply put the next animation within `{}` closure as below. It is an example to pop the view after the squeeze in from the top effect.
view.squeezeInDown{ view.pop() }
// Heaps of animations have been chained together, it is the source code of animated GIF in "Animate in Swift playground" section
view.squeezeInDown{ view.pop { view.shake{ view.squeeze{ view.wobble{ view.flipX { view.flash{ view.flipY { view.fadeOutDown() } } } } } } } }
Copy and paste IBAnimatable
folder in your Xcode project.
Add .Package(url: "https://github.com/IBanimatable/IBanimatable.git", majorVersion: 2)
to your Package.swift
Add pod 'IBAnimatable'
to your Podfile.
Add github "IBanimatable/IBAnimatable" ~> 2
to your Cartfile.
Please Notice, there is a limitation of a built framework for @IBDesignable
and @IBInspectable
, that will impact on IBAnimatable
when you use Carthage.
Add this repo as a submodule, and add the project file to your workspace. You can then link against IBAnimatable.framework
for your application target.
All of us can contribute to this project. Fewer overheads mean less time to build quality Apps and more time to enjoy coffee βοΈ.
-
If you are a designer, you can design in Interface Builder with
IBAnimatable
without a design tool like Sketch, or implement your existing design from Sketch or Photoshop in Interface Builder rapidly. WithIBAnimatable
, you should be able to doallmost of the design work in Interface Builder. If you have any feature request, please create a GitHub Issue and we will put it in the backlog. If you have done any design withIBAnimatable
, please let us know via creating Pull Request or GitHub Issue. We will add it to README file. -
If you are a developer, you can work on features or fix bugs, please check out Vision, Technical Considerations and Roadmap and GitHub Issues to find out the backlogs. If you have used
IBAnimatable
in your App, please let us know via creating Pull Request or GitHub Issue. We will add it to README file. -
If you are good at English, please correct my English π. If you are good at other languages, please create a README file in those languages.
-
If you like the project, please share it with the other designers and developers, and star π the project. π€
Many thanks to all contributors π€ especially to @tbaranes who develops a lot of features and maintains the project.
Vision, Technical Considerations and Roadmap
IBDesignable
andIBInspectable
- The entire project is based on that.- Sketch - Interface Builder should be as easy as Sketch to use.
- Framer Studio - Design and preview animations in one place.
- Spring by Meng To - steal a lot of animation parameters from this project.
- VCTransitionsLibrary by Colin Eberhardt - port all transition animations from this project, and add parameters support and fix bugs.
- Invision ToDo App UI Kit, The demo App's original design is from this UI Kit and redone in Interface Builder. We also added interaction, navigation and animations.
Please see CHANGELOG.md
IBAnimatable
is released under the MIT license. See LICENSE for details.