Giter Site home page Giter Site logo

mpdynamicskeleton's Introduction

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:

Author

MarceloJoseML, [email protected]

License

MPDynamicSkeleton is available under the the Apache License, Version 2.0

mpdynamicskeleton's People

Contributors

matynz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.