Chart fixes

This commit is contained in:
Ilya Laktyushin
2020-03-25 22:35:26 +04:00
parent d774ecc5d5
commit b9b5cb1b73
17 changed files with 44 additions and 38 deletions

View File

@@ -8,6 +8,7 @@
import UIKit
import GraphCore
import Display
private enum Constants {
static let chartViewHeightFraction: CGFloat = 0.55
@@ -36,6 +37,8 @@ class ChartStackSection: UIView, ChartThemeContainer {
var displayRange: Bool = true
let hapticFeedback = HapticFeedback()
init() {
sectionContainerView = UIView()
chartView = ChartView()
@@ -188,8 +191,11 @@ class ChartStackSection: UIView, ChartThemeContainer {
controller.chartFrame = { [unowned self] in
return self.chartView.chartFrame
}
controller.setDetailsViewModel = { [unowned self] viewModel, animated in
controller.setDetailsViewModel = { [unowned self] viewModel, animated, feedback in
self.chartView.setDetailsViewModel(viewModel: viewModel, animated: animated)
if feedback {
self.hapticFeedback.tap()
}
}
controller.setDetailsChartVisibleClosure = { [unowned self] visible, animated in
self.chartView.setDetailsChartVisible(visible, animated: animated)