Giter Site home page Giter Site logo

webimageview's Introduction

Web Image View

Features

  • Fix reused bug with UITableViewCell or UICollectionViewCell
  • Loading web image with view animation
  • Smooth loading web image

Useage:

  1. Drag the UIImageView to your storyboard and set it to WebImageView.swift

  1. Load Image form URL๏ผš
yourImageView.load(fromURLString: webUrlString, enableAnimation: true, defaultImage: UIImage(named: "defaultImage")!)
  1. You can set animation transition style with animationOptions:
yourImageView.load(fromURLString: webUrlString, enableAnimation: true, defaultImage: UIImage(named: "defaultImage")!, animationOptions: .transitionCrossDissolve)

Check out animationOptions with UIViewAnimationOptions documents.

  1. Or just set enableAnimation: false to load without animations.

  2. Cancel download tasks for table view didEndDisplaying :

func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {
    guard let imageCell = cell as? ImageTableViewCell else {return}
    imageCell.imageView.cancelLoading()
}

Requirements:

  • Swift 3
  • iOS 10

Installation:

Drag WebImageView.swift and InternetUtil.swift to your XCode project.

Contact Me

Contact me with with email or linkedin

Other:

  • Please ๐ŸŒŸ this repo if you like it!

webimageview's People

Contributors

boshilee avatar yesleon avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.