Skip to content

Commit

Permalink
chore: Charts downgrade (4.0.0 -> 3.6.0) (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
betterhee committed Nov 20, 2021
1 parent 753da1d commit 1fe5d1c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 33 deletions.
26 changes: 17 additions & 9 deletions Coins.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
5DD4667C274509F500D1B730 /* HistoricalCoin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD4667B274509F400D1B730 /* HistoricalCoin.swift */; };
5DD4667E27450C8700D1B730 /* HistoricalCoinRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD4667D27450C8700D1B730 /* HistoricalCoinRequest.swift */; };
5DD466822745338800D1B730 /* Duration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DD466812745338800D1B730 /* Duration.swift */; };
5DD466852745BF6F00D1B730 /* Charts in Frameworks */ = {isa = PBXBuildFile; productRef = 5DD466842745BF6F00D1B730 /* Charts */; };
5DD466992745C75800D1B730 /* GraphikRegularItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD4668F2745C73D00D1B730 /* GraphikRegularItalic.otf */; };
5DD4669A2745C75800D1B730 /* GraphikSemiboldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD4668A2745C73D00D1B730 /* GraphikSemiboldItalic.otf */; };
5DD4669F2745C75800D1B730 /* GraphikSemibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD4668C2745C73D00D1B730 /* GraphikSemibold.otf */; };
5DD466AA2745C75800D1B730 /* GraphikRegular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD466902745C73E00D1B730 /* GraphikRegular.otf */; };
5DD466AD2745C91F00D1B730 /* GraphikMediumItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD466AB2745C91F00D1B730 /* GraphikMediumItalic.otf */; };
5DD466AE2745C91F00D1B730 /* GraphikMedium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5DD466AC2745C91F00D1B730 /* GraphikMedium.otf */; };
5DD466B4274660A400D1B730 /* Charts in Frameworks */ = {isa = PBXBuildFile; productRef = 5DD466B3274660A400D1B730 /* Charts */; };
5DF277012743841F003C434B /* CoinsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DF277002743841F003C434B /* CoinsViewModel.swift */; };
5DF27703274384CF003C434B /* CoinViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DF27702274384CF003C434B /* CoinViewModel.swift */; };
5DF27707274385D0003C434B /* CoinCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DF27706274385D0003C434B /* CoinCell.swift */; };
Expand Down Expand Up @@ -86,7 +86,7 @@
buildActionMask = 2147483647;
files = (
5DF2770A27439402003C434B /* Kingfisher in Frameworks */,
5DD466852745BF6F00D1B730 /* Charts in Frameworks */,
5DD466B4274660A400D1B730 /* Charts in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -98,6 +98,7 @@
children = (
5DBF02102741FA9B00FE6C1D /* Coins */,
5DBF020F2741FA9B00FE6C1D /* Products */,
5DD466B12746603200D1B730 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -237,6 +238,13 @@
path = fonts;
sourceTree = "<group>";
};
5DD466B12746603200D1B730 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -255,7 +263,7 @@
name = Coins;
packageProductDependencies = (
5DF2770927439402003C434B /* Kingfisher */,
5DD466842745BF6F00D1B730 /* Charts */,
5DD466B3274660A400D1B730 /* Charts */,
);
productName = Coins;
productReference = 5DBF020E2741FA9B00FE6C1D /* Coins.app */;
Expand Down Expand Up @@ -287,7 +295,7 @@
mainGroup = 5DBF02052741FA9B00FE6C1D;
packageReferences = (
5DF2770827439402003C434B /* XCRemoteSwiftPackageReference "Kingfisher" */,
5DD466832745BF6F00D1B730 /* XCRemoteSwiftPackageReference "Charts" */,
5DD466B2274660A400D1B730 /* XCRemoteSwiftPackageReference "Charts" */,
);
productRefGroup = 5DBF020F2741FA9B00FE6C1D /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -566,12 +574,12 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
5DD466832745BF6F00D1B730 /* XCRemoteSwiftPackageReference "Charts" */ = {
5DD466B2274660A400D1B730 /* XCRemoteSwiftPackageReference "Charts" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/danielgindi/Charts.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.0.0;
kind = exactVersion;
version = 3.6.0;
};
};
5DF2770827439402003C434B /* XCRemoteSwiftPackageReference "Kingfisher" */ = {
Expand All @@ -585,9 +593,9 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
5DD466842745BF6F00D1B730 /* Charts */ = {
5DD466B3274660A400D1B730 /* Charts */ = {
isa = XCSwiftPackageProductDependency;
package = 5DD466832745BF6F00D1B730 /* XCRemoteSwiftPackageReference "Charts" */;
package = 5DD466B2274660A400D1B730 /* XCRemoteSwiftPackageReference "Charts" */;
productName = Charts;
};
5DF2770927439402003C434B /* Kingfisher */ = {
Expand Down
33 changes: 14 additions & 19 deletions Coins/Storyboards/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19162" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="oKt-f7-5rF">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="oKt-f7-5rF">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="Stack View standard spacing" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -209,7 +209,7 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="R8t-5y-VfS">
<rect key="frame" x="16" y="156" width="382" height="641"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="252" axis="vertical" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="Rw3-58-Ejj">
<stackView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" axis="vertical" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="Rw3-58-Ejj">
<rect key="frame" x="0.0" y="0.0" width="382" height="48"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="BTC" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iem-I2-Cbe">
Expand All @@ -226,15 +226,12 @@
</label>
</subviews>
</stackView>
<view contentMode="scaleToFill" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ghV-fW-w2x" customClass="LineChartView" customModule="Charts">
<rect key="frame" x="0.0" y="56" width="382" height="300"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ghV-fW-w2x" customClass="LineChartView" customModule="Charts">
<rect key="frame" x="0.0" y="56" width="382" height="546"/>
<color key="backgroundColor" systemColor="systemGroupedBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="300" id="HI9-2R-1Tc"/>
</constraints>
</view>
<segmentedControl opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="252" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="Io6-j6-74X">
<rect key="frame" x="0.0" y="364" width="382" height="32"/>
<segmentedControl opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="Io6-j6-74X">
<rect key="frame" x="0.0" y="610" width="382" height="32"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<segments>
<segment title="1D"/>
Expand All @@ -244,10 +241,6 @@
<action selector="durationSegmentedControlDidTap:" destination="dcD-N1-n1g" eventType="valueChanged" id="96O-7i-yD4"/>
</connections>
</segmentedControl>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1Aa-ss-KNz">
<rect key="frame" x="0.0" y="403" width="382" height="238"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</subviews>
</stackView>
</subviews>
Expand Down Expand Up @@ -279,7 +272,6 @@
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="SSo-Bn-mLk">
<rect key="frame" x="0.0" y="0.0" width="414" height="49"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tabBar>
<connections>
<segue destination="amf-hq-xXz" kind="relationship" relationship="viewControllers" id="2vg-uB-diQ"/>
Expand All @@ -290,11 +282,11 @@
</objects>
<point key="canvasLocation" x="-1667" y="-34"/>
</scene>
<!--Article-->
<!--Articles-->
<scene sceneID="7ca-Vw-lEC">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="WBL-5u-VTe" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Article" image="newspaper.fill" catalog="system" id="yV2-3b-8Yd"/>
<tabBarItem key="tabBarItem" title="Articles" image="newspaper.fill" catalog="system" id="yV2-3b-8Yd"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" largeTitles="YES" id="D3H-B2-HYp">
<rect key="frame" x="0.0" y="44" width="414" height="96"/>
Expand All @@ -309,17 +301,20 @@
</objects>
<point key="canvasLocation" x="-777" y="340"/>
</scene>
<!--Chart-->
<!--Coins-->
<scene sceneID="JQQ-Re-Vpg">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="amf-hq-xXz" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Chart" image="chart.bar.xaxis" catalog="system" id="NQi-NG-6Ec"/>
<tabBarItem key="tabBarItem" title="Coins" image="chart.bar.xaxis" catalog="system" id="NQi-NG-6Ec"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" largeTitles="YES" id="JeE-Uh-tyV">
<rect key="frame" x="0.0" y="44" width="414" height="96"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<toolbar key="toolbar" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="9jh-Mn-e6v">
<autoresizingMask key="autoresizingMask"/>
</toolbar>
<connections>
<segue destination="Y6k-bb-dcc" kind="relationship" relationship="rootViewController" id="wet-Fi-ncJ"/>
</connections>
Expand Down
8 changes: 8 additions & 0 deletions Coins/View Controllers/CoinsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ final class CoinsViewController: UIViewController {
})
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

if let selectedIndexPath = tableView.indexPathForSelectedRow {
tableView.deselectRow(at: selectedIndexPath, animated: false)
}
}

// MARK: - Navigation

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
Expand Down
7 changes: 2 additions & 5 deletions Coins/View Controllers/HistoricalCoinViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit
import Charts
import SwiftUI

final class HistoricalCoinViewController: UIViewController {

Expand Down Expand Up @@ -46,7 +47,7 @@ final class HistoricalCoinViewController: UIViewController {
let gradientColor = [startColor.cgColor, endColor.cgColor] as CFArray
let colorLocations: [CGFloat] = [1.0, 0.0]
let gradient = CGGradient.init(colorsSpace: CGColorSpaceCreateDeviceRGB(), colors: gradientColor, locations: colorLocations)
dataSet.fill = RadialGradientFill(gradient: gradient!)
dataSet.fill = Fill.fillWithRadialGradient(gradient!)
dataSet.drawFilledEnabled = true

let data = LineChartData(dataSet: dataSet)
Expand Down Expand Up @@ -112,8 +113,4 @@ extension HistoricalCoinViewController: ChartViewDelegate {
viewModel.selectChartValue(entry.y)
}

func chartValueNothingSelected(_ chartView: ChartViewBase) {
print(#function)
}

}

0 comments on commit 1fe5d1c

Please sign in to comment.