Skip to content

vmagnani/MPDynamicSkeleton

 
 

Repository files navigation

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

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:

Collaborating

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

Author

MarceloJoseML, [email protected]

License

MPDynamicSkeleton is available under the the Apache License, Version 2.0

About

Modularized skeleton with gradient animation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 71.5%
  • Ruby 28.5%