Commit 6ae85375 by Shailesh Aher

[IOS-120]: Set default selected index from the data source to the weather forecast

parent 7ec461dc
...@@ -173,7 +173,7 @@ private extension ForecastViewController { ...@@ -173,7 +173,7 @@ private extension ForecastViewController {
func prepareTimePeriodControl() { func prepareTimePeriodControl() {
let container = UIView() let container = UIView()
container.addSubview(self.timePeriodControl) container.addSubview(self.timePeriodControl)
timePeriodControl.selectedSegmentIndex = 0 timePeriodControl.selectedSegmentIndex = forecastCellFactory.timePeriod.rawValue
timePeriodControl.addTarget(self, action: #selector(handleSegmentDidChange), for: .valueChanged) timePeriodControl.addTarget(self, action: #selector(handleSegmentDidChange), for: .valueChanged)
self.timePeriodControl.snp.makeConstraints { (make) in self.timePeriodControl.snp.makeConstraints { (make) in
......
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