瀏覽代碼

should no longer need a patched SDK to build for tvOS

Kevin Bradley 5 年之前
父節點
當前提交
c6781ac148

+ 5 - 2
Classes/Editing/FLEXVariableEditorViewController.m

@@ -36,7 +36,8 @@
         _target = target;
         _data = data;
         _commitHandler = onCommit;
-        [NSNotificationCenter.defaultCenter
+#if !TARGET_OS_TV
+       [NSNotificationCenter.defaultCenter
             addObserver:self selector:@selector(keyboardDidShow:)
             name:UIKeyboardDidShowNotification object:nil
         ];
@@ -44,6 +45,7 @@
             addObserver:self selector:@selector(keyboardWillHide:)
             name:UIKeyboardWillHideNotification object:nil
         ];
+#endif
     }
     
     return self;
@@ -56,7 +58,7 @@
 #pragma mark - UIViewController methods
 
 - (void)keyboardDidShow:(NSNotification *)notification {
-    
+#if !TARGET_OS_TV 
     CGRect keyboardRectInWindow = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
     CGSize keyboardSize = [self.view convertRect:keyboardRectInWindow fromView:nil].size;
     UIEdgeInsets scrollInsets = self.scrollView.contentInset;
@@ -72,6 +74,7 @@
             break;
         }
     }
+#endif
 }
 
 - (void)keyboardWillHide:(NSNotification *)notification {

+ 2 - 0
Classes/ExplorerInterface/FLEXExplorerViewController.m

@@ -1105,7 +1105,9 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     // Restore the status bar window's normal window level.
     // We want it above FLEX while a modal is presented for
     // scroll to top, but below FLEX otherwise for exploration.
+#if !TARGET_OS_TV
     [self statusWindow].windowLevel = UIWindowLevelStatusBar;
+#endif
     
     [self updateButtonStates];
     

+ 7 - 4
Classes/Network/FLEXNetworkSettingsController.m

@@ -14,8 +14,11 @@
 #import "NSUserDefaults+FLEX.h"
 #import "fakes.h"
 
-
+#if !TARGET_OS_TV
 @interface FLEXNetworkSettingsController () <UIActionSheetDelegate>
+#else
+@interface FLEXNetworkSettingsController ()
+#endif
 @property (nonatomic) float cacheLimitValue;
 @property (nonatomic, readonly) NSString *cacheLimitCellTitle;
 #if !TARGET_OS_TV
@@ -101,15 +104,15 @@
 
 #pragma mark - Settings Actions
 
-- (void)networkDebuggingToggled:(UISwitch *)sender {
+- (void)networkDebuggingToggled:(UIFakeSwitch *)sender {
     FLEXNetworkObserver.enabled = sender.isOn;
 }
 
-- (void)cacheMediaResponsesToggled:(UISwitch *)sender {
+- (void)cacheMediaResponsesToggled:(UIFakeSwitch*)sender {
     FLEXNetworkRecorder.defaultRecorder.shouldCacheMediaResponses = sender.isOn;
 }
 
-- (void)jsonViewerSettingToggled:(UISwitch *)sender {
+- (void)jsonViewerSettingToggled:(UIFakeSwitch *)sender {
     [NSUserDefaults.standardUserDefaults flex_toggleBoolForKey:kFLEXDefaultsRegisterJSONExplorerKey];
 }
 

+ 2 - 2
Classes/Utility/FLEXUtility.m

@@ -262,13 +262,12 @@ BOOL FLEXConstructorsShouldRun() {
 + (UIInterfaceOrientationMask)infoPlistSupportedInterfaceOrientationsMask {
 #else
 + (NSUInteger)infoPlistSupportedInterfaceOrientationsMask {
+return 0;
 #endif
     NSArray<NSString *> *supportedOrientations = NSBundle.mainBundle.infoDictionary[@"UISupportedInterfaceOrientations"];
     #if !TARGET_OS_TV
     UIInterfaceOrientationMask supportedOrientationsMask = 0;
-    #else
     NSUInteger supportedOrientationsMask = 0;
-    #endif
     if ([supportedOrientations containsObject:@"UIInterfaceOrientationPortrait"]) {
         supportedOrientationsMask |= UIInterfaceOrientationMaskPortrait;
     }
@@ -282,6 +281,7 @@ BOOL FLEXConstructorsShouldRun() {
         supportedOrientationsMask |= UIInterfaceOrientationMaskLandscapeLeft;
     }
     return supportedOrientationsMask;
+#endif
 }
 
 + (UIImage *)thumbnailedImageWithMaxPixelDimension:(NSInteger)dimension fromImageData:(NSData *)data {

+ 1 - 13
README.md

@@ -15,20 +15,8 @@
 ### Missing features
 - Snapshot view (i dont think this one is going to make it in)
 
-
 ### Patch notes
-
-Patching MIGHT no longer be necessary, its the only remaning work left for me to be satisified with tvOS support for the time being.
-
-If anything does need patching it might be to get the UIWebView stuff working, it may even be a good idea to ditch it for the time being because its not working for some odd reason.
-
-```
-## 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
-```
+- You should no longer have to patch your SDK to build this for tvOS!!
 
 ![tvOS Demo](view_selection.gif "tvOS Selection")
 

+ 1 - 1
postScript.sh

@@ -37,7 +37,7 @@ pushd "$SRCROOT"
 find . -name ".DS_Store" | xargs rm -f
 
 EXE_PATH=$FINAL_FW_PATH/$EXECUTABLE_NAME
-
+exit 0
 ldid -S $EXE_PATH
 rm -rf $FINAL_FW_PATH/_CodeSignature
 /usr/local/bin/fakeroot dpkg-deb -b layout