I’m pretty new to iOS programming so sorry for any “doh” questions 😉
I wanted to use the wonderful MWPhotoBrowser in my App. I’m using a TabBar Application but I can’t figure out how to present the photo browser in my view. Any hints/ideas/code snippets?
Any help is very much appreciated. Thanks
This is what I have in my ViewDidLoad in the ViewController of the View of the Tab:
// Browser
NSMutableArray *photos = [[NSMutableArray alloc] init];
self.photos = [NSMutableArray array];
[photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"URL to 1.jpg"]]];
[photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"URL to 2.jpg"]]];
self.photos = photos;
// Create & present browser
MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
browser.displayActionButton = YES; // Show action button to save, copy or email photos
[browser setInitialPageIndex:1]; // Example: allows second image to be presented first
// Present
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:browser];
nc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:nc animated:YES];
I copied this from the Demo but now I have a view thats in front of my tab bar view, but all I want is that photo view inside my tab bar. What am I missing/obviously doing wrong?
Check GitHub link they have sample code demo. Use that sample code to modify your application. https://www.github.com/mwaterfall/MWPhotoBrowser