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
c5c2283c
Commit
c5c2283c
authored
Apr 23, 2019
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: updated license to MIT
parent
676cf6fa
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
165 additions
and
285 deletions
+165
-285
Motion.xcodeproj/project.pbxproj
+2
-0
Sources/Animator/MotionAnimator.swift
+1
-4
Sources/Animator/MotionAnimatorViewContext.swift
+1
-4
Sources/Animator/MotionCoreAnimationViewContext.swift
+1
-4
Sources/Animator/MotionCoreAnimator.swift
+2
-5
Sources/Animator/MotionViewPropertyViewContext.swift
+1
-4
Sources/Animator/MotionViewTransitionAnimator.swift
+1
-1
Sources/Application.swift
+26
-32
Sources/Extensions/Motion+Array.swift
+1
-4
Sources/Extensions/Motion+CALayer.swift
+3
-3
Sources/Extensions/Motion+CAMediaTimingFunction.swift
+1
-4
Sources/Extensions/Motion+CG.swift
+1
-4
Sources/Extensions/Motion+Obj-C.swift
+1
-1
Sources/Extensions/Motion+UIKit.swift
+1
-4
Sources/Extensions/Motion+UIView.swift
+1
-4
Sources/Extensions/Motion+UIViewController.swift
+1
-4
Sources/LICENSE
+24
-23
Sources/Motion.h
+1
-1
Sources/MotionAnimation.swift
+1
-4
Sources/MotionAnimationState.swift
+1
-4
Sources/MotionCAAnimation.swift
+1
-1
Sources/MotionContext.swift
+41
-44
Sources/MotionCoordinateSpace.swift
+1
-4
Sources/MotionModifier.swift
+1
-4
Sources/MotionPlugin.swift
+1
-4
Sources/MotionSnapshotType.swift
+1
-4
Sources/MotionTargetState.swift
+1
-4
Sources/MotionTransitionObserver.swift
+1
-4
Sources/MotionViewOrderStrategy.swift
+1
-4
Sources/MotionViewTransition.swift
+6
-6
Sources/Preprocessors/CascadePreprocessor.swift
+1
-4
Sources/Preprocessors/ConditionalPreprocessor.swift
+1
-4
Sources/Preprocessors/IgnoreSubviewModifiersPreprocessor.swift
+1
-4
Sources/Preprocessors/MatchPreprocessor.swift
+1
-4
Sources/Preprocessors/MotionCorePreprocessor.swift
+1
-4
Sources/Preprocessors/MotionPreprocessor.swift
+1
-4
Sources/Preprocessors/SourcePreprocessor.swift
+1
-4
Sources/Preprocessors/TransitionPreprocessor.swift
+1
-4
Sources/Transition/MotionProgressRunner.swift
+1
-4
Sources/Transition/MotionTransition+Animate.swift
+1
-4
Sources/Transition/MotionTransition+Complete.swift
+1
-4
Sources/Transition/MotionTransition+CustomTransition.swift
+1
-4
Sources/Transition/MotionTransition+Interactive.swift
+1
-4
Sources/Transition/MotionTransition+Start.swift
+12
-15
Sources/Transition/MotionTransition+UINavigationControllerDelegate.swift
+1
-4
Sources/Transition/MotionTransition+UITabBarControllerDelegate.swift
+2
-5
Sources/Transition/MotionTransition+UIViewControllerTransitioningDelegate.swift
+1
-4
Sources/Transition/MotionTransition.swift
+9
-12
No files found.
Motion.xcodeproj/project.pbxproj
View file @
c5c2283c
...
@@ -171,6 +171,7 @@
...
@@ -171,6 +171,7 @@
indentWidth
=
2
;
indentWidth
=
2
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
tabWidth
=
2
;
tabWidth
=
2
;
usesTabs
=
0
;
};
};
96C98DD21E424AB000B22906
/* Products */
=
{
96C98DD21E424AB000B22906
/* Products */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
...
@@ -338,6 +339,7 @@
...
@@ -338,6 +339,7 @@
developmentRegion
=
English
;
developmentRegion
=
English
;
hasScannedForEncodings
=
0
;
hasScannedForEncodings
=
0
;
knownRegions
=
(
knownRegions
=
(
English
,
en
,
en
,
);
);
mainGroup
=
96C98DC71E424AB000B22906
;
mainGroup
=
96C98DC71E424AB000B22906
;
...
...
Sources/Animator/MotionAnimator.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Animator/MotionAnimatorViewContext.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Animator/MotionCoreAnimationViewContext.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Animator/MotionCoreAnimator.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
@@ -185,7 +182,7 @@ internal class MotionCoreAnimator<T: MotionAnimatorViewContext>: MotionAnimator
...
@@ -185,7 +182,7 @@ internal class MotionCoreAnimator<T: MotionAnimatorViewContext>: MotionAnimator
func
targetState
(
for
view
:
UIView
)
->
MotionTargetState
?
{
func
targetState
(
for
view
:
UIView
)
->
MotionTargetState
?
{
return
context
[
view
]
return
context
[
view
]
}
}
/**
/**
Returns snapshot view for the given view.
Returns snapshot view for the given view.
- Parameter for view: A UIView.
- Parameter for view: A UIView.
...
...
Sources/Animator/MotionViewPropertyViewContext.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Animator/MotionViewTransitionAnimator.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
8, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
...
...
Sources/Application.swift
View file @
c5c2283c
/*
/*
* Copyright (C) 2015 - 2018, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>.
* The MIT License (MIT)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
*
* Redistributions of source code must retain the above copyright notice, this
*
Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
*
list of conditions and the following disclaimer
.
*
All rights reserved
.
*
*
* * Redistributions in binary form must reproduce the above copyright notice,
* Permission is hereby granted, free of charge, to any person obtaining a copy
* this list of conditions and the following disclaimer in the documentation
* of this software and associated documentation files (the "Software"), to deal
* and/or other materials provided with the distribution.
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* * Neither the name of CosmicMind nor the names of its
* The above copyright notice and this permission notice shall be included in
* contributors may be used to endorse or promote products derived from
* all copies or substantial portions of the Software.
* this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* THE SOFTWARE.
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
*/
import
UIKit
import
UIKit
internal
class
Application
{
internal
class
Application
{
static
var
shared
:
UIApplication
{
static
var
shared
:
UIApplication
{
let
sharedSelector
=
NSSelectorFromString
(
"sharedApplication"
)
let
sharedSelector
=
NSSelectorFromString
(
"sharedApplication"
)
guard
UIApplication
.
responds
(
to
:
sharedSelector
)
else
{
guard
UIApplication
.
responds
(
to
:
sharedSelector
)
else
{
fatalError
(
"[Motion: Extensions cannot access Application]"
)
fatalError
(
"[Motion: Extensions cannot access Application]"
)
}
let
shared
=
UIApplication
.
perform
(
sharedSelector
)
return
shared
?
.
takeUnretainedValue
()
as!
UIApplication
}
}
let
shared
=
UIApplication
.
perform
(
sharedSelector
)
return
shared
?
.
takeUnretainedValue
()
as!
UIApplication
}
}
}
Sources/Extensions/Motion+Array.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Extensions/Motion+CALayer.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
...
@@ -27,7 +27,7 @@ import UIKit
...
@@ -27,7 +27,7 @@ import UIKit
internal
extension
CALayer
{
internal
extension
CALayer
{
/// Swizzle the `add(_:forKey:) selector.
/// Swizzle the `add(_:forKey:) selector.
internal
static
var
motionAddedAnimations
:
[(
CALayer
,
String
,
CAAnimation
)]?
=
{
static
var
motionAddedAnimations
:
[(
CALayer
,
String
,
CAAnimation
)]?
=
{
let
swizzling
:
(
AnyClass
,
Selector
,
Selector
)
->
Void
=
{
forClass
,
originalSelector
,
swizzledSelector
in
let
swizzling
:
(
AnyClass
,
Selector
,
Selector
)
->
Void
=
{
forClass
,
originalSelector
,
swizzledSelector
in
if
let
originalMethod
=
class_getInstanceMethod
(
forClass
,
originalSelector
),
let
swizzledMethod
=
class_getInstanceMethod
(
forClass
,
swizzledSelector
)
{
if
let
originalMethod
=
class_getInstanceMethod
(
forClass
,
originalSelector
),
let
swizzledMethod
=
class_getInstanceMethod
(
forClass
,
swizzledSelector
)
{
method_exchangeImplementations
(
originalMethod
,
swizzledMethod
)
method_exchangeImplementations
(
originalMethod
,
swizzledMethod
)
...
@@ -293,7 +293,7 @@ private extension CALayer {
...
@@ -293,7 +293,7 @@ private extension CALayer {
/**
/**
Updates the model with values provided in animation.
Updates the model with values provided in animation.
- Parameter animation: A CAAnimation.
- Parameter animation: A CAAnimation.
*/
*/
func
updateModel
(
_
animation
:
CAAnimation
)
{
func
updateModel
(
_
animation
:
CAAnimation
)
{
if
let
a
=
animation
as?
CABasicAnimation
{
if
let
a
=
animation
as?
CABasicAnimation
{
setValue
(
a
.
toValue
,
forKeyPath
:
a
.
keyPath
!
)
setValue
(
a
.
toValue
,
forKeyPath
:
a
.
keyPath
!
)
...
...
Sources/Extensions/Motion+CAMediaTimingFunction.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Extensions/Motion+CG.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Extensions/Motion+Obj-C.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
...
...
Sources/Extensions/Motion+UIKit.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Extensions/Motion+UIView.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Extensions/Motion+UIViewController.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/LICENSE
View file @
c5c2283c
The MIT License (MIT)
/*
* The MIT License (MIT)
Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>.
*
All rights reserved.
* Copyright (C) 2019, CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
*
of this software and associated documentation files (the "Software"), to deal
* Permission is hereby granted, free of charge, to any person obtaining a copy
in the Software without restriction, including without limitation the rights
* of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* in the Software without restriction, including without limitation the rights
copies of the Software, and to permit persons to whom the Software is
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
*
all copies or substantial portions of the Software.
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
THE SOFTWARE.
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
Sources/Motion.h
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
...
...
Sources/MotionAnimation.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/MotionAnimationState.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/MotionCAAnimation.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
...
...
Sources/MotionContext.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
@@ -233,53 +230,53 @@ public extension MotionContext {
...
@@ -233,53 +230,53 @@ public extension MotionContext {
case
.
optimized
:
case
.
optimized
:
#if os(tvOS)
#if os(tvOS)
snapshot
=
view
.
snapshotView
(
afterScreenUpdates
:
true
)
!
snapshot
=
view
.
snapshotView
(
afterScreenUpdates
:
true
)
!
#else
#else
if
#available(iOS 9.0, *)
,
let
stackView
=
view
as?
UIStackView
{
if
#available(iOS 9.0, *)
,
let
stackView
=
view
as?
UIStackView
{
snapshot
=
stackView
.
slowSnapshotView
()
snapshot
=
stackView
.
slowSnapshotView
()
}
else
if
let
imageView
=
view
as?
UIImageView
,
view
.
subviews
.
isEmpty
{
}
else
if
let
imageView
=
view
as?
UIImageView
,
view
.
subviews
.
isEmpty
{
let
contentView
=
UIImageView
(
image
:
imageView
.
image
)
let
contentView
=
UIImageView
(
image
:
imageView
.
image
)
contentView
.
frame
=
imageView
.
bounds
contentView
.
frame
=
imageView
.
bounds
contentView
.
contentMode
=
imageView
.
contentMode
contentView
.
contentMode
=
imageView
.
contentMode
contentView
.
tintColor
=
imageView
.
tintColor
contentView
.
tintColor
=
imageView
.
tintColor
contentView
.
backgroundColor
=
imageView
.
backgroundColor
contentView
.
backgroundColor
=
imageView
.
backgroundColor
let
snapShotView
=
UIView
()
let
snapShotView
=
UIView
()
snapShotView
.
addSubview
(
contentView
)
snapShotView
.
addSubview
(
contentView
)
snapshot
=
snapShotView
snapshot
=
snapShotView
}
else
if
let
barView
=
view
as?
UINavigationBar
,
barView
.
isTranslucent
{
}
else
if
let
barView
=
view
as?
UINavigationBar
,
barView
.
isTranslucent
{
let
newBarView
=
UINavigationBar
(
frame
:
barView
.
frame
)
let
newBarView
=
UINavigationBar
(
frame
:
barView
.
frame
)
newBarView
.
barStyle
=
barView
.
barStyle
newBarView
.
barStyle
=
barView
.
barStyle
newBarView
.
tintColor
=
barView
.
tintColor
newBarView
.
tintColor
=
barView
.
tintColor
newBarView
.
barTintColor
=
barView
.
barTintColor
newBarView
.
barTintColor
=
barView
.
barTintColor
newBarView
.
clipsToBounds
=
false
newBarView
.
clipsToBounds
=
false
// take a snapshot without the background
// take a snapshot without the background
barView
.
layer
.
sublayers
!
[
0
]
.
opacity
=
0
barView
.
layer
.
sublayers
!
[
0
]
.
opacity
=
0
let
realSnapshot
=
barView
.
snapshotView
(
afterScreenUpdates
:
true
)
!
let
realSnapshot
=
barView
.
snapshotView
(
afterScreenUpdates
:
true
)
!
barView
.
layer
.
sublayers
!
[
0
]
.
opacity
=
1
barView
.
layer
.
sublayers
!
[
0
]
.
opacity
=
1
newBarView
.
addSubview
(
realSnapshot
)
newBarView
.
addSubview
(
realSnapshot
)
snapshot
=
newBarView
snapshot
=
newBarView
}
else
if
let
effectView
=
view
as?
UIVisualEffectView
{
}
else
if
let
effectView
=
view
as?
UIVisualEffectView
{
snapshot
=
UIVisualEffectView
(
effect
:
effectView
.
effect
)
snapshot
=
UIVisualEffectView
(
effect
:
effectView
.
effect
)
snapshot
.
frame
=
effectView
.
bounds
snapshot
.
frame
=
effectView
.
bounds
}
else
{
}
else
{
snapshot
=
view
.
snapshotView
()
??
UIView
()
snapshot
=
view
.
snapshotView
()
??
UIView
()
}
}
#endif
#endif
}
}
#if os(tvOS)
#if os(tvOS)
if
let
imageView
=
view
as?
UIImageView
,
imageView
.
adjustsImageWhenAncestorFocused
{
if
let
imageView
=
view
as?
UIImageView
,
imageView
.
adjustsImageWhenAncestorFocused
{
snapshot
.
frame
=
imageView
.
focusedFrameGuide
.
layoutFrame
snapshot
.
frame
=
imageView
.
focusedFrameGuide
.
layoutFrame
}
}
#endif
#endif
...
...
Sources/MotionCoordinateSpace.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/MotionModifier.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/MotionPlugin.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/MotionSnapshotType.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/MotionTargetState.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/MotionTransitionObserver.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/MotionViewOrderStrategy.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/MotionViewTransition.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
8, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
...
@@ -44,7 +44,7 @@ open class MotionViewTransition {
...
@@ -44,7 +44,7 @@ open class MotionViewTransition {
/// A UIView whose subviews and itself will be animating during a transition.
/// A UIView whose subviews and itself will be animating during a transition.
private
weak
var
container
:
UIView
?
private
weak
var
container
:
UIView
?
/// Maximum duration of the animations.
/// Maximum duration of the animations.
open
private(set)
var
totalDuration
:
TimeInterval
=
0
open
private(set)
var
totalDuration
:
TimeInterval
=
0
...
@@ -58,7 +58,7 @@ open class MotionViewTransition {
...
@@ -58,7 +58,7 @@ open class MotionViewTransition {
private
var
currentDuration
:
TimeInterval
{
private
var
currentDuration
:
TimeInterval
{
return
totalDuration
*
Double
(
progress
)
return
totalDuration
*
Double
(
progress
)
}
}
/**
/**
An initializer that accepts a container transition view.
An initializer that accepts a container transition view.
- Parameter container: A UIView.
- Parameter container: A UIView.
...
@@ -66,7 +66,7 @@ open class MotionViewTransition {
...
@@ -66,7 +66,7 @@ open class MotionViewTransition {
fileprivate
init
(
_
container
:
UIView
)
{
fileprivate
init
(
_
container
:
UIView
)
{
self
.
container
=
container
self
.
container
=
container
}
}
/// Prepares the transition animations.
/// Prepares the transition animations.
open
func
start
()
{
open
func
start
()
{
guard
let
v
=
container
else
{
guard
let
v
=
container
else
{
...
@@ -149,7 +149,7 @@ private extension MotionViewTransition {
...
@@ -149,7 +149,7 @@ private extension MotionViewTransition {
guard
shouldUpdateModels
else
{
guard
shouldUpdateModels
else
{
return
return
}
}
walkingThroughAnimations
{
layer
,
_
,
anim
in
walkingThroughAnimations
{
layer
,
_
,
anim
in
/// bounds.size somehow is directly set on the layer.
/// bounds.size somehow is directly set on the layer.
let
toValue
=
anim
.
keyPath
==
"bounds.size"
?
layer
.
bounds
.
size
:
anim
.
toValue
let
toValue
=
anim
.
keyPath
==
"bounds.size"
?
layer
.
bounds
.
size
:
anim
.
toValue
...
@@ -167,7 +167,7 @@ private extension MotionViewTransition {
...
@@ -167,7 +167,7 @@ private extension MotionViewTransition {
layer
.
removeAnimation
(
forKey
:
key
)
layer
.
removeAnimation
(
forKey
:
key
)
}
}
}
}
/**
/**
Walks through each layer's animation and executes give closure with
Walks through each layer's animation and executes give closure with
CALayer, animation key String, and CABasicAnimation.
CALayer, animation key String, and CABasicAnimation.
...
...
Sources/Preprocessors/CascadePreprocessor.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Preprocessors/ConditionalPreprocessor.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Preprocessors/IgnoreSubviewModifiersPreprocessor.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Preprocessors/MatchPreprocessor.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Preprocessors/MotionCorePreprocessor.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Preprocessors/MotionPreprocessor.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Preprocessors/SourcePreprocessor.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Preprocessors/TransitionPreprocessor.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Transition/MotionProgressRunner.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Transition/MotionTransition+Animate.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Transition/MotionTransition+Complete.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Transition/MotionTransition+CustomTransition.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Transition/MotionTransition+Interactive.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Transition/MotionTransition+Start.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
@@ -238,19 +235,19 @@ fileprivate extension MotionTransition {
...
@@ -238,19 +235,19 @@ fileprivate extension MotionTransition {
/// Processes the animations.
/// Processes the animations.
func
processAnimation
()
{
func
processAnimation
()
{
#if os(tvOS)
#if os(tvOS)
animate
()
animate
()
#else
#else
if
isNavigationController
{
if
isNavigationController
{
// When animating within navigationController, we have to dispatch later into the main queue.
// When animating within navigationController, we have to dispatch later into the main queue.
// otherwise snapshots will be pure white. Possibly a bug with UIKit
// otherwise snapshots will be pure white. Possibly a bug with UIKit
Motion
.
async
{
[
weak
self
]
in
Motion
.
async
{
[
weak
self
]
in
self
?
.
animate
()
self
?
.
animate
()
}
}
else
{
animate
()
}
}
}
else
{
animate
()
}
#endif
#endif
}
}
...
...
Sources/Transition/MotionTransition+UINavigationControllerDelegate.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Transition/MotionTransition+UITabBarControllerDelegate.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
@@ -32,7 +29,7 @@ extension MotionTransition: UITabBarControllerDelegate {
...
@@ -32,7 +29,7 @@ extension MotionTransition: UITabBarControllerDelegate {
public
func
tabBarController
(
_
tabBarController
:
UITabBarController
,
shouldSelect
viewController
:
UIViewController
)
->
Bool
{
public
func
tabBarController
(
_
tabBarController
:
UITabBarController
,
shouldSelect
viewController
:
UIViewController
)
->
Bool
{
guard
false
!=
tabBarController
.
previousTabBarDelegate
?
.
tabBarController
?(
tabBarController
,
shouldSelect
:
viewController
)
else
{
guard
false
!=
tabBarController
.
previousTabBarDelegate
?
.
tabBarController
?(
tabBarController
,
shouldSelect
:
viewController
)
else
{
return
false
return
false
}
}
if
isTransitioning
{
if
isTransitioning
{
...
...
Sources/Transition/MotionTransition+UIViewControllerTransitioningDelegate.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
...
Sources/Transition/MotionTransition.swift
View file @
c5c2283c
/*
/*
* The MIT License (MIT)
* The MIT License (MIT)
*
*
* Copyright (C) 201
7, Daniel Dahan and
CosmicMind, Inc. <http://cosmicmind.com>.
* Copyright (C) 201
9,
CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
* All rights reserved.
*
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* in the Software without restriction, including without limitation the rights
...
@@ -269,7 +266,7 @@ open class MotionTransition: NSObject {
...
@@ -269,7 +266,7 @@ open class MotionTransition: NSObject {
/// Whether or not we are presenting the destination view controller.
/// Whether or not we are presenting the destination view controller.
public
internal(set)
var
isPresenting
=
true
public
internal(set)
var
isPresenting
=
true
/**
/**
A boolean indicating if the transition is of modal type.
A boolean indicating if the transition is of modal type.
True if `viewController.present(_:animated:completion:)` or
True if `viewController.present(_:animated:completion:)` or
...
@@ -435,10 +432,10 @@ open class MotionTransition: NSObject {
...
@@ -435,10 +432,10 @@ open class MotionTransition: NSObject {
progressRunner
.
start
(
progress
:
progress
*
duration
,
duration
:
duration
,
isReversed
:
!
isFinishing
)
progressRunner
.
start
(
progress
:
progress
*
duration
,
duration
:
duration
,
isReversed
:
!
isFinishing
)
}
}
private
func
delegate
(
respondingTo
selector
:
Selector
?)
->
NSObjectProtocol
?
{
private
func
delegate
(
respondingTo
selector
:
Selector
?)
->
NSObjectProtocol
?
{
guard
let
selector
=
selector
else
{
return
nil
}
guard
let
selector
=
selector
else
{
return
nil
}
/// Workaround for recursion happening during navigationController transtion.
/// Workaround for recursion happening during navigationController transtion.
/// Avoiding private selectors (e.g _shouldCrossFadeBottomBars)
/// Avoiding private selectors (e.g _shouldCrossFadeBottomBars)
guard
!
selector
.
description
.
starts
(
with
:
"_"
)
else
{
return
nil
}
guard
!
selector
.
description
.
starts
(
with
:
"_"
)
else
{
return
nil
}
...
@@ -576,7 +573,7 @@ public extension MotionTransition {
...
@@ -576,7 +573,7 @@ public extension MotionTransition {
func
setContainerBackgroundColorForNextTransition
(
_
color
:
UIColor
)
{
func
setContainerBackgroundColorForNextTransition
(
_
color
:
UIColor
)
{
containerBackgroundColor
=
color
containerBackgroundColor
=
color
}
}
/**
/**
Set the completion callback closure for the next transition.
Set the completion callback closure for the next transition.
- Parameter _ completion: An optional closure receiving a Boolean indicating if transition is finishing or cancelling.
- Parameter _ completion: An optional closure receiving a Boolean indicating if transition is finishing or cancelling.
...
@@ -603,8 +600,8 @@ internal extension MotionTransition {
...
@@ -603,8 +600,8 @@ internal extension MotionTransition {
}
}
if
transitionContext
==
nil
{
if
transitionContext
==
nil
{
fvc
.
beginAppearanceTransition
(
false
,
animated
:
true
)
fvc
.
beginAppearanceTransition
(
false
,
animated
:
true
)
tvc
.
beginAppearanceTransition
(
true
,
animated
:
true
)
tvc
.
beginAppearanceTransition
(
true
,
animated
:
true
)
}
}
processForMotionDelegate
(
viewController
:
fvc
)
{
[
weak
self
]
in
processForMotionDelegate
(
viewController
:
fvc
)
{
[
weak
self
]
in
...
@@ -642,8 +639,8 @@ internal extension MotionTransition {
...
@@ -642,8 +639,8 @@ internal extension MotionTransition {
}
}
if
transitionContext
==
nil
{
if
transitionContext
==
nil
{
tvc
.
endAppearanceTransition
()
tvc
.
endAppearanceTransition
()
fvc
.
endAppearanceTransition
()
fvc
.
endAppearanceTransition
()
}
}
processForMotionDelegate
(
viewController
:
fvc
)
{
[
weak
self
]
in
processForMotionDelegate
(
viewController
:
fvc
)
{
[
weak
self
]
in
...
...
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