Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Motion
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
Motion
Commits
96cb8184
Unverified
Commit
96cb8184
authored
Jun 30, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated README to test new gif animations
parent
e275fffc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
Sources/Extensions/Motion+CALayer.swift
+6
-5
Sources/Motion.swift
+2
-2
No files found.
Sources/Extensions/Motion+CALayer.swift
View file @
96cb8184
...
...
@@ -152,7 +152,7 @@ fileprivate extension CALayer {
}
var
anims
=
[
CABasicAnimation
]()
var
d
=
targetState
.
duration
var
d
uration
=
targetState
.
duration
if
let
v
=
targetState
.
backgroundColor
{
let
a
=
MotionCAAnimation
.
background
(
color
:
UIColor
(
cgColor
:
v
))
...
...
@@ -262,11 +262,11 @@ fileprivate extension CALayer {
let
a
=
MotionCAAnimation
.
convert
(
animation
:
v
,
stiffness
:
stiffness
,
damping
:
damping
)
anims
[
i
]
=
a
d
=
a
.
settlingDuration
*
0.9
d
uration
=
a
.
settlingDuration
}
}
let
g
=
Motion
.
animate
(
group
:
anims
,
duration
:
d
)
let
g
=
Motion
.
animate
(
group
:
anims
,
duration
:
d
uration
)
g
.
fillMode
=
MotionAnimationFillModeToValue
(
mode
:
.
forwards
)
g
.
isRemovedOnCompletion
=
false
g
.
timingFunction
=
targetState
.
timingFunction
...
...
@@ -274,11 +274,12 @@ fileprivate extension CALayer {
s
.
animate
(
g
)
if
let
v
=
targetState
.
completion
{
Motion
.
delay
(
d
,
execute
:
v
)
print
(
duration
)
Motion
.
delay
(
duration
,
execute
:
v
)
}
if
let
v
=
completion
{
Motion
.
delay
(
d
,
execute
:
v
)
Motion
.
delay
(
d
uration
,
execute
:
v
)
}
}
}
...
...
Sources/Motion.swift
View file @
96cb8184
...
...
@@ -780,12 +780,12 @@ extension Motion {
the animations have completed.
*/
@discardableResult
public
class
func
delay
(
_
time
:
TimeInterval
,
execute
block
:
@escaping
()
->
Void
)
->
MotionDelayCancelBlock
?
{
public
class
func
delay
(
_
time
:
TimeInterval
,
execute
:
@escaping
()
->
Void
)
->
MotionDelayCancelBlock
?
{
var
cancelable
:
MotionDelayCancelBlock
?
let
delayed
:
MotionDelayCancelBlock
=
{
if
!
$0
{
DispatchQueue
.
main
.
async
(
execute
:
block
)
DispatchQueue
.
main
.
async
(
execute
:
execute
)
}
cancelable
=
nil
...
...
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