Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
asahiocean
SZRCAI
Commits
5f7d08a5
Verified
Commit
5f7d08a5
authored
Mar 10, 2021
by
asahiocean
🚀
Browse files
Everything's Alright
parent
8b7493b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
SZRCAI/SZRCAI/Main code/Controllers/ViewController/Extensions/buttonsSetup+ViewController.swift
View file @
5f7d08a5
...
...
@@ -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
)
}
})
...
...
SZRCAI/SZRCAI/Main code/Model/Model.swift
View file @
5f7d08a5
...
...
@@ -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
)
}
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment