LottieViewMager 0.0.2

LottieViewMager 0.0.2

私人 维护。



  • MrLujh

LottieViewMager

支持 pod 导入

  • pod 'LottieViewMager'

  • 执行 pod search LottieViewMager 提示搜索不到,可以执行以下命令更新本地 search_index.json 文件

rm ~/Library/Caches/CocoaPods/search_index.json
  • 如果 pod search 仍然搜索不到,执行 pod setup 命令更新本地 spec 缓存(可能需要几分钟),然后再搜索就可以了

使用说明:

  • 导入头文件 #import "LottieViewManager.h"

  • 在基类 VC 中添加加载动画

示例代码:

- (void)showLoadingView
{
// loading大小是默认
    LottieViewManager *hud = [LottieViewManager showHUDAddedTo:self.navigationController.view animated:YES animationJson:@"vio"];
    
// 控制loading 的大小  vio是本地json格式的动画数据
//    LottieViewManager *hud = [LottieViewManager showHUDAddedTo:self.navigationController.view animated:YES frame:CGRectMake(0, 0, 0, 0) animationJson:@"vio"];
    self.hud = hud;
}

- (void)hideLoadingView
{
    [self.hud removeFromSuperview];
    self.hud = nil;
}
  • 在基类 VC.h 文件中暴露出来两个方法:显示和隐藏
// 显示加载动画
- (void)showLoadingView;
// 隐藏加载动画
- (void)hideLoadingView;

详细用法可以下载demo