Git Product home page Git Product logo

imagescrollview's Introduction

ImageScrollView

A control help you display an image, with zoomable and scrollable features easily.

About

When you make an application, has photo viewer feature, the photo viewer usually need zoomable and scrollable features, to make user view photo more details.
This control help you display image, with zoomable and scrollable feature easily.

Compatible

  • iOS 7 and later (require iOS 8 if you want to add it to project using CocoaPod)
  • Swift 3.0 (version 1.3), 2.0 (version 1.2 and prior)

Usage

Cocoapod

Add below line to Podfile:

pod 'ImageScrollView'

and run below command in Terminal to install:
pod install

Note: If above pod isn't working, try using below pod defination in Podfile:
pod 'ImageScrollView', :git => 'https://github.com/huynguyencong/ImageScrollView.git'

Manual

In iOS 7, you cannot use Cocoapod to install. In this case, you need add it manually. Simply, add file ImageSrollView.swift in folder Sources to your project

Simple to use

Drag an UIScrollView to your storyboard, change Class and Module in Identity Inspector to ImageScrollView. Also create an IBOutlet in your source file.

image

import ImageScrollView
@IBOutlet weak var imageScrollView: ImageScrollView!
let myImage = UIImage(named: "my_image_name")
imageScrollView.display(image: myImage)

That's all. Now try zooming and scrolling to see the result.

About this source

This open source is base on PhotoScroller demo in Apple site. The origin source is written by Objective C. This source rewrite it use Swift, and add some new features:

  • Double tap to zooming feature.
  • Smoother, fix bug when zoom out, then control auto zoom in, it zoom in from center, not from corner.

License

ImageScrollView is released under the MIT license. See LICENSE for details. Copyright © Nguyen Cong Huy

imagescrollview's People

Contributors

huynguyencong avatar jrg-developer avatar

Watchers

James Cloos avatar lifetofree 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.