Skip to content

Commit

Permalink
Added rotation, zooming in from popover, file URL support, bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
devindoty committed Oct 28, 2010
1 parent bb46280 commit bce188a
Show file tree
Hide file tree
Showing 13 changed files with 471 additions and 112 deletions.
24 changes: 11 additions & 13 deletions Demo/Classes/DetailViewController.m
Expand Up @@ -105,31 +105,29 @@ - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrie

- (void)showPhotoView:(UIBarButtonItem*)sender{

MyPhoto *photo = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"http://a3.twimg.com/profile_images/66601193/cactus.jpg"] name:@" laksd;lkas;dlkaslkd ;a"];
MyPhoto *photo2 = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"https://s3.amazonaws.com/twitter_production/profile_images/425948730/DF-Star-Logo.png"] name:@"lskdjf lksjdhfk jsdfh ksjdhf sjdhf ksjdhf ksdjfh ksdjh skdjfh skdfjh "];
MyPhoto *photo3 = [[MyPhoto alloc] initWithImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"local_image_1" ofType:@"jpg"]]];

MyPhoto *photo4 = [[MyPhoto alloc] initWithImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"local_image_2" ofType:@"jpg"]]];

MyPhotoSource *source = [[MyPhotoSource alloc] initWithPhotos:[NSArray arrayWithObjects:photo, photo2, nil]];
MyPhoto *webPhoto = [[MyPhoto alloc] initWithImageURL:[NSURL URLWithString:@"http://a3.twimg.com/profile_images/66601193/cactus.jpg"] name:@" laksd;lkas;dlkaslkd ;a"];
MyPhoto *filePathPhoto = [[MyPhoto alloc] initWithImageURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"local_image_2" ofType:@"jpg"]]];
MyPhoto *inMemoryPhoto = [[MyPhoto alloc] initWithImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"local_image_1" ofType:@"jpg"]]];

MyPhotoSource *source = [[MyPhotoSource alloc] initWithPhotos:[NSArray arrayWithObjects:webPhoto, filePathPhoto, inMemoryPhoto, nil]];

EGOPhotoViewController *photoController = [[EGOPhotoViewController alloc] initWithPhotoSource:source];
photoController.contentSizeForViewInPopover = CGSizeMake(480.0f, 480.0f);

[webPhoto release];
[filePathPhoto release];
[inMemoryPhoto release];
[source release];

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:photoController];
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:navController];
popover.delegate = self;
[popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
popoverController = popover;

[photoController release];

[navController release];
[photo release];
[photo2 release];
[photo3 release];
[photo4 release];
[source release];


}

Expand Down
66 changes: 44 additions & 22 deletions Demo/EGOPhotoViewer_Demo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Expand Up @@ -56,6 +56,12 @@

BOOL _autoresizedPopover;
id _popover;

BOOL _fullScreen;
BOOL _fromPopover;
UIView *_popoverOverlay;
UIView *_transferView;

}

- (id)initWithPhoto:(id<EGOPhoto>)aPhoto;
Expand All @@ -69,7 +75,9 @@
@property(nonatomic,readonly) id <EGOPhotoSource> photoSource;
@property(nonatomic,retain) NSMutableArray *photoViews;
@property(nonatomic,retain) UIScrollView *scrollView;
@property(nonatomic,assign) BOOL _fromPopover;

- (NSInteger)currentPhotoIndex;
- (void)moveToPhotoAtIndex:(NSInteger)index animated:(BOOL)animated;

@end

0 comments on commit bce188a

Please sign in to comment.