Coder Social home page Coder Social logo

pictureviewmaster's Introduction

PictureViewMaster

Interactive image projector.

This library supports Swift 2.3
Swift 2.3 is currently in branch master.

Abstract

This is a library that provides an UIImageView subclass with the capability of enlarge its image so the user can rotate it, drag it and zoom it.

How to use it?

Instead of using regulars UIImageView objects use PictureMasterImageView. They'll automatically add a gesture recognizer that will let its delegate knows when the user tap on it. Then, on the delegate callback, implement the PictureMasterViewController by instantiating an object and giving it the UIImage and/or the gestures you want to support (All of them by default.). It will bring a view inside your current view with the large image and all the gesture recognizers, plus the dismissing functionality. NOTE: PictureMasterImageView is not actually required. You can just pass the UIImage you want to the PictureMasterViewController and it will also works. The UIImage subclass is just to have a nice and easy way to have clickable and enlargable UIImageViews.

Install

Drag THESE files to your project : PictureMasterViewController.xib PictureMasterViewController.swift PictureMasterImageView.swift and you are ready to go. Or you can use CocoaPods:

pod 'PictureMasterView'

Then import the library:

import PictureMasterView

USAGE:

//Create an PictureMasterImageView object and assign its delegate
let sampleImage : PictureMasterImageView = PictureMasterImageView(image: UIImage(named:"sampleImage"), andDelegate:self)
//Or just add it on the interface builder, add a reference and assign a the delegate
self.ibSampleImage.delegate = self

//Then conform the the PictureMasterImageViewDelegate
func pictureMasterImageViewDidReceiveTap (pictureMasterImageView: PictureMasterImageView) {
let masterViewController: PictureMasterViewController = PictureMasterViewController(nibName: "PictureMasterViewController", bundle: nil)
// Initialized with custom gestures
masterViewController.showImage(pictureMasterImageView.image!, inViewController:self, withGestures: [.Rotate, .Zoom, .Drag])
// Initialized with all gestures enabled
masterViewController.showImage(pictureMasterImageView.image!, inViewController:self)
}

And that's it. PictureMasterView will take care of showing himself and dismissing himself too because we all are lazy programers and... 2015-03-17

Older Versions Support

  • As of its 2.0 release, this library works with Swift 3.0
  • If you look for older languages version support, you can check out:
  • 1.1 release for Swift 2.3 support.
  • 1.0 release for Swift 2.2 support.

Contact Us

For questions or general comments regarding the use of this library, please use our public hipchat room.

If you find any bugs or have a problem while using this library, please open an issue in this repo (or a pull request :)).

And you can check all of our open-source projects at inaka.github.io

pictureviewmaster's People

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.