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
48064570
Unverified
Commit
48064570
authored
Feb 24, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated to and from references
parent
c2ddc79c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
25 deletions
+10
-25
Sources/Motion.swift
+9
-24
Sources/MotionAnimation.swift
+1
-1
No files found.
Sources/Motion.swift
View file @
48064570
...
...
@@ -364,10 +364,14 @@ open class Motion: NSObject {
open
let
transitionBackgroundView
=
UIView
()
/// A reference to the view controller that is being transitioned to.
open
var
toViewController
:
UIViewController
!
open
var
toViewController
:
UIViewController
{
return
transitionContext
.
viewController
(
forKey
:
.
to
)
!
}
/// A reference to the view controller that is being transitioned from.
open
var
fromViewController
:
UIViewController
!
open
var
fromViewController
:
UIViewController
{
return
transitionContext
.
viewController
(
forKey
:
.
from
)
!
}
/// The transition context for the current transition.
open
var
transitionContext
:
UIViewControllerContextTransitioning
!
...
...
@@ -386,7 +390,7 @@ open class Motion: NSObject {
/// The view that is being transitioned to.
open
var
toView
:
UIView
{
return
t
oViewController
.
view
return
t
ransitionContext
.
view
(
forKey
:
.
to
)
!
}
/// The subviews of the view being transitioned to.
...
...
@@ -396,7 +400,7 @@ open class Motion: NSObject {
/// The view that is being transitioned from.
open
var
fromView
:
UIView
{
return
fromViewController
.
view
return
transitionContext
.
view
(
forKey
:
.
from
)
!
}
/// The subviews of the view being transitioned from.
...
...
@@ -406,7 +410,7 @@ open class Motion: NSObject {
/// A time value to delay the transition animation by.
fileprivate
var
delayTransitionByTimeInterval
:
TimeInterval
{
return
fromViewController
?
.
motionDelegate
?
.
motionDelayTransitionByTimeInterval
?(
motion
:
self
)
??
0
return
fromViewController
.
motionDelegate
?
.
motionDelayTransitionByTimeInterval
?(
motion
:
self
)
??
0
}
/// The default initializer.
...
...
@@ -520,8 +524,6 @@ extension Motion: UIViewControllerAnimatedTransitioning {
@objc(animateTransition:)
open
func
animateTransition
(
using
transitionContext
:
UIViewControllerContextTransitioning
)
{
self
.
transitionContext
=
transitionContext
prepareToViewController
()
prepareFromViewController
()
fromViewController
.
motionDelegate
?
.
motion
?(
motion
:
self
,
willTransition
:
fromView
,
toView
:
toView
)
...
...
@@ -552,22 +554,6 @@ extension Motion: UIViewControllerAnimatedTransitioning {
}
extension
Motion
{
/// Prepares the toViewController.
fileprivate
func
prepareToViewController
()
{
guard
let
v
=
transitionContext
.
viewController
(
forKey
:
.
to
)
else
{
return
}
toViewController
=
v
}
/// Prepares the fromViewController.
fileprivate
func
prepareFromViewController
()
{
guard
let
v
=
transitionContext
.
viewController
(
forKey
:
.
from
)
else
{
return
}
fromViewController
=
v
}
/// Prepares the containerView.
fileprivate
func
prepareContainerView
()
{
containerView
=
transitionContext
.
containerView
...
...
@@ -587,7 +573,6 @@ extension Motion {
guard
to
.
motionIdentifier
==
from
.
motionIdentifier
else
{
continue
}
transitionPairs
.
append
((
from
,
to
))
}
}
...
...
Sources/MotionAnimation.swift
View file @
48064570
...
...
@@ -173,7 +173,7 @@ extension CALayer {
- Parameter animations: An Array of MotionAnimation values.
*/
open
func
motion
(
_
animations
:
[
MotionAnimation
])
{
motion
(
delay
:
0
,
duration
:
0.
2
5
,
timingFunction
:
.
easeInEaseOut
,
animations
:
animations
)
motion
(
delay
:
0
,
duration
:
0.
3
5
,
timingFunction
:
.
easeInEaseOut
,
animations
:
animations
)
}
/**
...
...
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