:cat: This is a cute and simple loading HUD on iOS :-P
This is a cute and simple loading HUD 😛 Enjoy!
这是一个可爱清新简单的加载HUD控件 😛
你可以在这里看到详细的实现原理。
To run the example project, clone the repo, and run pod install
from the Example directory first.
想要运行示例工程,将这个仓库clone到本地,在Example
目录下运行pod install
。
Simply use as below :
用法很简单:
if(![SCCatWaitingHUD sharedInstance].isAnimating)
{
[[SCCatWaitingHUD sharedInstance] animate];
}
else
{
[[SCCatWaitingHUD sharedInstance] stop];
}
Here I provided you several complex ways to call the animate
method.
有些加载交互是需要block用户当前操作的,因此在这里我提供了两种更复杂一些的方式来调用animate
方法。
/**
* 动画的时候是否允许和原始的View进行交互
* Whether you can interact with the original view while animating
*
* @param enabled YES代表能响应原生View事件,NO代表block当前所有的手势操作
*/
- (void)animateWithInteractionEnabled:(BOOL)enabled;
/**
* You can attach your HUD title to the view using this animation method.
*
* @param enabled YES代表能响应原生View事件,NO代表block当前所有的手势操作
* @param title HUD title
*/
- (void)animateWithInteractionEnabled:(BOOL)enabled title:(NSString *)title;
Moreover, I provided a new method to call animate
in version 0.1.6 that can give you ablity to customize the duration for each loop.
另外我在0.1.6版本提供了一个更新的调用 animate
方法的接口,可以让你自定义每转一圈的时长,从而修改旋转的速度,默认值是4秒一圈,在这个速度上看老鼠跑的不会异常的快,当然提供给你这个方法是让你可以让它跑得更快。
/**
* You can also customize duration for each loop (also can be represented as speed) using this animation method. Default duration is 4.0 seconds each loop.
*
* @param enabled YES代表能响应原生View事件,NO代表block当前所有的手势操作
* @param title HUD title
* @param duration time for each loop
*/
- (void)animateWithInteractionEnabled:(BOOL)enabled title:(NSString *)title duration:(CGFloat)duration;
–
iOS 8.0 Above
SCCatWaitingHUD is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'SCCatWaitingHUD', '~> 0.1.6'
SCCatWaitingHUD is available under the MIT license. See the LICENSE file for more info.