Latest 1.0.4
Homepage https://github.com/alberdev/ContentLoader
License MIT
Platforms ios 10.0
Frameworks UIKit
Authors

ContentLoader logo

Version
License
Platform
Swift

Table of Contents

Description

Use ContentLoader to display awesome animated placeholder loading to your content. Use your custom views to generate low-contrast blocks, with the same shapes, positions. Make beautiful animations using your own format as Slack, Instagram, or Facebook does. ContentLoader is written in Swift 5 with iOS customizable and easy to use.

  • [x] Awesome animations on loading
  • [x] Totally customizable
  • [x] Use it also in your own tables and collection views
  • [x] Easy usage
  • [x] Supports iOS, developed in Swift 5

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

ContentLoader

Installation

ContentLoader is available through CocoaPods. To install
it, simply add the following line to your Podfile and run pod install:

pod 'ContentLoader'

Then you can import it when you need

import ContentLoader

Usage

In the example you will see some custom content loaders that can be used in your project. Once you’ve installed the pod, follow next steps. It’s really simple:

ContentLoader in your View

Select one of your custom view controllers. Choose the views inside this viewcontroller where would like to make Loadable and set isLoadable view property to true. Those views will convert to loadable objects when ContentLoader is loading. If you are using xibs / storyboards, you can see new editable Is Loadable property.

Screenshot 1

Using Table or Collection views?

If you are using Table or Collection views, you can make the same with your cells. Make Loadable the views you want. Then, you must implement ContentLoaderDataSource to complete some data ContentLoader needs to draw loader objects. It’s really simple:

extension TableViewController: ContentLoaderDataSource {

    /// Number of sections you would like to show in loader
    func numSections(in contentLoaderView: UIView) -> Int {
        return 1
    }

    /// Number of rows you would like to show in loader
    func contentLoaderView(_ contentLoaderView: UIView, numberOfItemsInSection section: Int) -> Int {
        return 10
    }

    /// Cell reuse identifier you would like to use (ContenLoader will search loadable objects here!)
    func contentLoaderView(_ contentLoaderView: UIView, cellIdentifierForItemAt indexPath: IndexPath) -> String {
        return "MyCellReuseIdentifier"
    }
}

Format

You can format ContentLoader with your own parameters. See default values:

var format = ContentLoaderFormat()

/// Loader objects color
format.color = UIColor.lightGray

/// Loader objects corner radius
format.radius = 5

/// Loader animation type
format.animation = .fade

Start and Stop Loading

Simple ;)

view.startLoading()
// or
view.startLoading(format: format)
view.hideLoading()

In case of table or collection views

tableView.startLoading()
// or
tableView.startLoading(format: format)
tableView.hideLoading()

Animation Types

Fade

This type will make fade animation when content is loading

ContentLoaderAnimation.fade

Gradient

This type will make gradient animation when content is loading (coming soon)

ContentLoaderAnimation.gradient(UIColor, UIColor)

(Start color, End color)

Author

Alberto Aznar, [email protected]
Based on Skeleton View by Juanpe Catalán.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

ContentLoader is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ContentLoader",
    "platforms": {
        "ios": "10.0"
    },
    "summary": "Create an animated placeholder loading to your content like Slack, Instagram, or even Facebook.",
    "description": "Use ContentLoader to display awesome animated placeholder loading to your content. Use your custom views to generate low-contrast blocks, with the same shapes, positions. Make beautiful animations using your own format as Slack, Instagram, or Facebook does.",
    "version": "1.0.4",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Alberto Aznar": "[email protected]"
    },
    "homepage": "https://github.com/alberdev/ContentLoader",
    "social_media_url": "https://twitter.com/alberdev",
    "source": {
        "git": "https://github.com/alberdev/ContentLoader.git",
        "tag": "1.0.4"
    },
    "frameworks": "UIKit",
    "source_files": "ContentLoader/**/*",
    "swift_versions": "5.0",
    "swift_version": "5.0"
}

Pin It on Pinterest

Share This