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
06ec8deb
Unverified
Commit
06ec8deb
authored
Jun 09, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reworked MotionIndependentController
parent
d21da35d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
Sources/MotionIndependentController.swift
+23
-2
No files found.
Sources/MotionIndependentController.swift
View file @
06ec8deb
...
@@ -29,19 +29,40 @@
...
@@ -29,19 +29,40 @@
import
UIKit
import
UIKit
public
class
MotionIndependentController
:
MotionController
{
public
class
MotionIndependentController
:
MotionController
{
/// An initializer.
public
override
init
()
{
public
override
init
()
{
super
.
init
()
super
.
init
()
}
}
/**
Transitions source views to their corresponding destination view
within a given root view.
- Parameter rootView: A UIView.
- Parameter fromViews: An Array of UIViews.
- Parameter toViews: An Array of UIViews.
- Parameter completion: An optional callback.
*/
public
func
transition
(
rootView
:
UIView
,
fromViews
:
[
UIView
],
toViews
:
[
UIView
],
completion
:
((
Bool
)
->
Void
)?
=
nil
)
{
public
func
transition
(
rootView
:
UIView
,
fromViews
:
[
UIView
],
toViews
:
[
UIView
],
completion
:
((
Bool
)
->
Void
)?
=
nil
)
{
transitionContainer
=
rootView
transitionContainer
=
rootView
completionCallback
=
completion
completionCallback
=
completion
prepareTransition
()
prepareTransition
()
prepareContext
(
fromViews
:
fromViews
,
toViews
:
toViews
)
prepareTransitionPairs
()
animate
()
}
}
fileprivate
extension
MotionIndependentController
{
/**
Prepares the context.
- Parameter fromViews: An Array of UIViews.
- PArameter toViews: An Array of UIViews.
*/
func
prepareContext
(
fromViews
:
[
UIView
],
toViews
:
[
UIView
])
{
context
.
defaultCoordinateSpace
=
.
sameParent
context
.
defaultCoordinateSpace
=
.
sameParent
context
.
set
(
fromViews
:
fromViews
,
toViews
:
toViews
)
context
.
set
(
fromViews
:
fromViews
,
toViews
:
toViews
)
processContext
()
processContext
()
prepareTransitionPairs
()
animate
()
}
}
}
}
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