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
f22face7
Commit
f22face7
authored
Mar 09, 2018
by
Martin Jurenka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ShouldOpen and ShouldClose delegate methods to FABMenuDelegate
parent
904324b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
Sources/iOS/FABMenu.swift
+23
-0
No files found.
Sources/iOS/FABMenu.swift
View file @
f22face7
...
...
@@ -139,6 +139,14 @@ extension FABMenuItem {
@objc(FABMenuDelegate)
public
protocol
FABMenuDelegate
{
/**
A delegation method that is executed to determine whether fabMenu should open.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuShouldOpen
(
fabMenu
:
FABMenu
)
->
Bool
/**
A delegation method that is execited when the fabMenu will open.
- Parameter fabMenu: A FABMenu.
...
...
@@ -154,6 +162,13 @@ public protocol FABMenuDelegate {
optional
func
fabMenuDidOpen
(
fabMenu
:
FABMenu
)
/**
A delegation method that is executed to determine whether fabMenu should close.
- Parameter fabMenu: A FABMenu.
*/
@objc
optional
func
fabMenuShouldClose
(
fabMenu
:
FABMenu
)
->
Bool
/**
A delegation method that is execited when the fabMenu will close.
- Parameter fabMenu: A FABMenu.
*/
...
...
@@ -358,6 +373,10 @@ extension FABMenu {
- Parameter completion: A completion block to execute on each view's animation.
*/
open
func
open
(
isTriggeredByUserInteraction
:
Bool
,
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
if
delegate
?
.
fabMenuShouldOpen
?(
fabMenu
:
self
)
==
false
{
return
}
handleOpenCallback
?()
if
isTriggeredByUserInteraction
{
...
...
@@ -407,6 +426,10 @@ extension FABMenu {
- Parameter completion: A completion block to execute on each view's animation.
*/
open
func
close
(
isTriggeredByUserInteraction
:
Bool
,
duration
:
TimeInterval
=
0.15
,
delay
:
TimeInterval
=
0
,
usingSpringWithDamping
:
CGFloat
=
0.5
,
initialSpringVelocity
:
CGFloat
=
0
,
options
:
UIViewAnimationOptions
=
[],
animations
:
((
UIView
)
->
Void
)?
=
nil
,
completion
:
((
UIView
)
->
Void
)?
=
nil
)
{
if
delegate
?
.
fabMenuShouldClose
?(
fabMenu
:
self
)
==
false
{
return
}
handleCloseCallback
?()
if
isTriggeredByUserInteraction
{
...
...
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