0

I'm looking for a good photo browser controller that will browse photos, will support zooming and rotation. I found mwphotoviewer which seems to be the popular option, and its indeed very good. but is there any way to use it in as a tab in a tabbarviewcontroller and not as to push it from a navigationviewcontroller?

so far in every project that I have seen, they use either a

[self.navigationController pushViewController:browser animated:YES];

or

[self presentModalViewController:nc animated:YES];

I just want it to be there,

any ideas?

vaibhav_15
  • 351
  • 2
  • 9
Yoav Schwartz
  • 2,017
  • 2
  • 23
  • 43

2 Answers2

1
[self addChildViewController:self.browser];
[[self view] addSubview:[self.browser view]];
[self.browser didMoveToParentViewController:self];

solved it for me.

Yoav Schwartz
  • 2,017
  • 2
  • 23
  • 43
  • Did you have any issues with rotation when you add browser with this way? I did it but when i rotate the device a part of my screen seems to be dead. No touch events recognized if width is bigger than 320 width in landscape mode. – hoya21 Jan 07 '14 at 11:02
0

Instead of UINavigationController you can use UITabBarController and set it view controller as the one one in which you are supposed to browse the photos.

vaibhav_15
  • 351
  • 2
  • 9
  • yeah, I tried that. I just used the storyboard and put a view controller that is a mwphotobrowser, but its just presenting a black screen. – Yoav Schwartz Nov 09 '13 at 13:02
  • You cannot add only one controller to it, it accepts an array of view controllers. See apple documentations for more details – vaibhav_15 Nov 09 '13 at 13:11
  • is solved it like this : [self addChildViewController:self.browser]; [[self view] addSubview:[self.browser view]]; [self.browser didMoveToParentViewController:self]; but I don't want to accept it because it seems pretty hack. and there are more problems to solve like displaying the toolbar and caption above the tabbar – Yoav Schwartz Nov 09 '13 at 13:39
  • If you are using toolbar also then I would suggest you to go with the Navigation controller only as it will populate the bottom of the screen. and apple discourages it. – vaibhav_15 Nov 09 '13 at 13:42
  • Yeah, I will consider my UI some more. Anyways about the question, I feel its solved and while the MWPhotoBrowser is not very customisable, his code is clear enough to do whatever you need to its looks alone. – Yoav Schwartz Nov 09 '13 at 15:49