Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Make iOS 9 compatible again. #874

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FlipperKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |spec|
spec.source = { :git => 'https://github.com/facebook/Sonar.git',
:tag=> "v"+flipperkit_version }
spec.module_name = 'FlipperKit'
spec.platforms = { :ios => "10.0" }
spec.platforms = { :ios => "9.0" }
spec.default_subspecs = "Core"

# This subspec is necessary since FBDefines.h is imported as <FBDefines/FBDefines.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,12 @@ - (NSArray*)validChildrenForNode:(UIView*)node {
nil];
}

- (NSDictionary<NSString*, SKNodeUpdateData>*)dataMutationsForNode:
(UIView*)node {
return @{
- (NSDictionary<NSString*, SKNodeUpdateData>*)dataMutationsForNode:(UIView*)node {
NSDictionary<NSString*, SKNodeUpdateData> *dataMutations = @{
// UIView
@"UIView.alpha" : ^(NSNumber* value){
node.alpha = [value floatValue];
}
,
},
@"UIView.backgroundColor": ^(NSNumber *value) {
node.backgroundColor = [UIColor fromSonarValue: value];
},
Expand Down Expand Up @@ -452,17 +450,21 @@ - (NSArray*)validChildrenForNode:(UIView*)node {
@"Accessibility.accessibilityTraits.UIAccessibilityTraitCausesPageTurn": ^(NSNumber *value) {
node.accessibilityTraits = AccessibilityTraitsToggle(node.accessibilityTraits, UIAccessibilityTraitCausesPageTurn, [value boolValue]);
},
@"Accessibility.accessibilityTraits.UIAccessibilityTraitTabBar": ^(NSNumber *value) {
node.accessibilityTraits = AccessibilityTraitsToggle(node.accessibilityTraits, UIAccessibilityTraitTabBar, [value boolValue]);
},
@"Accessibility.accessibilityViewIsModal": ^(NSNumber *value) {
node.accessibilityViewIsModal = [value boolValue];
},
@"Accessibility.shouldGroupAccessibilityChildren": ^(NSNumber *value) {
node.shouldGroupAccessibilityChildren = [value boolValue];
},
}
;
};
if (@available(iOS 10.0, *)) {
NSMutableDictionary<NSString*, SKNodeUpdateData> *latestDataMutations = [dataMutations mutableCopy];
latestDataMutations[@"Accessibility.accessibilityTraits.UIAccessibilityTraitTabBar"] = ^(NSNumber *value) {
node.accessibilityTraits = AccessibilityTraitsToggle(node.accessibilityTraits, UIAccessibilityTraitTabBar, [value boolValue]);
};
dataMutations = latestDataMutations;
}
return dataMutations;
}

- (NSArray<SKNamed<NSString*>*>*)attributesForNode:(UIView*)node {
Expand Down
2 changes: 1 addition & 1 deletion iOS/Sample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://github.com/facebook/Sonar.git'
source 'https://github.com/CocoaPods/Specs'

target 'Sample' do
platform :ios, '10.0'
platform :ios, '9.0'
pod 'FlipperKit', :path => '../../FlipperKit.podspec'
pod 'FlipperKit/FlipperKitLayoutComponentKitSupport', :path => '../../FlipperKit.podspec'
pod 'FlipperKit/SKIOSNetworkPlugin', :path => '../../FlipperKit.podspec'
Expand Down