Verified Commit 5f7d08a5 authored by asahiocean's avatar asahiocean 🚀
Browse files

Everything's Alright

parent 8b7493b5
......@@ -38,13 +38,14 @@ extension ViewController {
})
}
pinsKVO = mapView.model.observe(\.pins, options: .new, changeHandler: { obj, change in
pinsKVO = mapView.model.observe(\.pins, options: .new, changeHandler: { [self] obj, change in
guard let pins = change.newValue else { return }
//MARK: После добавления хотя бы 3 точек должны появляться кнопки
if pins.count > 2 {
buttonsAnimator(state: .show)
} else {
guard !mapView.model.graphsBuilt else { return }
buttonsAnimator(state: .hide)
}
})
......
......@@ -31,8 +31,11 @@ protocol ModelDelegate: class {
selectedPinsKVO = observe(\.selected, options: .new, changeHandler: { [self] model, change in
guard let newValue = change.newValue else { return }
if newValue != nil {
guard mainButton?.tag == Model.buttonTag.start.rawValue ||
mainButton?.tag == Model.buttonTag.finish.rawValue else { return }
mainButton?.setTitle("OK", for: .normal)
} else {
guard mainButton?.tag != Model.buttonTag.routecalc.rawValue else { return }
mainButton?.setTitle(mainButtonTitle, for: .normal)
}
})
......
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