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
9ee829f1
Unverified
Commit
9ee829f1
authored
Jan 14, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: updated MotionTransition delegation and animator
parent
f4a5cc8c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
14 additions
and
23 deletions
+14
-23
Sources/iOS/BottomNavigationController.swift
+1
-4
Sources/iOS/Button.swift
+1
-1
Sources/iOS/CollectionReusableView.swift
+1
-1
Sources/iOS/CollectionViewCell.swift
+1
-1
Sources/iOS/Motion.swift
+2
-2
Sources/iOS/MotionAnimation.swift
+1
-1
Sources/iOS/MotionTransition.swift
+0
-0
Sources/iOS/NavigationController.swift
+1
-7
Sources/iOS/PulseMotion.swift
+3
-3
Sources/iOS/PulseView.swift
+1
-1
Sources/iOS/SnackbarController.swift
+1
-1
Sources/iOS/TableViewCell.swift
+1
-1
No files found.
Sources/iOS/BottomNavigationController.swift
View file @
9ee829f1
...
...
@@ -31,9 +31,6 @@
import
UIKit
open
class
BottomNavigationController
:
UITabBarController
,
UITabBarControllerDelegate
{
/// The transition animation to use when selecting a new tab.
open
var
motionTransition
=
MotionTransition
.
fade
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
...
...
@@ -119,7 +116,7 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel
/// Handles transitions when tabBarItems are pressed.
open
func
tabBarController
(
_
tabBarController
:
UITabBarController
,
animationControllerForTransitionFrom
fromVC
:
UIViewController
,
to
toVC
:
UIViewController
)
->
UIViewControllerAnimatedTransitioning
?
{
return
.
fade
==
motionTransition
?
FadeMotionTransition
()
:
nil
return
FadeMotionTransition
()
}
/// Prepares the tabBar.
...
...
Sources/iOS/Button.swift
View file @
9ee829f1
...
...
@@ -191,7 +191,7 @@ open class Button: UIButton, Pulseable {
let
p
=
point
??
center
pulse
.
expand
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
0.35
)
{
[
weak
self
]
in
self
?
.
pulse
.
contract
()
}
}
...
...
Sources/iOS/CollectionReusableView.swift
View file @
9ee829f1
...
...
@@ -243,7 +243,7 @@ open class CollectionReusableView: UICollectionReusableView, Pulseable {
let
p
=
point
??
center
pulse
.
expand
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
0.35
)
{
[
weak
self
]
in
self
?
.
pulse
.
contract
()
}
}
...
...
Sources/iOS/CollectionViewCell.swift
View file @
9ee829f1
...
...
@@ -201,7 +201,7 @@ open class CollectionViewCell: UICollectionViewCell, Pulseable {
let
p
=
point
??
center
pulse
.
expand
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
0.35
)
{
[
weak
self
]
in
self
?
.
pulse
.
contract
()
}
}
...
...
Sources/iOS/Motion.swift
View file @
9ee829f1
...
...
@@ -95,7 +95,7 @@ public struct Motion {
the animations have completed.
*/
@discardableResult
public
static
func
delay
(
time
:
TimeInterval
,
execute
block
:
@escaping
()
->
Void
)
->
MotionDelayCancelBlock
?
{
public
static
func
delay
(
_
time
:
TimeInterval
,
execute
block
:
@escaping
()
->
Void
)
->
MotionDelayCancelBlock
?
{
func
asyncAfter
(
completion
:
@escaping
()
->
Void
)
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
DispatchTime
.
now
()
+
time
,
execute
:
completion
)
...
...
@@ -179,7 +179,7 @@ public struct Motion {
the animations have completed.
*/
public
static
func
animate
(
delay
time
:
CFTimeInterval
,
duration
:
CFTimeInterval
,
animations
:
@escaping
(()
->
Void
),
completion
:
(()
->
Void
)?
=
nil
)
{
delay
(
time
:
time
)
{
delay
(
time
)
{
animate
(
duration
:
duration
,
animations
:
animations
,
completion
:
completion
)
}
}
...
...
Sources/iOS/MotionAnimation.swift
View file @
9ee829f1
...
...
@@ -168,7 +168,7 @@ extension CALayer {
}
}
Motion
.
delay
(
t
ime
:
t
)
{
[
weak
self
]
in
Motion
.
delay
(
t
)
{
[
weak
self
]
in
guard
let
s
=
self
else
{
return
}
...
...
Sources/iOS/MotionTransition.swift
View file @
9ee829f1
This diff is collapsed.
Click to expand it.
Sources/iOS/NavigationController.swift
View file @
9ee829f1
...
...
@@ -121,7 +121,7 @@ open class NavigationController: UINavigationController {
open
func
prepare
()
{
navigationBar
.
heightPreset
=
.
normal
navigationBar
.
width
=
view
.
width
delegate
=
self
delegate
=
transitionDelegate
view
.
clipsToBounds
=
true
view
.
backgroundColor
=
.
white
view
.
contentScaleFactor
=
Screen
.
scale
...
...
@@ -134,12 +134,6 @@ open class NavigationController: UINavigationController {
}
}
extension
NavigationController
:
UINavigationControllerDelegate
{
open
func
navigationController
(
_
navigationController
:
UINavigationController
,
animationControllerFor
operation
:
UINavigationControllerOperation
,
from
fromVC
:
UIViewController
,
to
toVC
:
UIViewController
)
->
UIViewControllerAnimatedTransitioning
?
{
return
SlideMotionTransition
(
operation
:
operation
)
}
}
extension
NavigationController
:
UINavigationBarDelegate
{
/**
Delegation method that is called when a new UINavigationItem is about to be pushed.
...
...
Sources/iOS/PulseMotion.swift
View file @
9ee829f1
...
...
@@ -156,7 +156,7 @@ extension PulseMotion {
default
:
break
}
Motion
.
delay
(
time
:
duration
)
{
Motion
.
delay
(
duration
)
{
bLayer
.
setValue
(
true
,
forKey
:
"animated"
)
}
}
...
...
@@ -173,7 +173,7 @@ extension PulseMotion {
return
}
Motion
.
delay
(
time
:
animated
?
0
:
0.15
)
{
[
animation
=
animation
,
color
=
color
]
in
Motion
.
delay
(
animated
?
0
:
0.15
)
{
[
animation
=
animation
,
color
=
color
]
in
guard
let
pLayer
=
bLayer
.
sublayers
?
.
first
as?
CAShapeLayer
else
{
return
}
...
...
@@ -192,7 +192,7 @@ extension PulseMotion {
default
:
break
}
Motion
.
delay
(
time
:
duration
)
{
Motion
.
delay
(
duration
)
{
pLayer
.
removeFromSuperlayer
()
bLayer
.
removeFromSuperlayer
()
}
...
...
Sources/iOS/PulseView.swift
View file @
9ee829f1
...
...
@@ -75,7 +75,7 @@ open class PulseView: View, Pulseable {
let
p
=
point
??
center
pulse
.
expand
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
0.35
)
{
[
weak
self
]
in
self
?
.
pulse
.
contract
()
}
}
...
...
Sources/iOS/SnackbarController.swift
View file @
9ee829f1
...
...
@@ -123,7 +123,7 @@ open class SnackbarController: RootController {
*/
@discardableResult
open
func
animate
(
snackbar
status
:
SnackbarStatus
,
delay
:
TimeInterval
=
0
,
animations
:
((
Snackbar
)
->
Void
)?
=
nil
,
completion
:
((
Snackbar
)
->
Void
)?
=
nil
)
->
MotionDelayCancelBlock
?
{
return
Motion
.
delay
(
time
:
delay
)
{
[
weak
self
,
status
=
status
,
animations
=
animations
,
completion
=
completion
]
in
return
Motion
.
delay
(
delay
)
{
[
weak
self
,
status
=
status
,
animations
=
animations
,
completion
=
completion
]
in
guard
let
s
=
self
else
{
return
}
...
...
Sources/iOS/TableViewCell.swift
View file @
9ee829f1
...
...
@@ -117,7 +117,7 @@ open class TableViewCell: UITableViewCell, Pulseable {
let
p
=
point
??
center
pulse
.
expand
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
0.35
)
{
[
weak
self
]
in
self
?
.
pulse
.
contract
()
}
}
...
...
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