Commit edb1d483 by Demid Merzlyakov

Forecast: hide UV. Better spacing.

parent 5fc20747
...@@ -56,7 +56,7 @@ class ForecastInfoCell: UITableViewCell { ...@@ -56,7 +56,7 @@ class ForecastInfoCell: UITableViewCell {
//Conditions //Conditions
conditionsStackView.removeAll() conditionsStackView.removeAll()
let availableConditions:[WeatherConditionType] = [.precipitation, .uvIndex, .wind] let availableConditions:[WeatherConditionType] = [.precipitation, .wind]
let rowsCount = (CGFloat(WeatherConditionType.allCases.count) / 3).rounded(.up) let rowsCount = (CGFloat(WeatherConditionType.allCases.count) / 3).rounded(.up)
var currentRow = -1 var currentRow = -1
var currentConditionsRowStackView = UIStackView() var currentConditionsRowStackView = UIStackView()
...@@ -64,11 +64,11 @@ class ForecastInfoCell: UITableViewCell { ...@@ -64,11 +64,11 @@ class ForecastInfoCell: UITableViewCell {
for (index, type) in availableConditions.enumerated() { for (index, type) in availableConditions.enumerated() {
if currentRow != index / Int(rowsCount) { if currentRow != index / Int(rowsCount) {
currentConditionsRowStackView = UIStackView() currentConditionsRowStackView = UIStackView()
currentConditionsRowStackView.spacing = 20
currentConditionsRowStackView.axis = .horizontal currentConditionsRowStackView.axis = .horizontal
currentConditionsRowStackView.distribution = .equalSpacing currentConditionsRowStackView.distribution = .fillEqually
conditionsStackView.addArrangedSubview(currentConditionsRowStackView) conditionsStackView.addArrangedSubview(currentConditionsRowStackView)
} }
let conditionView = ForecastConditionView(type: type) let conditionView = ForecastConditionView(type: type)
conditionView.configure(dailyWeather: dailyWeather) conditionView.configure(dailyWeather: dailyWeather)
currentConditionsRowStackView.addArrangedSubview(conditionView) currentConditionsRowStackView.addArrangedSubview(conditionView)
......
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