Explorar o código

iOS: Fix the forced CollectionView on initial launch

UIDeviceOrientationUnknown wasn't checked therefore UIDeviceOrientationIsPortrait() method
returned false on inital launch causing the CollectionView even when the user was in Portrait.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Soomin Lee %!s(int64=8) %!d(string=hai) anos
pai
achega
383b77e5df
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      Sources/VLCLibraryViewController.m

+ 3 - 1
Sources/VLCLibraryViewController.m

@@ -498,7 +498,9 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
 {
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
         UIDevice *currentDevice = [UIDevice currentDevice];
-        BOOL isPortrait = UIDeviceOrientationIsPortrait(currentDevice.orientation);
+        UIDeviceOrientation orientation = currentDevice.orientation;
+
+        BOOL isPortrait = (orientation == UIDeviceOrientationUnknown) ? self.usingTableViewToShowData : UIDeviceOrientationIsPortrait(orientation);
 
         if (self.isEditing) {
             [self setEditing:NO animated:NO];