Commit 350c1505 by Dmitriy Stepanets

Fixed all High priority issues

parent 05fc4043
......@@ -13,5 +13,5 @@ struct DefaultSettingsImperial: DefaultSettings {
let pressureType: UnitPressure = .inchesOfMercury
let distanceType: UnitLength = .miles
let pinnedLayerIds: [String] = []
let selectedLayerId: String = WeatherLayerType.radar.rawValue
let selectedLayerId: String = WeatherLayerType.surfaceTemp.rawValue
}
......@@ -13,5 +13,5 @@ struct DefaultSettingsMetric: DefaultSettings {
let pressureType: UnitPressure = .millimetersOfMercury
let distanceType: UnitLength = .kilometers
let pinnedLayerIds: [String] = []
let selectedLayerId: String = WeatherLayerType.radar.rawValue
let selectedLayerId: String = WeatherLayerType.surfaceTemp.rawValue
}
......@@ -20,11 +20,11 @@ class MapLayersPresentationAnimator: NSObject, UIViewControllerAnimatedTransitio
toViewController.view.frame = .init(x: container.bounds.width,
y: 0,
width: 220,
width: container.frame.width,//220,
height: container.frame.height)
container.addSubview(toViewController.view)
UIView.animate(withDuration: transitionDuration(using: transitionContext)) {
toViewController.view.frame.origin.x = container.frame.width - 220
toViewController.view.frame.origin.x = 0//container.frame.width - 220
} completion: { finished in
transitionContext.completeTransition(finished)
}
......
......@@ -11,6 +11,7 @@ class RadarMapLayersController: UIViewController {
//Private
private let radarViewModel:RadarViewModel
private let cellFactory:RadarLayersCellFactory
private let tapView = UIView()
private let tableView = UITableView(frame: .zero, style: .grouped)
init(radarViewModel:RadarViewModel) {
......@@ -31,6 +32,7 @@ class RadarMapLayersController: UIViewController {
prepareController()
prepareTableView()
prepareTapView()
}
override func viewDidLayoutSubviews() {
......@@ -41,17 +43,17 @@ class RadarMapLayersController: UIViewController {
@objc private func handleCloseButton() {
self.dismiss(animated: true)
}
@objc private func handleControllerTap() {
self.dismiss(animated: true)
}
}
//MARK:- Prepare
private extension RadarMapLayersController {
func prepareController() {
view.clipsToBounds = false
view.backgroundColor = .black
view.layer.shadowColor = UIColor.black.withAlphaComponent(0.12).cgColor
view.layer.shadowRadius = 8
view.layer.shadowOffset = .init(width: 0, height: 3)
view.layer.shadowOpacity = 1
view.backgroundColor = .clear
}
func prepareTableView() {
......@@ -63,9 +65,27 @@ private extension RadarMapLayersController {
tableView.delegate = self
tableView.rowHeight = 46
tableView.tableFooterView = UIView()
tableView.layer.shadowColor = UIColor.black.withAlphaComponent(0.12).cgColor
tableView.layer.shadowRadius = 8
tableView.layer.shadowOffset = .init(width: 0, height: 3)
tableView.layer.shadowOpacity = 1
view.addSubview(tableView)
tableView.snp.makeConstraints { (make) in
make.edges.equalToSuperview()
make.top.right.bottom.equalToSuperview()
make.width.equalTo(220)
}
}
func prepareTapView() {
let tap = UITapGestureRecognizer(target: self, action: #selector(handleControllerTap))
tapView.addGestureRecognizer(tap)
tapView.isUserInteractionEnabled = true
tapView.backgroundColor = .clear
view.addSubview(tapView)
tapView.snp.makeConstraints { make in
make.top.left.bottom.equalToSuperview()
make.right.equalTo(tableView.snp.left)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment