Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A UIWindow that can be used to zoom in a specific UIView and displays it fullscreen
Objective-C Ruby
branch: master

Merge pull request #6 from paulz/master

Edit menu is not showing after zooming in
latest commit 0556f4198c
@myell0w authored
Failed to load latest commit information.
MTZoomWindow.xcodeproj
.gitignore
MTZoomWindow.h Convert to modern Objective-C Syntax
MTZoomWindow.m make zoomed window a key window
MTZoomWindow.podspec Add CocoaPods podspec for a future version and fix bug in README exam…
MTZoomWindowDelegate.h
MTZoomWindow_Prefix.pch Initial commit
Readme.mdown Added known issue and workaround to Readme
UIView+MTZoom.h Shorthand to toggle zoom state of UIView
UIView+MTZoom.m

Readme.mdown

Read Me

This class provides a simple way to zoom a specific UIView and display it fullscreen, upon a defined action of the user (uses UIGestureRecognizer to detect actions). If the user performs the action on the specified UIView the view gets zoomed in animated and is displayed fullscreen, with a black background. If the user performs the same gesture again, the UIView gets zoomed back out and everything is like it was before.

This is a simple way that feels lighter to the user then pushing an own UIViewController just for displaying something in fullscreen.

Usage

You can use MTZoomWindow like this:

// specify size of the UIView when it is zoomed in
viewToZoom.zoomedSize = CGSizeMake(300,460);
viewToZoom.zoomedAutoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
viewToZoom.wrapInScrollviewWhenZoomed = YES;

// find this awesome shortcut for UITapGestureRecognizer in @zwaldowski's BlocksKit
[viewToZoom whenTapped:^{
    [viewToZoom zoomIn];
}];

Adding MTZoomWindow to your project

  1. Just copy over the files MTZoomWindow.h, MTZoomWindow.m, UIView+MTZoom.h, UIView+MTZoom.m and MTZoomWindowDelegate.h to your project.
  2. import "MTZoomWindow.h" everywhere where you want to use it
  3. There is no step 3 :)

Known Issues

When your App supports landscape orientation you have to create MTZoomWindow in your AppDelegate:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // ...
    // create ZoomWindow to listen for orientation changes
    [MTZoomWindow sharedWindow];

    return YES;
}

Screenshots

MTZoomWindow used on a MKMapView

MTZoomWindow

Something went wrong with that request. Please try again.