Latest 0.2.1
Homepage https://github.com/mercadolibre/MPDynamicSkeleton
License Apache License, Version 2.0
Platforms ios 9.0, requires ARC
Authors

CI Status
Version
License
Platform

Description

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

Preview

MPDynamicSkeleton

Usage

1. Import MPDynamicSkeleton in your .Podfile

pod "MPDynamicSkeleton"

Then run pod install

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

Swift:
import MPDynamicSkeleton

Objective-C:
@import MPDynamicSkeleton;

3. Code examples

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]];

Installation

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

Author

MarceloJoseML, [email protected]

License

MPDynamicSkeleton is available under the the Apache License, Version 2.0

Latest podspec

{
    "name": "MPDynamicSkeleton",
    "version": "0.2.1",
    "summary": "Mercado Pago skeleton",
    "homepage": "https://github.com/mercadolibre/MPDynamicSkeleton",
    "authors": {
        "Marcelo Josu00e9": "[email protected]"
    },
    "description": "A modularized skeleton with gradient animation",
    "source": {
        "git": "https://github.com/mercadolibre/MPDynamicSkeleton.git",
        "tag": "0.2.1"
    },
    "license": "Apache License, Version 2.0",
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "swift_version": "4"
}

Pin It on Pinterest

Share This