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
18169434
Unverified
Commit
18169434
authored
Jul 15, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed pulse animation
parent
a26c532b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
32 deletions
+32
-32
Sources/Animator/MotionTransitionAnimator.swift
+3
-3
Sources/MotionCAAnimation.swift
+27
-27
Sources/MotionController.swift
+2
-2
Sources/Preprocessors/TransitionPreprocessor.swift
+0
-0
No files found.
Sources/Animator/Motion
Default
Animator.swift
→
Sources/Animator/Motion
Transition
Animator.swift
View file @
18169434
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
import
UIKit
import
UIKit
internal
class
Motion
Default
Animator
<
T
:
MotionAnimatorViewContext
>
:
MotionAnimator
,
MotionHasInsertOrder
{
internal
class
Motion
Transition
Animator
<
T
:
MotionAnimatorViewContext
>
:
MotionAnimator
,
MotionHasInsertOrder
{
/// A reference to a MotionContext.
/// A reference to a MotionContext.
weak
public
var
context
:
MotionContext
!
weak
public
var
context
:
MotionContext
!
...
@@ -38,7 +38,7 @@ internal class MotionDefaultAnimator<T: MotionAnimatorViewContext>: MotionAnimat
...
@@ -38,7 +38,7 @@ internal class MotionDefaultAnimator<T: MotionAnimatorViewContext>: MotionAnimat
var
insertToViewFirst
=
false
var
insertToViewFirst
=
false
}
}
extension
Motion
Default
Animator
{
extension
Motion
Transition
Animator
{
/**
/**
Animates a given view.
Animates a given view.
- Parameter view: A UIView.
- Parameter view: A UIView.
...
@@ -55,7 +55,7 @@ extension MotionDefaultAnimator {
...
@@ -55,7 +55,7 @@ extension MotionDefaultAnimator {
}
}
}
}
extension
Motion
Default
Animator
{
extension
Motion
Transition
Animator
{
/// Cleans the contexts.
/// Cleans the contexts.
func
clean
()
{
func
clean
()
{
for
v
in
viewToContexts
.
values
{
for
v
in
viewToContexts
.
values
{
...
...
Sources/MotionCAAnimation.swift
View file @
18169434
...
@@ -146,33 +146,6 @@ public extension MotionCAAnimation {
...
@@ -146,33 +146,6 @@ public extension MotionCAAnimation {
}
}
/**
/**
Creates a CABasicAnimation for the transform.rotate.x key path.
- Parameter x: An optional CGFloat.
- Returns: A CABasicAnimation.
*/
static
func
spin
(
x
:
CGFloat
)
->
CABasicAnimation
{
return
MotionCAAnimation
.
createAnimation
(
keyPath
:
.
rotateX
,
toValue
:
NSNumber
(
value
:
Double
(
CGFloat
(
Double
.
pi
)
*
2
*
x
)))
}
/**
Creates a CABasicAnimation for the transform.rotate.y key path.
- Parameter y: An optional CGFloat.
- Returns: A CABasicAnimation.
*/
static
func
spin
(
y
:
CGFloat
)
->
CABasicAnimation
{
return
MotionCAAnimation
.
createAnimation
(
keyPath
:
.
rotateY
,
toValue
:
NSNumber
(
value
:
Double
(
CGFloat
(
Double
.
pi
)
*
2
*
y
)))
}
/**
Creates a CABasicAnimation for the transform.rotate.z key path.
- Parameter z: An optional CGFloat.
- Returns: A CABasicAnimation.
*/
static
func
spin
(
z
:
CGFloat
)
->
CABasicAnimation
{
return
MotionCAAnimation
.
createAnimation
(
keyPath
:
.
rotateZ
,
toValue
:
NSNumber
(
value
:
Double
(
CGFloat
(
Double
.
pi
)
*
2
*
z
)))
}
/**
Creates a CABasicAnimation for the transform.scale key path.
Creates a CABasicAnimation for the transform.scale key path.
- Parameter xyz: A CGFloat.
- Parameter xyz: A CGFloat.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
...
@@ -217,6 +190,33 @@ public extension MotionCAAnimation {
...
@@ -217,6 +190,33 @@ public extension MotionCAAnimation {
}
}
/**
/**
Creates a CABasicAnimation for the transform.rotate.x key path.
- Parameter x: An optional CGFloat.
- Returns: A CABasicAnimation.
*/
static
func
spin
(
x
:
CGFloat
)
->
CABasicAnimation
{
return
MotionCAAnimation
.
createAnimation
(
keyPath
:
.
rotateX
,
toValue
:
NSNumber
(
value
:
Double
(
CGFloat
(
Double
.
pi
)
*
2
*
x
)))
}
/**
Creates a CABasicAnimation for the transform.rotate.y key path.
- Parameter y: An optional CGFloat.
- Returns: A CABasicAnimation.
*/
static
func
spin
(
y
:
CGFloat
)
->
CABasicAnimation
{
return
MotionCAAnimation
.
createAnimation
(
keyPath
:
.
rotateY
,
toValue
:
NSNumber
(
value
:
Double
(
CGFloat
(
Double
.
pi
)
*
2
*
y
)))
}
/**
Creates a CABasicAnimation for the transform.rotate.z key path.
- Parameter z: An optional CGFloat.
- Returns: A CABasicAnimation.
*/
static
func
spin
(
z
:
CGFloat
)
->
CABasicAnimation
{
return
MotionCAAnimation
.
createAnimation
(
keyPath
:
.
rotateZ
,
toValue
:
NSNumber
(
value
:
Double
(
CGFloat
(
Double
.
pi
)
*
2
*
z
)))
}
/**
Creates a CABasicAnimation for the position key path.
Creates a CABasicAnimation for the position key path.
- Parameter _ point: A CGPoint.
- Parameter _ point: A CGPoint.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
...
...
Sources/MotionController.swift
View file @
18169434
...
@@ -495,10 +495,10 @@ fileprivate extension MotionController {
...
@@ -495,10 +495,10 @@ fileprivate extension MotionController {
/// Prepares the animators.
/// Prepares the animators.
func
prepareAnimators
()
{
func
prepareAnimators
()
{
animators
.
append
(
Motion
Default
Animator
<
MotionCoreAnimationViewContext
>
())
animators
.
append
(
Motion
Transition
Animator
<
MotionCoreAnimationViewContext
>
())
if
#available(iOS 10, tvOS 10, *)
{
if
#available(iOS 10, tvOS 10, *)
{
animators
.
append
(
Motion
Default
Animator
<
MotionViewPropertyViewContext
>
())
animators
.
append
(
Motion
Transition
Animator
<
MotionViewPropertyViewContext
>
())
}
}
for
v
in
animators
{
for
v
in
animators
{
...
...
Sources/TransitionPreprocessor.swift
→
Sources/
Preprocessors/
TransitionPreprocessor.swift
View file @
18169434
File moved
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