Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add zooming by pinch.

  • Loading branch information...
commit 696e6c491033be53dce5e9feac01e617e33e3313 1 parent a2a589a
@autresphere authored
View
56 ASMediaFocusManager/ASImageScrollView.h
@@ -0,0 +1,56 @@
+/*
+ File: ASImageScrollView.h
+ Abstract: Centers image within the scroll view and configures image sizing and display.
+ Version: 1.3 modified by Philippe Converset on 22/01/13.
+
+ Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
+ Inc. ("Apple") in consideration of your agreement to the following
+ terms, and your use, installation, modification or redistribution of
+ this Apple software constitutes acceptance of these terms. If you do
+ not agree with these terms, please do not use, install, modify or
+ redistribute this Apple software.
+
+ In consideration of your agreement to abide by the following terms, and
+ subject to these terms, Apple grants you a personal, non-exclusive
+ license, under Apple's copyrights in this original Apple software (the
+ "Apple Software"), to use, reproduce, modify and redistribute the Apple
+ Software, with or without modifications, in source and/or binary forms;
+ provided that if you redistribute the Apple Software in its entirety and
+ without modifications, you must retain this notice and the following
+ text and disclaimers in all such redistributions of the Apple Software.
+ Neither the name, trademarks, service marks or logos of Apple Inc. may
+ be used to endorse or promote products derived from the Apple Software
+ without specific prior written permission from Apple. Except as
+ expressly stated in this notice, no other rights or licenses, express or
+ implied, are granted by Apple herein, including but not limited to any
+ patent rights that may be infringed by your derivative works or by other
+ works in which the Apple Software may be incorporated.
+
+ The Apple Software is provided by Apple on an "AS IS" basis. APPLE
+ MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
+ OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
+
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
+ MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
+ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
+ STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ Copyright (C) 2012 Apple Inc. All Rights Reserved.
+
+ */
+
+#import <UIKit/UIKit.h>
+
+@interface ASImageScrollView : UIScrollView
+
+@property (nonatomic, strong) UIImageView *zoomImageView;
+
+- (void)displayImage:(UIImage *)image;
+
+@end
View
247 ASMediaFocusManager/ASImageScrollView.m
@@ -0,0 +1,247 @@
+/*
+ File: ASImageScrollView.m
+ Abstract: Centers image within the scroll view and configures image sizing and display.
+ Version: 1.3 modified by Philippe Converset on 22/01/13.
+
+ Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
+ Inc. ("Apple") in consideration of your agreement to the following
+ terms, and your use, installation, modification or redistribution of
+ this Apple software constitutes acceptance of these terms. If you do
+ not agree with these terms, please do not use, install, modify or
+ redistribute this Apple software.
+
+ In consideration of your agreement to abide by the following terms, and
+ subject to these terms, Apple grants you a personal, non-exclusive
+ license, under Apple's copyrights in this original Apple software (the
+ "Apple Software"), to use, reproduce, modify and redistribute the Apple
+ Software, with or without modifications, in source and/or binary forms;
+ provided that if you redistribute the Apple Software in its entirety and
+ without modifications, you must retain this notice and the following
+ text and disclaimers in all such redistributions of the Apple Software.
+ Neither the name, trademarks, service marks or logos of Apple Inc. may
+ be used to endorse or promote products derived from the Apple Software
+ without specific prior written permission from Apple. Except as
+ expressly stated in this notice, no other rights or licenses, express or
+ implied, are granted by Apple herein, including but not limited to any
+ patent rights that may be infringed by your derivative works or by other
+ works in which the Apple Software may be incorporated.
+
+ The Apple Software is provided by Apple on an "AS IS" basis. APPLE
+ MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
+ OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
+
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
+ MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
+ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
+ STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ Copyright (C) 2012 Apple Inc. All Rights Reserved.
+
+ */
+
+#import <Foundation/Foundation.h>
+
+#import "ASImageScrollView.h"
+
+#pragma mark -
+
+@interface ASImageScrollView () <UIScrollViewDelegate>
+{
+ CGSize _imageSize;
+
+ CGPoint _pointToCenterAfterResize;
+ CGFloat _scaleToRestoreAfterResize;
+}
+
+@end
+
+@implementation ASImageScrollView
+
+- (id)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self)
+ {
+ self.showsVerticalScrollIndicator = NO;
+ self.showsHorizontalScrollIndicator = NO;
+ self.bouncesZoom = YES;
+ self.decelerationRate = UIScrollViewDecelerationRateFast;
+ self.delegate = self;
+ }
+ return self;
+}
+
+- (void)layoutSubviews
+{
+ [super layoutSubviews];
+
+ // center the zoom view as it becomes smaller than the size of the screen
+ CGSize boundsSize = self.bounds.size;
+ CGRect frameToCenter = self.zoomImageView.frame;
+
+ // center horizontally
+ if (frameToCenter.size.width < boundsSize.width)
+ frameToCenter.origin.x = (boundsSize.width - frameToCenter.size.width) / 2;
+ else
+ frameToCenter.origin.x = 0;
+
+ // center vertically
+ if (frameToCenter.size.height < boundsSize.height)
+ frameToCenter.origin.y = (boundsSize.height - frameToCenter.size.height) / 2;
+ else
+ frameToCenter.origin.y = 0;
+
+ self.zoomImageView.frame = frameToCenter;
+}
+
+- (void)setFrame:(CGRect)frame
+{
+ BOOL sizeChanging = !CGSizeEqualToSize(frame.size, self.frame.size);
+
+ if (sizeChanging) {
+ [self prepareToResize];
+ }
+
+ [super setFrame:frame];
+
+ if (sizeChanging) {
+ [self recoverFromResizing];
+ }
+}
+
+
+#pragma mark - UIScrollViewDelegate
+
+- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
+{
+ return self.zoomImageView;
+}
+
+- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale
+{
+
+}
+
+#pragma mark - Configure scrollView to display new image
+
+
+- (void)displayImage:(UIImage *)image
+{
+ if(self.zoomImageView == nil)
+ {
+ self.zoomScale = 1.0;
+
+ // make a new UIImageView for the new image
+ self.zoomImageView = [[UIImageView alloc] initWithImage:image];
+ [self addSubview:self.zoomImageView];
+ }
+ else
+ {
+ self.zoomImageView.image = image;
+ }
+
+ [self configureForImageSize:image.size];
+}
+
+- (void)configureForImageSize:(CGSize)imageSize
+{
+ _imageSize = imageSize;
+ self.contentSize = imageSize;
+ [self setMaxMinZoomScalesForCurrentBounds];
+ self.zoomScale = self.minimumZoomScale;
+}
+
+- (void)setMaxMinZoomScalesForCurrentBounds
+{
+ CGSize boundsSize = self.bounds.size;
+ CGFloat maxScale = 1;
+
+ // calculate min/max zoomscale
+ CGFloat xScale = boundsSize.width / _imageSize.width; // the scale needed to perfectly fit the image width-wise
+ CGFloat yScale = boundsSize.height / _imageSize.height; // the scale needed to perfectly fit the image height-wise
+ CGFloat minScale = MIN(xScale, yScale); // use minimum of these to allow the image to become fully visible
+
+ // Image must fit the screen, even if its size is smaller.
+ CGFloat xImageScale = maxScale*_imageSize.width / boundsSize.width;
+ CGFloat yImageScale = maxScale*_imageSize.height / boundsSize.width;
+ CGFloat maxImageScale = MAX(xImageScale, yImageScale);
+
+ maxImageScale = MAX(minScale, maxImageScale);
+ maxScale = MIN(maxScale, maxImageScale);
+
+ // don't let minScale exceed maxScale. (If the image is smaller than the screen, we don't want to force it to be zoomed.)
+ if (minScale > maxScale) {
+ minScale = maxScale;
+ }
+
+ self.maximumZoomScale = maxScale;
+ self.minimumZoomScale = minScale;
+}
+
+#pragma mark -
+#pragma mark Methods called during rotation to preserve the zoomScale and the visible portion of the image
+
+#pragma mark - Rotation support
+
+- (void)prepareToResize
+{
+ CGPoint boundsCenter = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds));
+ _pointToCenterAfterResize = [self convertPoint:boundsCenter toView:self.zoomImageView];
+
+ _scaleToRestoreAfterResize = self.zoomScale;
+
+ // If we're at the minimum zoom scale, preserve that by returning 0, which will be converted to the minimum
+ // allowable scale when the scale is restored.
+ if (_scaleToRestoreAfterResize <= self.minimumZoomScale + FLT_EPSILON)
+ _scaleToRestoreAfterResize = 0;
+}
+
+- (void)recoverFromResizing
+{
+ [self setMaxMinZoomScalesForCurrentBounds];
+
+ // Step 1: restore zoom scale, first making sure it is within the allowable range.
+ CGFloat maxZoomScale = MAX(self.minimumZoomScale, _scaleToRestoreAfterResize);
+ self.zoomScale = MIN(self.maximumZoomScale, maxZoomScale);
+
+ // Step 2: restore center point, first making sure it is within the allowable range.
+
+ // 2a: convert our desired center point back to our own coordinate space
+ CGPoint boundsCenter = [self convertPoint:_pointToCenterAfterResize fromView:self.zoomImageView];
+
+ // 2b: calculate the content offset that would yield that center point
+ CGPoint offset = CGPointMake(boundsCenter.x - self.bounds.size.width / 2.0,
+ boundsCenter.y - self.bounds.size.height / 2.0);
+
+ // 2c: restore offset, adjusted to be within the allowable range
+ CGPoint maxOffset = [self maximumContentOffset];
+ CGPoint minOffset = [self minimumContentOffset];
+
+ CGFloat realMaxOffset = MIN(maxOffset.x, offset.x);
+ offset.x = MAX(minOffset.x, realMaxOffset);
+
+ realMaxOffset = MIN(maxOffset.y, offset.y);
+ offset.y = MAX(minOffset.y, realMaxOffset);
+
+ self.contentOffset = offset;
+}
+
+- (CGPoint)maximumContentOffset
+{
+ CGSize contentSize = self.contentSize;
+ CGSize boundsSize = self.bounds.size;
+ return CGPointMake(contentSize.width - boundsSize.width, contentSize.height - boundsSize.height);
+}
+
+- (CGPoint)minimumContentOffset
+{
+ return CGPointZero;
+}
+
+@end
View
2  ASMediaFocusManager/ASMediaFocusController.h
@@ -7,9 +7,11 @@
//
#import <UIKit/UIKit.h>
+#import "ASImageScrollView.h"
@interface ASMediaFocusController : UIViewController
+@property (strong, nonatomic) ASImageScrollView *scrollView;
@property (strong, nonatomic) IBOutlet UIImageView *mainImageView;
@property (strong, nonatomic) IBOutlet UIView *contentView;
View
32 ASMediaFocusManager/ASMediaFocusController.xib
@@ -39,13 +39,11 @@
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
- <object class="IBUIImageView" id="669125235">
+ <object class="IBUIImageView" id="373313849">
<reference key="NSNextResponder" ref="946087153"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{200, 200}</string>
<reference key="NSSuperview" ref="946087153"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="IBUIContentMode">1</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -54,8 +52,7 @@
</array>
<string key="NSFrameSize">{200, 200}</string>
<reference key="NSSuperview" ref="191373211"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="669125235"/>
+ <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor" id="321377936">
<int key="NSColorSpace">3</int>
@@ -66,7 +63,6 @@
</array>
<string key="NSFrameSize">{200, 200}</string>
<reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="946087153"/>
<reference key="IBUIBackgroundColor" ref="321377936"/>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@@ -84,19 +80,19 @@
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">mainImageView</string>
+ <string key="label">contentView</string>
<reference key="source" ref="372490531"/>
- <reference key="destination" ref="669125235"/>
+ <reference key="destination" ref="946087153"/>
</object>
- <int key="connectionID">10</int>
+ <int key="connectionID">13</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">contentView</string>
+ <string key="label">mainImageView</string>
<reference key="source" ref="372490531"/>
- <reference key="destination" ref="946087153"/>
+ <reference key="destination" ref="373313849"/>
</object>
- <int key="connectionID">13</int>
+ <int key="connectionID">18</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -130,31 +126,31 @@
<int key="objectID">12</int>
<reference key="object" ref="946087153"/>
<array class="NSMutableArray" key="children">
- <reference ref="669125235"/>
+ <reference ref="373313849"/>
</array>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">3</int>
- <reference key="object" ref="669125235"/>
+ <int key="objectID">16</int>
+ <reference key="object" ref="373313849"/>
<reference key="parent" ref="946087153"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
- <string key="-1.CustomClassName">ASMediaFocusViewController</string>
+ <string key="-1.CustomClassName">ASMediaFocusController</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="16.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">13</int>
+ <int key="maxID">18</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
View
2  ASMediaFocusManager/ASMediaFocusManager.h
@@ -33,6 +33,8 @@
@property (nonatomic, strong) UIColor *backgroundColor;
// Returns whether the animation has an elastic effect. Defaults to YES.
@property (assign, nonatomic) BOOL elasticAnimation;
+// Returns whether zoom is enabled on fullscreen image. Defaults to YES.
+@property (nonatomic, assign) BOOL zoomEnabled;
- (void)installOnViews:(NSArray *)views;
View
43 ASMediaFocusManager/ASMediaFocusManager.m
@@ -53,6 +53,7 @@ - (id)init
self.animationDuration = kAnimationDuration;
self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.8];
self.elasticAnimation = YES;
+ self.zoomEnabled = YES;
}
return self;
@@ -179,9 +180,45 @@ - (void)handleFocusGesture:(UIGestureRecognizer *)gesture
[UIView animateWithDuration:self.animationDuration*kAnimateElasticDurationRatio
animations:^{
imageView.frame = focusViewController.contentView.bounds;
- }];
+ }
+ completion:^(BOOL finished) {
+ [self installZoomView];
+ }];
+ }
+ else
+ {
+ [self installZoomView];
}
}];
+
+}
+
+- (void)installZoomView
+{
+ ASImageScrollView *scrollView;
+
+ if(!self.zoomEnabled)
+ return;
+
+ scrollView = [[ASImageScrollView alloc] initWithFrame:self.focusViewController.contentView.bounds];
+ scrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
+ self.focusViewController.scrollView = scrollView;
+ [self.focusViewController.contentView addSubview:scrollView];
+ [scrollView displayImage:self.focusViewController.mainImageView.image];
+ self.focusViewController.mainImageView.hidden = YES;
+}
+
+- (void)uninstallZoomView
+{
+ CGRect frame;
+
+ if(!self.zoomEnabled)
+ return;
+
+ frame = [self.focusViewController.contentView convertRect:self.focusViewController.scrollView.zoomImageView.frame fromView:self.focusViewController.scrollView];
+ self.focusViewController.scrollView.hidden = YES;
+ self.focusViewController.mainImageView.hidden = NO;
+ self.focusViewController.mainImageView.frame = frame;
}
- (void)handleDefocusGesture:(UIGestureRecognizer *)gesture
@@ -189,10 +226,10 @@ - (void)handleDefocusGesture:(UIGestureRecognizer *)gesture
UIView *contentView;
CGRect __block bounds;
+ [self uninstallZoomView];
contentView = self.focusViewController.mainImageView;
[UIView animateWithDuration:self.animationDuration
- animations:^{
-
+ animations:^{
self.focusViewController.contentView.transform = CGAffineTransformIdentity;
contentView.center = [contentView.superview convertPoint:self.mediaView.center fromView:self.mediaView.superview];
contentView.transform = self.mediaView.transform;
View
6 Example/ASMediaFocusExemple.xcodeproj/project.pbxproj
@@ -26,6 +26,7 @@
4A15DE7316776EC7004C6733 /* 2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4A15DE6B16776EC7004C6733 /* 2.jpg */; };
4A15DE7416776EC7004C6733 /* 3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4A15DE6C16776EC7004C6733 /* 3.jpg */; };
4A15DE7516776EC7004C6733 /* 4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4A15DE6D16776EC7004C6733 /* 4.jpg */; };
+ 4A2D149E16AD255800D3CE3D /* ASImageScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A2D149D16AD255800D3CE3D /* ASImageScrollView.m */; };
4A7F15F21684635100ADC5D6 /* ASMediaThumbnailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A7F15F01684635100ADC5D6 /* ASMediaThumbnailsViewController.m */; };
4A7F15F31684635100ADC5D6 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4A7F15F11684635100ADC5D6 /* MainViewController.xib */; };
4ABF0AF216A048E50053040A /* ASMediaThumbnailsViewController~iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4ABF0AF016A048E50053040A /* ASMediaThumbnailsViewController~iphone.xib */; };
@@ -59,6 +60,8 @@
4A15DE6B16776EC7004C6733 /* 2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 2.jpg; sourceTree = "<group>"; };
4A15DE6C16776EC7004C6733 /* 3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 3.jpg; sourceTree = "<group>"; };
4A15DE6D16776EC7004C6733 /* 4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 4.jpg; sourceTree = "<group>"; };
+ 4A2D149C16AD255800D3CE3D /* ASImageScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASImageScrollView.h; sourceTree = "<group>"; };
+ 4A2D149D16AD255800D3CE3D /* ASImageScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASImageScrollView.m; sourceTree = "<group>"; };
4A7F15EF1684635100ADC5D6 /* ASMediaThumbnailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASMediaThumbnailsViewController.h; path = ../ASMediaThumbnailsViewController.h; sourceTree = "<group>"; };
4A7F15F01684635100ADC5D6 /* ASMediaThumbnailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASMediaThumbnailsViewController.m; path = ../ASMediaThumbnailsViewController.m; sourceTree = "<group>"; };
4A7F15F11684635100ADC5D6 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MainViewController.xib; path = ../MainViewController.xib; sourceTree = "<group>"; };
@@ -191,6 +194,8 @@
4ABF0B0316A0575C0053040A /* ASMediaFocusManager.h */,
4ABF0B0416A0575C0053040A /* ASMediaFocusManager.m */,
4ABF0B1816A2E62E0053040A /* ASMediaFocusController.xib */,
+ 4A2D149C16AD255800D3CE3D /* ASImageScrollView.h */,
+ 4A2D149D16AD255800D3CE3D /* ASImageScrollView.m */,
);
name = ASMediaFocusManager;
path = ../../ASMediaFocusManager;
@@ -279,6 +284,7 @@
4A7F15F21684635100ADC5D6 /* ASMediaThumbnailsViewController.m in Sources */,
4ABF0B0516A0575C0053040A /* ASMediaFocusController.m in Sources */,
4ABF0B0616A0575C0053040A /* ASMediaFocusManager.m in Sources */,
+ 4A2D149E16AD255800D3CE3D /* ASImageScrollView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
10 Readme.md
@@ -72,12 +72,16 @@ Here is an example of a delegate implementation. Please adapt the code to your c
```
###Configure
-You can change the focused background color as well as the animation duration.
+Here is the things you can configure:
+
+* focused background color
+* animation duration
+* enable/disable elastic animation
+* enable/disable zooming by pinch
-You can choose whether the animation has an elastic effect or not.
##Todo
-* Add zooming feature
* Add "Done" button
+* Fix image jump on orientation change when fullscreen image is zoomed
* Improve the elastic (ie natural) effect on focus and defocus rotation.
* Support movie media.
* Media browsing by swipe in fullscreen.
Please sign in to comment.
Something went wrong with that request. Please try again.