I have been working on a project where I needed to show list of images with zoom / swipe feature as presented view modal. I created custom ImageViewer
using ContainerView
in which I have added UIPageViewController
. And on demand, I added ImageViews over the UIPageViewcontroller's
view. When user taps to imageView
, the top UINavigation
gets shown and hidden on toggle basis.
Everything worked as expected in iOS 7.1 and less. However when I tested the functionality in iOS 8 devices and simulator, the ImageViews
were not added to UIPageViewController in TopLeft ( beneath UINavigationBar
). It is added below the NavigationBar
as shown in bug_iOS_8.png below.
Once I touch the buggy view, it repositions itself to correct position as in image expected.png below.
I have created and tested the issue in sample project and it seems it is bug in iOS 8 itself with UIPageViewController
. I went through couple of questions regarding weird behavior of UIPageViewController
too. Please check the sample app here and kindly let me know if anyone has any hints on what is going on.
Thank you for your time and help.
PS: BTW I am using following version of Xcode.
Update 1:
I have tried as per the pin suggestions. However, the problem aligning is with the main view of UIViewController rather than its subview. In below image, Yellow is main View of UIViewController and red one is added subview, I added pin to "red" on in reference to superview "yellow" one. Please check following screen shots.
On startup.
After touch on screen.
Kind Regards,