Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for custom fullscreen image #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions EXPhotoViewer/EXPhotoViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
@interface EXPhotoViewer : UIViewController <UIScrollViewDelegate>

+ (void) showImageFrom:(UIImageView*) image;
+ (void) showImageFrom:(UIImageView*) image originalImage:(UIImage*)originalImage;

@end
14 changes: 11 additions & 3 deletions EXPhotoViewer/EXPhotoViewer.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ @implementation EXPhotoViewer
+ (void) showImageFrom:(UIImageView*) imageView {
if (imageView.image) {
EXPhotoViewer* viewer = [EXPhotoViewer new];
[viewer showImageFrom:imageView];
[viewer showImageFrom:imageView originalImage:imageView.image];
}
}

+ (void) showImageFrom:(UIImageView*) imageView originalImage:(UIImage*)originalImage {
if (imageView.image) {
EXPhotoViewer* viewer = [EXPhotoViewer new];
[viewer showImageFrom:imageView originalImage:originalImage];
}
}

Expand Down Expand Up @@ -59,7 +66,7 @@ -(UIViewController *) rootViewController{
return controller;
}

- (void) showImageFrom:(UIImageView*) imageView {
- (void) showImageFrom:(UIImageView*) imageView originalImage:(UIImage*)originalImage{
UIViewController * controller = [self rootViewController];

self.tempViewContainer = [[UIView alloc] initWithFrame:controller.view.bounds];
Expand All @@ -79,7 +86,8 @@ - (void) showImageFrom:(UIImageView*) imageView {

[controller.view addSubview:self.view];

self.theImageView.image = imageView.image;
//self.theImageView.image = imageView.image;
self.theImageView.image = originalImage;
self.originalImageRect = [imageView convertRect:imageView.bounds toView:self.view];

self.theImageView.frame = self.originalImageRect;
Expand Down