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

attempted to get the snapshot view partially working, but failed so leave out the tool bar item on tvOS for now

Kevin Bradley лет назад: 5
Родитель
Сommit
937c510798

+ 2 - 2
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -227,8 +227,8 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     cursorView.hidden = YES;
 
     
-    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
-    longPress.allowedPressTypes = @[[NSNumber numberWithInteger:UIPressTypePlayPause]];
+    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)];
+    longPress.allowedPressTypes = @[[NSNumber numberWithInteger:UIPressTypePlayPause], [NSNumber numberWithInteger:UIPressTypeSelect]];
     [self.view addGestureRecognizer:longPress];
     [self.view addSubview:cursorView];
     

+ 2 - 2
Classes/ViewHierarchy/FLEXHierarchyViewController.m

@@ -70,12 +70,12 @@ typedef NS_ENUM(NSUInteger, FLEXHierarchyViewMode) {
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-
+#if !TARGET_OS_TV
     // 3D toggle button
     self.treeViewController.navigationItem.leftBarButtonItem = [UIBarButtonItem
         flex_itemWithImage:FLEXResources.toggle3DIcon target:self action:@selector(toggleHierarchyMode)
     ];
-
+#endif
     // Dismiss when tree view row is selected
     __weak id<FLEXHierarchyDelegate> delegate = self.hierarchyDelegate;
     self.treeViewController.didSelectRowAction = ^(UIView *selectedView) {

+ 7 - 0
Classes/ViewHierarchy/SnapshotExplorer/FHSView.m

@@ -87,9 +87,16 @@
 
 @implementation FHSView (Snapshotting)
 
+
 + (UIImage *)drawView:(UIView *)view {
+#if TARGET_OS_TV
+    UIGraphicsBeginImageContextWithOptions(view.layer.bounds.size, NO, 0.0);
+    CGContextRef imageContext = UIGraphicsGetCurrentContext();
+    [view.layer renderInContext:imageContext];
+#else
     UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0);
     [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
+#endif
     UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
     UIGraphicsEndImageContext();
     return image;

+ 1 - 1
README.md

@@ -32,7 +32,7 @@ sed -i -- "s|API_UNAVAILABLE(tvos)||" /Applications/Xcode.app/Contents/Developer
 
 ![tvOS Demo](view_selection.gif "tvOS Selection")
 
-[tvOS Demo](https://www.dropbox.com/s/v685gabrefo614f/better_flex.MP4?dl=1)
+[tvOS Demo](https://lbry.tv/@nitoTV:4/FLEX-on-tvOS:7)
 
 [![CocoaPods](https://img.shields.io/cocoapods/v/FLEX.svg)](https://cocoapods.org/?q=FLEX)
  [![CocoaPods](https://img.shields.io/cocoapods/l/FLEX.svg)](https://github.com/Flipboard/FLEX/blob/master/LICENSE)

BIN
layout/Library/Frameworks/FLEX.framework/FLEX