Skip to content

Repository files navigation

LoadingImageView

Loading Indicator for UIImageView written in Swift.

  • Simple to use
  • Handles network calls and background image decoding.
  • Background decoding of Images
  • Handles Error states and retrying download.
  • Handles offline caching. Coming soon.

demo

###Cocoapod

pod'LoadingImageView'

###USAGE

As simple as

import LoadingImageView
letimageView=LoadingImageView()
view.addSubview(imageView)letimageURL=NSURL(string:"https://catfishes.files.wordpress.com/2013/03/cat-breaded.jpg")
imageView.downloadImage(imageURL, placeholder:nil)

####API

varstate:LoadingImageState weak vardelegate:LoadingImageViewDelegate?varinset:FloatvarlineWidth:FloatvarlineColor:UIColorvarreloadImage:UIImagefunc downloadImage(URL:NSURL, placeholder:UIImage?)->NSURLSessionDownloadTask

####Delegate and State

enumLoadingImageState{case Idle
case Downloading(NSURLSessionDownloadTask)case Errored(NSURLSessionDownloadTask,NSError)}protocolLoadingImageViewDelegate:NSObjectProtocol{func loadingImageViewStateChanged(imageView:LoadingImageView, state:LoadingImageState)func shouldAttemptRetry(imageView:LoadingImageView)->Boolfunc imageForReloadState(imageView:LoadingImageView)->UIImage}

####Storyboard, Support for IBInspectable

About

Loading Indicator for UIImageView, written in Swift.

Resources

Stars

151 stars

Watchers

7 watching

Forks

Releases

Packages

Contributors

Languages