I am using MGSplitViewController library in my app. Till iOS7 it works fine but for iOS8 it is not working as expected because of the change of behaviour of UIPopoverController in iOS8. Attached is the screenshot of running MGSplitView code on iOS8 :
which is showing the wrong behaviour. It is supposed to be like the following screenshot :
I have read somewhere that MGSplitViewController library will not be updated for iOS8 fixes.Does anyone know if we have another library which works fine for iOS8 as well and has similar features as of MGSplitViewController.
I faced the same issue and found a fix for it. Go to MGSplitViewController.m
and find the following lines in -splitViewSizeForOrientation:
(around line 261):
width = height;
height = fullScreenRect.size.width;
Make sure it does not run on iOS 8, as iOS 8 will handle sizes properly. Maybe like this.
if (SYSTEM_VERSION_LESS_THAN(@"8.0") && UIInterfaceOrientationIsLandscape(theOrientation)) {
width = height;
height = fullScreenRect.size.width;
}
Then find the following line in -reconfigureForMasterInPopover:
(around line 614):
[_hiddenPopoverController presentPopoverFromRect:CGRectMake(-2000, -2000, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];
And make sure it does not run on iOS 8. Again, maybe like this.
if (SYSTEM_VERSION_LESS_THAN(@"8.0")) {
[_hiddenPopoverController presentPopoverFromRect:CGRectMake(-2000, -2000, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With