Parcourir la source

more SDK patching necessities removed

Kevin Bradley il y a 5 ans
Parent
commit
f09271afa5

+ 6 - 3
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -65,9 +65,10 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 /// A colored transparent overlay to indicate that the view is selected.
 @property (nonatomic) UIView *selectedViewOverlay;
 
+#if !TARGET_OS_TV
 /// Used to actuate changes in view selection on iOS 10+
 @property (nonatomic, readonly) UISelectionFeedbackGenerator *selectionFBG API_AVAILABLE(ios(10.0));
-
+#endif
 /// self.view.window as a \c FLEXWindow
 @property (nonatomic, readonly) FLEXWindow *window;
 
@@ -213,12 +214,12 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     self.movePanGR = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleMovePan:)];
     self.movePanGR.enabled = self.currentMode == FLEXExplorerModeMove;
     [self.view addGestureRecognizer:self.movePanGR];
-    
+#if !TARGET_OS_TV
     // Feedback
     if (@available(iOS 10.0, *)) {
         _selectionFBG = [UISelectionFeedbackGenerator new];
     }
-
+#endif
 #if TARGET_OS_TV
     cursorView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 64, 64)];
     cursorView.center = CGPointMake(CGRectGetMidX([UIScreen mainScreen].bounds), CGRectGetMidY([UIScreen mainScreen].bounds));
@@ -845,9 +846,11 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
 }
 
 - (void)actuateSelectionChangedFeedback {
+    #if !TARGET_OS_TV
     if (@available(iOS 10.0, *)) {
         [self.selectionFBG selectionChanged];
     }
+    #endif
 }
 
 - (void)updateOutlineViewsForSelectionPoint:(CGPoint)selectionPointInWindow {

+ 2 - 0
Classes/GlobalStateExplorers/FileBrowser/FLEXFileBrowserController.m

@@ -478,8 +478,10 @@ typedef NS_ENUM(NSUInteger, FLEXFileBrowserSortAttribute) {
         [self openFileController:pathString];
     } else {
         // Share sheet for files
+#if !TARGET_OS_TV
         UIActivityViewController *shareSheet = [[UIActivityViewController alloc] initWithActivityItems:@[filePath] applicationActivities:nil];
         [self presentViewController:shareSheet animated:true completion:nil];
+#endif
     }
 }
 

+ 2 - 0
Classes/ObjectExplorers/Sections/Shortcuts/FLEXShortcutsFactory+Defaults.m

@@ -198,6 +198,7 @@
 @implementation FLEXShortcutsFactory (Activities)
 
 + (void)load { FLEX_EXIT_IF_NO_CTORS()
+#if !TARGET_OS_TV
     // Property was added in iOS 10 but we want it on iOS 9 too
     FLEXRuntimeUtilityTryAddNonatomicProperty(9, item, UIActivityItemProvider.class, id, PropertyKey(ReadOnly));
     
@@ -208,6 +209,7 @@
     self.append.properties(@[
         @"activityItems", @"applicationActivities", @"excludedActivityTypes", @"completionHandler"
     ]).forClass(UIActivityViewController.class);
+#endif
 }
 
 @end

+ 2 - 1
Classes/ViewHierarchy/FLEXImagePreviewViewController.m

@@ -149,7 +149,7 @@
             canSaveToCameraRoll = YES;
         }
     });
-    
+#if !TARGET_OS_TV
     UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[self.image] applicationActivities:@[]];
     
     if (!canSaveToCameraRoll && !didShowWarning) {
@@ -164,6 +164,7 @@
     } else {
         [self presentViewController:activityVC animated:YES completion:nil];
     }
+#endif
 }
 
 @end

+ 7 - 3
README.md

@@ -21,13 +21,17 @@ There is an excessive amount of stubbing / macroing to get this building, at a c
 
 There may be additional classes this needs to be done with, these notes are imprecise but should give you an idea.
 
-```sed -i -- "s|#define __TVOS_UNAVAILABLE                    __OS_AVAILABILITY(tvos,unavailable)|#define __TVOS_UNAVAILABLE_NOTQUITE                    __OS_AVAILABILITY(tvos,unavailable)|" /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/Availability.h
+```
+## this line is 100% necessary
+sed -i -- "s|API_UNAVAILABLE(tvos, watchos)|API_UNAVAILABLE(watchos)|"  /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h
+
+## these lines might not be necessary, try avoiding them at first to see what happens
+
+sed -i -- "s|#define __TVOS_UNAVAILABLE                    __OS_AVAILABILITY(tvos,unavailable)|#define __TVOS_UNAVAILABLE_NOTQUITE                    __OS_AVAILABILITY(tvos,unavailable)|" /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/Availability.h
 
 sed -i -- "s|#define __TVOS_PROHIBITED                     __OS_AVAILABILITY(tvos,unavailable)|#define __TVOS_PROHIBITED_NOTQUITE                     __OS_AVAILABILITY(tvos,unavailable)|" /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/Availability.h
 
-sed -i -- "s|API_UNAVAILABLE(tvos, watchos)|API_UNAVAILABLE(watchos)|"  /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h
 
-sed -i -- "s|API_UNAVAILABLE(tvos)||" /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h
 ```
 
 ![tvOS Demo](view_selection.gif "tvOS Selection")

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