Skip to content

Commit

Permalink
upgrade to SwiftJson 5.0 , Charts 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wuxudong committed Apr 16, 2019
1 parent 4f80038 commit 20e93db
Show file tree
Hide file tree
Showing 12 changed files with 169 additions and 1,617 deletions.
9 changes: 5 additions & 4 deletions Example/ios/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -308,7 +309,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "Example-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
Expand Down Expand Up @@ -339,7 +340,7 @@
PRODUCT_NAME = Example;
SWIFT_OBJC_BRIDGING_HEADER = "Example-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
Expand Down Expand Up @@ -386,7 +387,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -424,7 +425,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down
14 changes: 1 addition & 13 deletions Example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,4 @@ target 'Example' do
pod 'RNCharts', :path => '../../'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

end

swift4 = ['Charts']

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if swift4.include?(target.name)
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end
end
1,733 changes: 149 additions & 1,584 deletions Example/yarn.lock

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions RNCharts.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ Pod::Spec.new do |s|
s.source_files = "ios/ReactNativeCharts/**/*.{h,m,swift}"
s.static_framework = true

s.swift_version= '4.2'

s.dependency 'React'
s.dependency 'SwiftyJSON'
s.dependency 'Charts', '3.2.2'
s.dependency 'SwiftyJSON', '5.0'
s.dependency 'Charts', '3.3'


end
2 changes: 1 addition & 1 deletion ios/ReactNativeCharts/bar/BarDataExtract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class BarDataExtract : DataExtract {
}

override open func createDataSet(_ entries: [ChartDataEntry]?, label: String?) -> IChartDataSet {
return BarChartDataSet(values: entries, label: label)
return BarChartDataSet(entries: entries, label: label)
}

override open func dataSetConfig(_ dataSet: IChartDataSet, config: JSON) {
Expand Down
2 changes: 1 addition & 1 deletion ios/ReactNativeCharts/bubble/BubbleDataExtract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BubbleDataExtract : DataExtract {
}

override func createDataSet(_ entries: [ChartDataEntry]?, label: String?) -> IChartDataSet {
return BubbleChartDataSet(values: entries, label: label)
return BubbleChartDataSet(entries: entries, label: label)
}

override func dataSetConfig(_ dataSet: IChartDataSet, config: JSON) {
Expand Down
2 changes: 1 addition & 1 deletion ios/ReactNativeCharts/candlestick/CandleDataExtract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CandleDataExtract : DataExtract {
}

override func createDataSet(_ entries: [ChartDataEntry]?, label: String?) -> IChartDataSet {
return CandleChartDataSet(values: entries, label: label)
return CandleChartDataSet(entries: entries, label: label)
}

override func dataSetConfig(_ dataSet: IChartDataSet, config: JSON) {
Expand Down
2 changes: 1 addition & 1 deletion ios/ReactNativeCharts/line/LineDataExtract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class LineDataExtract : DataExtract {
}

override func createDataSet(_ entries: [ChartDataEntry]?, label: String?) -> IChartDataSet {
return LineChartDataSet(values: entries, label: label)
return LineChartDataSet(entries: entries, label: label)
}

override func dataSetConfig(_ dataSet: IChartDataSet, config: JSON) {
Expand Down
2 changes: 1 addition & 1 deletion ios/ReactNativeCharts/pie/PieDataExtract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PieDataExtract : DataExtract {
}

override func createDataSet(_ entries: [ChartDataEntry]?, label: String?) -> IChartDataSet {
return PieChartDataSet(values: entries, label: label)
return PieChartDataSet(entries: entries, label: label)
}

override func dataSetConfig(_ dataSet: IChartDataSet, config: JSON) {
Expand Down
2 changes: 1 addition & 1 deletion ios/ReactNativeCharts/radar/RadarDataExtract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RadarDataExtract : DataExtract {
}

override func createDataSet(_ entries: [ChartDataEntry]?, label: String?) -> IChartDataSet {
return RadarChartDataSet(values : entries, label: label)
return RadarChartDataSet(entries : entries, label: label)
}

override func dataSetConfig(_ dataSet: IChartDataSet, config: JSON) {
Expand Down
2 changes: 1 addition & 1 deletion ios/ReactNativeCharts/scatter/ScatterDataExtract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ScatterDataExtract : DataExtract {
}

override func createDataSet(_ entries: [ChartDataEntry]?, label: String?) -> IChartDataSet {
return ScatterChartDataSet(values: entries, label: label)
return ScatterChartDataSet(entries: entries, label: label)
}

override func dataSetConfig(_ dataSet: IChartDataSet, config: JSON) {
Expand Down
10 changes: 5 additions & 5 deletions ios/ReactNativeCharts/utils/BridgeUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,15 @@ class BridgeUtils {
// NSLog("this label position %@", iosEnumString)
switch iosEnumString {
case "rightBottom":
return .rightBottom
return .bottomRight
case "leftBottom":
return .leftBottom
return .bottomLeft
case "rightTop":
return .rightTop
return .topRight
case "leftTop":
return .leftTop
return .topLeft
default:
return .rightTop
return .topRight
}
}
}

0 comments on commit 20e93db

Please sign in to comment.