Latest 1.0.2
License MIT
Platforms ios 9.0
Dependencies AlamofireImage
Frameworks UIKit

CI Status

BmoImageLoader is a progress animated component for UIImageView

Image downloader implementation and cache manager use AlamofireImage


  • [x] UIImageView Extension for image downloading with progress animation
  • [x] UIImageView Downloads with placeholder image
  • [x] Shape UIImageView
  • [x] Include 7 style progress animation
  • [x] UIImageView progress animator support custom control, used in any case
  • [x] AlamofireImage default In-Memory Image Cache
  • [x] AlamofireImage default Prioritized Queue Order Image Downloading


iOS 8.0+
Xcode 8.0+
Swift 3.0+


Alamofire 4.0+
AlamofireImage 3.1


Shape ImageView

Support RoundedRect, Circle, Ellipse, Triangle, Pentagon, Heart, Star totally 7 shape paths

BmoImageViewFactory.shape(UIImageView, shape: BmoImageViewShape)

Create Progress Animator

The factory will return a BmoProgressAnimator Protocol

let animator = BmoImageViewFactory
    .progressAnimation(UIImageView, newImage: nil, style: BmoImageViewProgressStyle)

BmoProgressAnimator default progress TotalUnitCount is 100, if need changed

animator.setTotalUnitCount(count: Int64)

When progress forward

animator.setCompletedUnitCount(count: Int64)

More, you can custom animation detail style

        .setMarginPercent(percent: CGFloat)
        .setAnimationDuration(duration: NSTimeInterval)

UIImageView Extension

If you want to use more flexible, can use AlamofireImage’s ImageCache and ImageDownloader, custom ImageDownloader.ProgressHandler, catch totalBytesRead and totalExpectedBytesToRead and use BmoImageViewFactory.progressAnimation to display progress animtion

Setting Image with URL

Setting the image with a URL will asynchronously download the image and set it once the request is finished.


Run image progress animation if catched

Whether to run the image progress animation if the image is cached. Defaults is false



Use CirclePie progress style to load a new image without handle downloading progress, just image transition

let placeholderImage = UIImage(named: "placeholder")
let animator = BmoImageViewFactory
    .progressAnimation(UIImageView, newImage: placeholderImage, style: BmoImageViewProgressStyle.CirclePie(borderShape: true))
    .setCompletionBlock({ (result) in
                        if result.isSuccess {
                            //do something when succeed
                        if result.isFailure {
                            //do something when failed
if let newImage = UIImage(named: "newImage") {

Use CircleBrush progress style to upload a new image

use Alamofire Uploading with Progress

Alamofire.upload(.POST, "", file: fileURL)
         .progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in

             // This closure is NOT called on the main queue for performance
             // reasons. To update your ui, dispatch to the main queue.
             dispatch_async(dispatch_get_main_queue()) {
                 print("Total bytes written on main queue: (totalBytesWritten)")
         .responseJSON { response in

And then pass totalBytesWrittenand totalBytesExpectedToWrite to BmoProgressAnimator

let newImage = UIImage(named: "newImage")
let animator = BmoImageViewFactory
    .progressAnimation(UIImageView, newImage: newImage, style: BmoImageViewProgressStyle.CircleBrush(borderShape: true))
    .setCompletionBlock({ (result) in
                        if result.isSuccess {
                            //do something when succeed
                        if result.isFailure {
                            //do something when failed

When uploading


When uploading completed, succeed or failed


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


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

pod "BmoImageLoader"


LEE ZHE YU, [email protected]


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

Latest podspec

    "name": "BmoImageLoader",
    "version": "1.0.2",
    "summary": "A progress animated component for UIImageView",
    "description": "BmoImageLoader is a progress animated component for UIImageViewnImage downloader implementation and cache manager use AlamofireImage",
    "homepage": "",
    "screenshots": [
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "LEE ZHE YU": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.2"
    "platforms": {
        "ios": "9.0"
    "source_files": "BmoImageLoader/Classes/**/*",
    "frameworks": "UIKit",
    "dependencies": {
        "AlamofireImage": [
            "~> 3.1"
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This