Просмотр исходного кода

Fix view selection when not in portrait.

Thanks to @lascorbe for discovering this and suggesting a fix (#31).
Ryan Olson лет назад: 11
Родитель
Сommit
7a93e9b4dd
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      Classes/Explorer Toolbar/FLEXExplorerViewController.m

+ 5 - 1
Classes/Explorer Toolbar/FLEXExplorerViewController.m

@@ -594,7 +594,11 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 {
     // Only if we're in selection mode
     if (self.currentMode == FLEXExplorerModeSelect && tapGR.state == UIGestureRecognizerStateRecognized) {
-        [self updateOutlineViewsForSelectionPoint:[tapGR locationInView:nil]];
+        // Note that [tapGR locationInView:nil] is broken in iOS 8, so we have to do a two step conversion to window coordinates.
+        // Thanks to @lascorbe for finding this: https://github.com/Flipboard/FLEX/pull/31
+        CGPoint tapPointInView = [tapGR locationInView:self.view];
+        CGPoint tapPointInWindow = [self.view convertPoint:tapPointInView toView:nil];
+        [self updateOutlineViewsForSelectionPoint:tapPointInWindow];
     }
 }