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
95f2657b
Commit
95f2657b
authored
Jan 28, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated leftViewThreshold
parent
b5414c6b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Sources/SideNavigationViewController.swift
+6
-6
No files found.
Sources/SideNavigationViewController.swift
View file @
95f2657b
...
...
@@ -290,7 +290,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
v
.
width
=
self
.
leftViewWidth
v
.
height
=
self
.
view
.
bounds
.
height
}
horizontal
Threshold
=
leftViewWidth
/
2
leftView
Threshold
=
leftViewWidth
/
2
leftViewController
?
.
view
.
frame
.
size
.
width
=
v
.
width
leftViewController
?
.
view
.
frame
.
size
.
height
=
v
.
height
leftViewController
?
.
view
.
center
=
CGPointMake
(
v
.
width
/
2
,
v
.
height
/
2
)
...
...
@@ -512,7 +512,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
public
func
gestureRecognizer
(
gestureRecognizer
:
UIGestureRecognizer
,
shouldReceiveTouch
touch
:
UITouch
)
->
Bool
{
if
enabled
{
if
gestureRecognizer
==
panGesture
{
return
enabled
&&
isPointContainedWithinLeftThreshold
(
touch
.
locationInView
(
view
))
return
enabled
&&
isPointContainedWithinLeft
View
Threshold
(
touch
.
locationInView
(
view
))
}
if
opened
&&
gestureRecognizer
==
tapGesture
{
let
point
:
CGPoint
=
touch
.
locationInView
(
view
)
...
...
@@ -551,7 +551,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
delegate
?
.
sideNavigationViewPanDidEnd
?(
self
,
point
:
leftView
!.
position
)
if
leftView
!.
x
<=
CGFloat
(
floor
(
-
leftViewWidth
))
+
horizontal
Threshold
||
point
.
x
<=
-
1000
{
if
leftView
!.
x
<=
CGFloat
(
floor
(
-
leftViewWidth
))
+
leftView
Threshold
||
point
.
x
<=
-
1000
{
closeLeftView
(
x
)
}
else
{
openLeftView
(
x
)
...
...
@@ -713,15 +713,15 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
/**
A method that determines whether the passed point is
contained within the bounds of the
horizontal
Threshold
contained within the bounds of the
leftView
Threshold
and height of the SideNavigationViewController view frame
property.
- Parameter point: A CGPoint to test against.
- Returns: A Boolean of the result, true if yes, false
otherwise.
*/
private
func
isPointContainedWithinLeftThreshold
(
point
:
CGPoint
)
->
Bool
{
return
CGRectContainsPoint
(
CGRectMake
(
0
,
0
,
horizontal
Threshold
,
view
.
frame
.
height
),
point
)
private
func
isPointContainedWithinLeft
View
Threshold
(
point
:
CGPoint
)
->
Bool
{
return
CGRectContainsPoint
(
CGRectMake
(
0
,
0
,
leftView
Threshold
,
view
.
frame
.
height
),
point
)
}
/**
...
...
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