Latest 1.0.1
Homepage https://github.com/shima11/InteractiveZoomDriver
License MIT
Platforms ios 9.0
Authors

This repo is view to zoomable by pinch gesture.

Overview

InteractiveZoomDriver

Installation

Carthage

For Installing with Carthage, add it to your Cartfile.

github "shima11/InteractiveZoomDriver"

CocoaPods

For installing with CocoaPods, add it to your Podfile.

pod 'InteractiveZoomDriver'

Usage

import InteractiveZoomDriver

let zoomView = UIImageView() // UIView or SubClass of UIView
zoomView.isUserInteractionEnabled = true

case1: driver

Add zoom function to target UIView.

gestureTargetView: added tap and pan gesture.
sourceView: source view.
targetViewFactory: Transformed View during zooming.
shouldZoomTransform: Delegate to the outside whether zooming is possible.

let driver = InteractiveZoomDriver(
  gestureTargetView: zoomView, 
  sourceView: zoomView, 
  targetViewFactory: InteractiveZoomView.clone, 
  shouldZoomTransform: InteractiveZoomView.shouldZoomTransform
  )

view.addSubView(zoomView)

case2: overlay view

InteractiveZoomView is able to only UIImageView now.
If you want to use custom UIView, you need to create extension of InteractiveZoomView with reference to InteractiveZoomView.

let overlayZoomView = InteractiveZoomView(
    sourceView: zoomView
)
view.addSubView(overlayZoomView)

Latest podspec

{
    "name": "InteractiveZoomDriver",
    "version": "1.0.1",
    "summary": "UIView to zoomable by pinch gesture.",
    "description": "This repo is view to zoomable by pinch gesture.",
    "platforms": {
        "ios": "9.0"
    },
    "homepage": "https://github.com/shima11/InteractiveZoomDriver",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Shima": "[email protected]"
    },
    "source": {
        "git": "https://github.com/shima11/InteractiveZoomDriver.git",
        "tag": "1.0.1"
    },
    "source_files": "Sources/InteractiveZoomDriver/*.swift"
}

Pin It on Pinterest

Share This