CocoaPods trunk is moving to be read-only. Read more on the blog, there are 12 months to go.
| TestsTested | ✗ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Jul 2016 |
Maintained by Charles Thierry.
To run the example project, clone the repo, and run pod install from the Example directory first.
DRAuraButton is available through a non official CocoaPods repository. To install it, simply add the following lines to your Podfile:
source 'https://github.com/DeRunco/cocoapods/'
pod "DRAuraButton"DRAuraButton is a UIButton with a subview that displays a rotating circle. Multiple configuration of stroke width, radius, color and speed can be specified. Going from one configuration to another is animated.
This project was done mainly as a first approch to Core Animation framework -- it uses CABasicAnimations to animates transition between states.
Any storyboard button can be set to be a DRAuraButton.
The button presents arbitrary states, defined by the developer.
A state is defined by a set of properties, stored in a DRAuraConfiguration object. Among those properties are the ID. It serves as state identifier (see DRAuraButton.currentStateID). All states must have a unique ID.
To create and add a new state, use DRAuraButton addAuraConfiguration: method:
[myButton addAuraConfiguration:^(DRAuraConfiguration *c) {
c.ID = @"my State name";
c.width = 2.;
c.space = 7.;
c.offset = 6.;
c.step = 0.04;
c.animationDuration = 0.3;
c.auraColor = [UIColor blackColor];
c.buttonColor = [UIColor grayColor];
}];To switch to that state, call setCurrentStateID: :
[myButton setCurrentStateID:@"my State name"];To remove a state from the object, call removeAuraConfiguration: :
[myButton removeAuraConfiguration:@"my State name"];DRAuraConfiguration.step. Greater is faster. Rotation is animated by NSTimer each 0.016s. As per NSTimer however, this time interval is not guaranteed.DRAuraConfiguration.space. Greater is biggerDRAuraConfiguration.offset. This value is half the actual arc length between each arc.DRAuraConfiguration.width. Greater is wider.DRAuraConfiguration.auraColor.DRAuraConfiguration.buttonColor.DRAuraButton is available under the MIT license. See the LICENSE file for more info.