MPDynamicSkeleton 0.2.3

MPDynamicSkeleton 0.2.3

测试已测试
语言语言 SwiftSwift
许可 NOASSERTION
发布最后发布2019年7月
SPM支持 SPM

Matt CasanovaMobile Arquitectura 维护。



  • Marcelo José

MPDynamicSkeleton

CI Status Version License Platform

描述

一个模块化的骨架,带有渐变动画 - iOS (Swift/Objective-C)

预览

用法

1. 在 .Podfile 中导入 MPDynamicSkeleton

pod "MPDynamicSkeleton"

然后运行 pod install

2. 在您的 Swift 或 Objective-C 文件中导入 MPDynamicSkeleton

Swift:
import MPDynamicSkeleton

Objective-C:
@import MPDynamicSkeleton;

3. 代码示例

Swift

let headerView = UINib(nibName: "HeaderView", bundle: Bundle.main)
let rowView = UINib(nibName: "RowView", bundle: Bundle.main)
let exitView = UINib(nibName: "ExitView", bundle: Bundle.main)

let containers = [
    DynamicSkeletonModel(view: headerView, repeating: 1, left: 0, right: 0, top: 0, height: 82),
    DynamicSkeletonModel(view: rowView, repeating: 0, left: 0, right: 0, top: 82, bottom: 50, height: 74),
    DynamicSkeletonModel(view: exitView, repeating: 1, left: 0, right: 0, bottom: 0, height: 50)
]

DynamicSkeleton.sharedInstance.presentSkeleton(view: self.view, models: containers)

Objective-C

UINib *headerView = [UINib nibWithNibName:@"HeaderView" bundle:[[NSBundle mainBundle] bundleIdentifier]];
UINib *rowView = [UINib nibWithNibName:@"RowView" bundle:[[NSBundle mainBundle] bundleIdentifier]];
UINib *exitView = [UINib nibWithNibName:@"ExitView" bundle:[[NSBundle mainBundle] bundleIdentifier]];

DynamicSkeletonModel *header = [[DynamicSkeletonModel alloc] initWithView:headerView repeating:1 left:0 right:0 top:0 height:82];
DynamicSkeletonModel *rows = [[DynamicSkeletonModel alloc] initWithView:rowView repeating:0 left:0 right:0 top:82 bottom:50 height:74];
DynamicSkeletonModel *exit = [[DynamicSkeletonModel alloc] initWithView:exitView repeating:1 left:0 right:0 bottom:0 height:50];

[DynamicSkeleton.sharedInstance presentSkeletonWithView:self.view models:[[NSArray alloc] initWithObjects:header, rows, exit, nil]];

安装

MPDynamicSkeleton 可以通过 CocoaPods 获取。要安装它,只需在 Podfile 中添加以下行

协作

确保您使用的是 1.6+ 版本的 cocoapods,并与 xCode 10 及以上版本兼容

$ edit MPDynamicSkeleton.podspec
# set the new version
$ pod lib lint

$ git add . && git commit -m "Release 0.0.1"
$ git tag '0.0.1'
$ git push --tags

作者

MarceloJoseML,[email protected]

许可

MPDynamicSkeleton 可以根据 Apache License, Version 2.0 许可使用