Latest 0.1.2
Homepage https://github.com/ggamecrazy/LoadingImageView
License MIT
Platforms ios 8.0, requires ARC
Authors

Loading Indicator for UIImageView written in Swift.

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

demo

Cocoapod

pod 'LoadingImageView'

USAGE

As simple as

import LoadingImageView

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

API

var state: LoadingImageState 
weak var delegate: LoadingImageViewDelegate?
var inset: Float
var lineWidth: Float
var lineColor: UIColor    
var reloadImage: UIImage 

func downloadImage(URL: NSURL, placeholder:UIImage?)->NSURLSessionDownloadTask

Delegate and State

enum LoadingImageState {
  case Idle
  case Downloading(NSURLSessionDownloadTask)
  case Errored(NSURLSessionDownloadTask, NSError)
}

protocol LoadingImageViewDelegate : NSObjectProtocol {
  func loadingImageViewStateChanged(imageView: LoadingImageView, state: LoadingImageState)
  func shouldAttemptRetry(imageView: LoadingImageView)->Bool
  func imageForReloadState(imageView: LoadingImageView)->UIImage
}

Storyboard, Support for IBInspectable

Latest podspec

{
    "name": "LoadingImageView",
    "version": "0.1.2",
    "license": "MIT",
    "summary": "Loading Indicator for UIImageView, written in Swift",
    "homepage": "https://github.com/ggamecrazy/LoadingImageView",
    "social_media_url": "https://twitter.com/ggamecrazy",
    "authors": {
        "Cezar Cocu": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ggamecrazy/LoadingImageView.git",
        "tag": "0.1.2"
    },
    "requires_arc": true,
    "ios": {
        "frameworks": "UIKit"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Source/*.swift"
}

Pin It on Pinterest

Share This