Bladeren bron

more SDK patching necessities removed

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

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

@@ -478,8 +478,10 @@ typedef NS_ENUM(NSUInteger, FLEXFileBrowserSortAttribute) {
         [self openFileController:pathString];
         [self openFileController:pathString];
     } else {
     } else {
         // Share sheet for files
         // Share sheet for files
+#if !TARGET_OS_TV
         UIActivityViewController *shareSheet = [[UIActivityViewController alloc] initWithActivityItems:@[filePath] applicationActivities:nil];
         UIActivityViewController *shareSheet = [[UIActivityViewController alloc] initWithActivityItems:@[filePath] applicationActivities:nil];
         [self presentViewController:shareSheet animated:true completion: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)
 @implementation FLEXShortcutsFactory (Activities)
 
 
 + (void)load { FLEX_EXIT_IF_NO_CTORS()
 + (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
     // Property was added in iOS 10 but we want it on iOS 9 too
     FLEXRuntimeUtilityTryAddNonatomicProperty(9, item, UIActivityItemProvider.class, id, PropertyKey(ReadOnly));
     FLEXRuntimeUtilityTryAddNonatomicProperty(9, item, UIActivityItemProvider.class, id, PropertyKey(ReadOnly));
     
     
@@ -208,6 +209,7 @@
     self.append.properties(@[
     self.append.properties(@[
         @"activityItems", @"applicationActivities", @"excludedActivityTypes", @"completionHandler"
         @"activityItems", @"applicationActivities", @"excludedActivityTypes", @"completionHandler"
     ]).forClass(UIActivityViewController.class);
     ]).forClass(UIActivityViewController.class);
+#endif
 }
 }
 
 
 @end
 @end

+ 2 - 1
Classes/ViewHierarchy/FLEXImagePreviewViewController.m

@@ -149,7 +149,7 @@
             canSaveToCameraRoll = YES;
             canSaveToCameraRoll = YES;
         }
         }
     });
     });
-    
+#if !TARGET_OS_TV
     UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[self.image] applicationActivities:@[]];
     UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[self.image] applicationActivities:@[]];
     
     
     if (!canSaveToCameraRoll && !didShowWarning) {
     if (!canSaveToCameraRoll && !didShowWarning) {
@@ -164,6 +164,7 @@
     } else {
     } else {
         [self presentViewController:activityVC animated:YES completion:nil];
         [self presentViewController:activityVC animated:YES completion:nil];
     }
     }
+#endif
 }
 }
 
 
 @end
 @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.
 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|#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")
 ![tvOS Demo](view_selection.gif "tvOS Selection")

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