A modularized skeleton with gradient animation - iOS (Swift/Objective-C)
pod "MPDynamicSkeleton"
Then run pod install
Swift:
import MPDynamicSkeleton
Objective-C:
@import MPDynamicSkeleton;
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 is available through CocoaPods. To install it, simply add the following line to your Podfile:
Make sure your are using cocoapods 1.6+ for xCode 10 and above
$ 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 is available under the the Apache License, Version 2.0