AAShimmerView 1.2.1

AAShimmerView 1.2.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2017
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by Ahmed Mohamed Magdi.



  • By
  • Ahmed Mohamed Magdi

AAShimmerView

Example

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

Requirements

  • Xcode 8.0+
  • Swift 3.0

Installation

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

pod "AAShimmerView"

Usage

First thing to do is to import AAShimmerView

import AAShimmerView

Then just do what ever you want

containerView.aaShimmerSubViews = [label1, label2, label3, label4, imageView]
containerView.startShimmering()

More Customizations

ShimmerView Height:

By default this value is set to the original view height

label1.aaShimmerHeight = label1.frame.height/2
label2.aaShimmerHeight = label2.frame.height/2
label3.aaShimmerHeight = label3.frame.height/2
label4.aaShimmerHeight = label4.frame.height/2

ShimmerView Vertical Alignment:

ShimmerViewAlignment is either ‘.top’, ‘.center’ or ‘.bottom’. This is by default is set to ‘.center’

label3.aashimmerVerticalAlignment = .top
label4.aashimmerVerticalAlignment = .bottom

ShimmerView Gradient Colors:

aashimmerColors is a list of colors that is applied on the rootView. Default value is [.lightGray , .white]

containerView.aashimmerColors = [UIColor.red, UIColor.green]

Contributing

Issues and pull requests are welcome!

Author

Ahmed Mohamed Magdi, [email protected]

License

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