Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
a675ae4f
Unverified
Commit
a675ae4f
authored
Sep 09, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: updated completion block for open/close in MenuController
parent
bb5ba02b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
Sources/iOS/MenuController.swift
+17
-8
No files found.
Sources/iOS/MenuController.swift
View file @
a675ae4f
...
...
@@ -58,18 +58,21 @@ open class MenuController: RootController {
- Parameter completion: An Optional callback that is executed when
all menu items have been opened.
*/
open
func
openMenu
(
completion
:
(()
->
Void
)?
=
nil
)
{
open
func
openMenu
(
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
if
true
==
isUserInteractionEnabled
{
isUserInteractionEnabled
=
false
rootViewController
.
view
.
alpha
=
0.5
UIView
.
animate
(
withDuration
:
0.15
,
animations
:
{
[
weak
self
]
in
guard
let
s
=
self
else
{
return
}
s
.
rootViewController
.
view
.
alpha
=
0.25
})
menu
.
open
{
[
weak
self
]
(
view
)
in
guard
let
s
=
self
else
{
return
}
if
view
==
s
.
menu
.
views
.
last
{
completion
?()
}
completion
?(
view
)
}
}
}
...
...
@@ -79,17 +82,23 @@ open class MenuController: RootController {
- Parameter completion: An Optional callback that is executed when
all menu items have been closed.
*/
open
func
closeMenu
(
completion
:
(()
->
Void
)?
=
nil
)
{
open
func
closeMenu
(
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
if
false
==
isUserInteractionEnabled
{
rootViewController
.
view
.
alpha
=
1
UIView
.
animate
(
withDuration
:
0.15
,
animations
:
{
[
weak
self
]
in
guard
let
s
=
self
else
{
return
}
s
.
rootViewController
.
view
.
alpha
=
1
})
menu
.
close
{
[
weak
self
]
(
view
)
in
guard
let
s
=
self
else
{
return
}
completion
?(
view
)
if
view
==
s
.
menu
.
views
.
last
{
s
.
isUserInteractionEnabled
=
true
completion
?()
}
}
}
...
...
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