mercadolibre/MPDynamicSkeleton

Name: MPDynamicSkeleton

Owner: MercadoLibre

Description: Modularized skeleton with gradient animation

Created: 2017-08-14 14:54:42.0

Updated: 2018-03-28 09:29:39.0

Pushed: 2017-12-06 20:35:14.0

Homepage: null

Size: 259

Language: Swift

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

MPDynamicSkeleton

CI Status Version License Platform

Description

A modularized skeleton with gradient animation - iOS (Swift/Objective-C)

Preview

Usage
1. Import MPDynamicSkeleton in your .Podfile
"MPDynamicSkeleton"

Then run pod install

2. Import MPDynamicSkeleton in your swift or Objective-C file:
t:
rt MPDynamicSkeleton

ctive-C:
ort MPDynamicSkeleton;
3. Code examples

Swift:

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

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)


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

Objective-C

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

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

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

MPDynamicSkeleton is available through CocoaPods. To install it, simply add the following line to your Podfile:

Author

MarceloJoseML, marcelo.jose@mercadolibre.com

License

MPDynamicSkeleton is available under the the Apache License, Version 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.