[vlc-commits] test: iosvlc: disable pinchRecognizer on tvOS

Alexandre Janniaux git at videolan.org
Thu Apr 15 14:08:02 UTC 2021


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Sun Feb 21 14:35:51 2021 +0100| [54c392d7be7f73af6fabcf542c3c2670db00ff1a] | committer: Alexandre Janniaux

test: iosvlc: disable pinchRecognizer on tvOS

The pinch recognizer cannot work on tvOS, since tvOS doesn't have a
touchscreen.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=54c392d7be7f73af6fabcf542c3c2670db00ff1a
---

 test/iosvlc.m | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/iosvlc.m b/test/iosvlc.m
index 12c1391343..f95fa5fee2 100644
--- a/test/iosvlc.m
+++ b/test/iosvlc.m
@@ -32,12 +32,17 @@
 #include <vlc_variables.h>
 #include <vlc_plugin.h>
 
+#include <TargetConditionals.h>
+
 @interface AppDelegate : UIResponder <UIApplicationDelegate> {
     @public
     libvlc_instance_t *_libvlc;
     UIWindow *window;
     UIView *subview;
+
+#if TARGET_OS_IOS
     UIPinchGestureRecognizer *_pinchRecognizer;
+#endif
 
     CGRect _pinchRect;
     CGPoint _pinchOrigin;
@@ -47,6 +52,7 @@
 
 
 @implementation AppDelegate
+#if TARGET_OS_IOS
 - (void)pinchRecognized:(UIPinchGestureRecognizer *)pinchRecognizer
 {
     UIGestureRecognizerState state = [pinchRecognizer state];
@@ -78,6 +84,8 @@
             _pinchPreviousCenter.x + newPosition.x - _pinchOrigin.x,
             _pinchPreviousCenter.y + newPosition.y - _pinchOrigin.y);
 }
+#endif
+
 /* Called after application launch */
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 {
@@ -112,9 +120,11 @@
     [window addSubview:subview];
     [window makeKeyAndVisible];
 
+#if TARGET_OS_IOS
     _pinchRecognizer = [[UIPinchGestureRecognizer alloc]
         initWithTarget:self action:@selector(pinchRecognized:)];
     [window addGestureRecognizer:_pinchRecognizer];
+#endif
 
     /* Start glue interface, see code below */
     libvlc_add_intf(_libvlc, "ios_interface,none");



More information about the vlc-commits mailing list