A framework to simplify complex views and allow for simple animation of views.
- Usage
- SimpleTableView - What is this?, How do I use it
- SimpleAnimation - What is this?, How do I use it
- iOS 9.0+
This a subclass of UITableView which makes it SIMPLE to do things like.
- Have a loading view before the table is displayed, useful while you're waiting for a network call to return.
- Have a failed view if your network call failed.
- Have a empty view that is shown when the table has no data yet.
- Have transitions between loading, empty, finished, and failed states.
Look at example inside the project for now.
Makes animating views onto the screen and off the screen. Only tested using storyboards so far
There are few simple animations currently, these animations have two states in and out.
- fade - Which simply fades a view onto or off the screen.
- leftToRight
- In - Will animate the view from off screen left to its position specified in storyboard using constraints.
- Out - Will animate the view from its original position to off screen right.
- rightToLeft - is LeftToRight but in the opposite direction.
- slideUp
- In - Will animate the view from off screen bottom to its position specified in storyboard using constraints.
- Out - Will animate the view from its original position to off screen top.
- slideDown
You can perform a SimpleAnimation on any UIView or subclass of UIView aka (UIButton, UITableView, etc..)
Take a look at the example project the IBOutlet errorStackView are animated using SimpleAnimation.
Example Code
class ExampleViewController: UIViewController {
@IBOutlet weak var contentView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
// You need to initialize anything that has an in animation, in this case contentView.
SimpleAnimation.initialize(views: [contentView])
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
contentView.perform(animation: .fade, forDuration: 0.7, withState: .in)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
contentView.perform(animation: .fade, forDuration: 0.7, withState: .out)
}
}