Преглед изворни кода

trying to remove the different patches necessary to build this

Kevin Bradley пре 5 година
родитељ
комит
9bfe4d99e4

+ 4 - 0
Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontsPickerView.h

@@ -8,5 +8,9 @@
 
 #import "FLEXArgumentInputTextView.h"
 
+#if TARGET_OS_TV
+@interface FLEXArgumentInputFontsPickerView : FLEXArgumentInputTextView 
+#else
 @interface FLEXArgumentInputFontsPickerView : FLEXArgumentInputTextView <UIPickerViewDataSource, UIPickerViewDelegate>
+#endif
 @end

+ 14 - 8
Classes/Editing/ArgumentInputViews/FLEXArgumentInputFontsPickerView.m

@@ -44,7 +44,9 @@
     if ([self.availableFonts indexOfObject:inputValue] == NSNotFound) {
         [self.availableFonts insertObject:inputValue atIndex:0];
     }
+#if !TARGET_OS_TV
     [(UIPickerView *)self.inputTextView.inputView selectRow:[self.availableFonts indexOfObject:inputValue] inComponent:0 animated:NO];
+#endif
 }
 
 - (id)inputValue {
@@ -53,14 +55,6 @@
 
 #pragma mark - private
 
-- (UIPickerView*)createFontsPicker {
-    UIPickerView *fontsPicker = [UIPickerView new];
-    fontsPicker.dataSource = self;
-    fontsPicker.delegate = self;
-    fontsPicker.showsSelectionIndicator = YES;
-    return fontsPicker;
-}
-
 - (void)createAvailableFonts {
     NSMutableArray<NSString *> *unsortedFontsArray = [NSMutableArray new];
     for (NSString *eachFontFamily in UIFont.familyNames) {
@@ -71,6 +65,16 @@
     self.availableFonts = [NSMutableArray arrayWithArray:[unsortedFontsArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]];
 }
 
+#if !TARGET_OS_TV
+
+- (UIPickerView*)createFontsPicker {
+    UIPickerView *fontsPicker = [UIPickerView new];
+    fontsPicker.dataSource = self;
+    fontsPicker.delegate = self;
+    fontsPicker.showsSelectionIndicator = YES;
+    return fontsPicker;
+}
+
 #pragma mark - UIPickerViewDataSource
 
 - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
@@ -104,4 +108,6 @@
     self.inputTextView.text = self.availableFonts[row];
 }
 
+#endif
+
 @end

+ 11 - 0
Classes/Utility/FLEXColor.m

@@ -8,6 +8,17 @@
 
 #import "FLEXColor.h"
 #import "FLEXUtility.h"
+#import <UIKit/UIInterface.h>
+
+/**
+ 
+ A note about tvOS Support: i tried to briefly undefine the API_UNAVAILABLE macro in an attempt to avoid the need to patch the SDK to get this working, this properties are actually available
+ on tvOS and if we don't use them the UI gets comlpetely out of whack.
+ 
+ */
+
+#undef API_UNAVAILABLE
+#define API_UNAVAILABLE(...) API_AVAILABLE(...)
 
 #if FLEX_AT_LEAST_IOS13_SDK
 #define FLEXDynamicColor(dynamic, static) ({ \

+ 0 - 1
README.md

@@ -25,7 +25,6 @@ There may be additional classes this needs to be done with, these notes are impr
 
 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

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


+ 4 - 0
layout/Library/Frameworks/FLEX.framework/PrivateHeaders/FLEXArgumentInputFontsPickerView.h

@@ -8,5 +8,9 @@
 
 #import "FLEXArgumentInputTextView.h"
 
+#if TARGET_OS_TV
+@interface FLEXArgumentInputFontsPickerView : FLEXArgumentInputTextView 
+#else
 @interface FLEXArgumentInputFontsPickerView : FLEXArgumentInputTextView <UIPickerViewDataSource, UIPickerViewDelegate>
+#endif
 @end