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
a1f023fd
Commit
a1f023fd
authored
Jul 25, 2018
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated for Swift 4.2
parent
296684b3
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
29 additions
and
76 deletions
+29
-76
Motion.xcodeproj/project.pbxproj
+3
-9
Motion.xcodeproj/xcshareddata/xcschemes/Motion iOS.xcscheme
+1
-1
Sources/Animator/MotionCoreAnimationViewContext.swift
+1
-1
Sources/Extensions/Motion+CALayer.swift
+6
-1
Sources/Extensions/Motion+CAMediaTimingFunction.swift
+4
-4
Sources/Extensions/Motion+UIViewController.swift
+2
-2
Sources/Extensions/MotionAnimationFillMode.swift
+0
-51
Sources/Info.plist
+1
-1
Sources/Transition/MotionProgressRunner.swift
+2
-2
Sources/Transition/MotionTransition+UINavigationControllerDelegate.swift
+1
-1
Sources/Transition/MotionTransition+UITabBarControllerDelegate.swift
+2
-2
Sources/Transition/MotionTransition.swift
+6
-1
No files found.
Motion.xcodeproj/project.pbxproj
View file @
a1f023fd
...
...
@@ -42,7 +42,6 @@
96E409701F24F7370015A2B5
/* Motion+UIKit.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E409491F24F7370015A2B5
/* Motion+UIKit.swift */
;
};
96E409711F24F7370015A2B5
/* Motion+UIView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E4094A1F24F7370015A2B5
/* Motion+UIView.swift */
;
};
96E409721F24F7370015A2B5
/* Motion+UIViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E4094B1F24F7370015A2B5
/* Motion+UIViewController.swift */
;
};
96E409731F24F7370015A2B5
/* MotionAnimationFillMode.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E4094C1F24F7370015A2B5
/* MotionAnimationFillMode.swift */
;
};
96E409741F24F7370015A2B5
/* Motion.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E4094F1F24F7370015A2B5
/* Motion.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E409761F24F7370015A2B5
/* MotionAnimation.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E409511F24F7370015A2B5
/* MotionAnimation.swift */
;
};
96E409771F24F7370015A2B5
/* MotionAnimationState.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E409521F24F7370015A2B5
/* MotionAnimationState.swift */
;
};
...
...
@@ -72,7 +71,6 @@
96E409941F24F7570015A2B5
/* Motion+UIKit.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E409491F24F7370015A2B5
/* Motion+UIKit.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E409951F24F7570015A2B5
/* Motion+UIView.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E4094A1F24F7370015A2B5
/* Motion+UIView.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E409961F24F7570015A2B5
/* Motion+UIViewController.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E4094B1F24F7370015A2B5
/* Motion+UIViewController.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E409971F24F7570015A2B5
/* MotionAnimationFillMode.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E4094C1F24F7370015A2B5
/* MotionAnimationFillMode.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E4099B1F24F7570015A2B5
/* MotionAnimation.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E409511F24F7370015A2B5
/* MotionAnimation.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E4099C1F24F7570015A2B5
/* MotionAnimationState.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E409521F24F7370015A2B5
/* MotionAnimationState.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96E4099D1F24F7570015A2B5
/* MotionCAAnimation.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96E409531F24F7370015A2B5
/* MotionCAAnimation.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -119,7 +117,6 @@
96E409491F24F7370015A2B5
/* Motion+UIKit.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+UIKit.swift"
;
sourceTree
=
"<group>"
;
};
96E4094A1F24F7370015A2B5
/* Motion+UIView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+UIView.swift"
;
sourceTree
=
"<group>"
;
};
96E4094B1F24F7370015A2B5
/* Motion+UIViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+UIViewController.swift"
;
sourceTree
=
"<group>"
;
};
96E4094C1F24F7370015A2B5
/* MotionAnimationFillMode.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MotionAnimationFillMode.swift
;
sourceTree
=
"<group>"
;
};
96E4094F1F24F7370015A2B5
/* Motion.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
Motion.h
;
sourceTree
=
"<group>"
;
};
96E409511F24F7370015A2B5
/* MotionAnimation.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MotionAnimation.swift
;
sourceTree
=
"<group>"
;
};
96E409521F24F7370015A2B5
/* MotionAnimationState.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MotionAnimationState.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -223,7 +220,6 @@
96E409491F24F7370015A2B5
/* Motion+UIKit.swift */
,
96E4094A1F24F7370015A2B5
/* Motion+UIView.swift */
,
96E4094B1F24F7370015A2B5
/* Motion+UIViewController.swift */
,
96E4094C1F24F7370015A2B5
/* MotionAnimationFillMode.swift */
,
);
path
=
Extensions
;
sourceTree
=
"<group>"
;
...
...
@@ -262,7 +258,6 @@
96E409941F24F7570015A2B5
/* Motion+UIKit.swift in Headers */
,
96E409951F24F7570015A2B5
/* Motion+UIView.swift in Headers */
,
96E409961F24F7570015A2B5
/* Motion+UIViewController.swift in Headers */
,
96E409971F24F7570015A2B5
/* MotionAnimationFillMode.swift in Headers */
,
96E4099B1F24F7570015A2B5
/* MotionAnimation.swift in Headers */
,
96E4099C1F24F7570015A2B5
/* MotionAnimationState.swift in Headers */
,
96E4099D1F24F7570015A2B5
/* MotionCAAnimation.swift in Headers */
,
...
...
@@ -322,7 +317,7 @@
TargetAttributes
=
{
96C98DD01E424AB000B22906
=
{
CreatedOnToolsVersion
=
8.2.1
;
LastSwiftMigration
=
083
0
;
LastSwiftMigration
=
100
0
;
ProvisioningStyle
=
Automatic
;
};
};
...
...
@@ -349,7 +344,6 @@
isa
=
PBXSourcesBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
96E409731F24F7370015A2B5
/* MotionAnimationFillMode.swift in Sources */
,
96E409791F24F7370015A2B5
/* MotionContext.swift in Sources */
,
965FE96B1FDDA4EA0098BDD0
/* MotionCorePreprocessor.swift in Sources */
,
965FE9631FDCCE030098BDD0
/* MotionTransition+Complete.swift in Sources */
,
...
...
@@ -534,7 +528,7 @@
SKIP_INSTALL
=
YES
;
SWIFT_OBJC_INTERFACE_HEADER_NAME
=
"$(SWIFT_MODULE_NAME)-Swift.h"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_VERSION
=
4.
0
;
SWIFT_VERSION
=
4.
2
;
};
name
=
Debug
;
};
...
...
@@ -555,7 +549,7 @@
PRODUCT_NAME
=
Motion
;
SKIP_INSTALL
=
YES
;
SWIFT_OBJC_INTERFACE_HEADER_NAME
=
"$(SWIFT_MODULE_NAME)-Swift.h"
;
SWIFT_VERSION
=
4.
0
;
SWIFT_VERSION
=
4.
2
;
};
name
=
Release
;
};
...
...
Motion.xcodeproj/xcshareddata/xcschemes/Motion iOS.xcscheme
View file @
a1f023fd
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"
094
0"
LastUpgradeVersion =
"
100
0"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
...
...
Sources/Animator/MotionCoreAnimationViewContext.swift
View file @
a1f023fd
...
...
@@ -257,7 +257,7 @@ fileprivate extension MotionCoreAnimationViewContext {
anim
=
a
}
anim
.
fillMode
=
kCAFillModeB
oth
anim
.
fillMode
=
CAMediaTimingFillMode
.
b
oth
anim
.
isRemovedOnCompletion
=
false
anim
.
beginTime
=
beginTime
...
...
Sources/Extensions/Motion+CALayer.swift
View file @
a1f023fd
...
...
@@ -322,7 +322,7 @@ fileprivate extension CALayer {
}
let
g
=
Motion
.
animate
(
group
:
anims
,
duration
:
duration
)
g
.
fillMode
=
MotionAnimationFillModeToValue
(
mode
:
.
both
)
g
.
fillMode
=
.
both
g
.
isRemovedOnCompletion
=
false
g
.
timingFunction
=
ts
.
timingFunction
...
...
@@ -338,3 +338,8 @@ fileprivate extension CALayer {
}
}
}
// Helper function inserted by Swift 4.2 migrator.
fileprivate
func
convertToCAMediaTimingFillMode
(
_
input
:
String
)
->
CAMediaTimingFillMode
{
return
CAMediaTimingFillMode
(
rawValue
:
input
)
}
Sources/Extensions/Motion+CAMediaTimingFunction.swift
View file @
a1f023fd
...
...
@@ -30,10 +30,10 @@ import UIKit
public
extension
CAMediaTimingFunction
{
// Default
static
let
linear
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionL
inear
)
static
let
easeIn
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionE
aseIn
)
static
let
easeOut
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionE
aseOut
)
static
let
easeInOut
=
CAMediaTimingFunction
(
name
:
kCAMediaTimingFunctionE
aseInEaseOut
)
static
let
linear
=
CAMediaTimingFunction
(
name
:
CAMediaTimingFunctionName
.
l
inear
)
static
let
easeIn
=
CAMediaTimingFunction
(
name
:
CAMediaTimingFunctionName
.
e
aseIn
)
static
let
easeOut
=
CAMediaTimingFunction
(
name
:
CAMediaTimingFunctionName
.
e
aseOut
)
static
let
easeInOut
=
CAMediaTimingFunction
(
name
:
CAMediaTimingFunctionName
.
e
aseInEaseOut
)
// Material
static
let
standard
=
CAMediaTimingFunction
(
controlPoints
:
0.4
,
0.0
,
0.2
,
1.0
)
...
...
Sources/Extensions/Motion+UIViewController.swift
View file @
a1f023fd
...
...
@@ -233,7 +233,7 @@ extension UIViewController {
var
current
:
UIViewController
?
=
self
while
nil
==
target
&&
nil
!=
current
{
if
let
childViewControllers
=
(
current
as?
UINavigationController
)?
.
child
ViewControllers
??
current
!.
navigationController
?
.
childViewControllers
{
if
let
childViewControllers
=
(
current
as?
UINavigationController
)?
.
child
ren
??
current
!.
navigationController
?
.
children
{
for
vc
in
childViewControllers
.
reversed
()
{
if
self
!=
vc
,
withMatchBlock
(
vc
)
{
...
...
@@ -299,7 +299,7 @@ extension UIViewController {
}
if
let
nc
=
navigationController
{
var
v
=
nc
.
child
ViewControllers
var
v
=
nc
.
child
ren
if
!
v
.
isEmpty
{
v
.
removeLast
()
...
...
Sources/Extensions/MotionAnimationFillMode.swift
deleted
100644 → 0
View file @
296684b3
/*
* The MIT License (MIT)
*
* Copyright (C) 2017, Daniel Dahan and 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
* 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:
*
* 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,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import
UIKit
@objc(MotionAnimationFillMode)
public
enum
MotionAnimationFillMode
:
Int
{
case
forwards
case
backwards
case
both
case
removed
}
/**
Converts the MotionAnimationFillMode enum value to a corresponding String.
- Parameter mode: An MotionAnimationFillMode enum value.
*/
public
func
MotionAnimationFillModeToValue
(
mode
:
MotionAnimationFillMode
)
->
String
{
switch
mode
{
case
.
forwards
:
return
kCAFillModeForwards
case
.
backwards
:
return
kCAFillModeBackwards
case
.
both
:
return
kCAFillModeBoth
case
.
removed
:
return
kCAFillModeRemoved
}
}
Sources/Info.plist
View file @
a1f023fd
...
...
@@ -15,7 +15,7 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
FMWK
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.
4.3
<
/string
>
<
string
>
1.
5.0
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
$
(
CURRENT_PROJECT_VERSION
)<
/string
>
<
k
e
y
>
NSPrincipalClass
<
/k
e
y
>
...
...
Sources/Transition/MotionProgressRunner.swift
View file @
a1f023fd
...
...
@@ -72,12 +72,12 @@ class MotionProgressRunner {
self
.
duration
=
duration
displayLink
=
CADisplayLink
(
target
:
self
,
selector
:
#selector(
displayUpdate(_:)
)
)
displayLink
!.
add
(
to
:
RunLoop
.
main
,
forMode
:
RunLoop
Mode
(
rawValue
:
RunLoopMode
.
commonModes
.
rawValue
))
displayLink
!.
add
(
to
:
RunLoop
.
main
,
forMode
:
RunLoop
.
Mode
(
rawValue
:
RunLoop
.
Mode
.
common
.
rawValue
))
}
func
stop
()
{
displayLink
?
.
isPaused
=
true
displayLink
?
.
remove
(
from
:
RunLoop
.
main
,
forMode
:
RunLoop
Mode
(
rawValue
:
RunLoopMode
.
commonModes
.
rawValue
))
displayLink
?
.
remove
(
from
:
RunLoop
.
main
,
forMode
:
RunLoop
.
Mode
(
rawValue
:
RunLoop
.
Mode
.
common
.
rawValue
))
displayLink
=
nil
}
}
Sources/Transition/MotionTransition+UINavigationControllerDelegate.swift
View file @
a1f023fd
...
...
@@ -29,7 +29,7 @@
import
UIKit
extension
MotionTransition
:
UINavigationControllerDelegate
{
public
func
navigationController
(
_
navigationController
:
UINavigationController
,
animationControllerFor
operation
:
UINavigationControllerOperation
,
from
fromVC
:
UIViewController
,
to
toVC
:
UIViewController
)
->
UIViewControllerAnimatedTransitioning
?
{
public
func
navigationController
(
_
navigationController
:
UINavigationController
,
animationControllerFor
operation
:
UINavigationController
.
Operation
,
from
fromVC
:
UIViewController
,
to
toVC
:
UIViewController
)
->
UIViewControllerAnimatedTransitioning
?
{
guard
!
isTransitioning
else
{
return
nil
}
...
...
Sources/Transition/MotionTransition+UITabBarControllerDelegate.swift
View file @
a1f023fd
...
...
@@ -53,8 +53,8 @@ extension MotionTransition: UITabBarControllerDelegate {
state
=
.
notified
let
fromVCIndex
=
tabBarController
.
child
ViewControllers
.
index
(
of
:
fromVC
)
!
let
toVCIndex
=
tabBarController
.
child
ViewControllers
.
index
(
of
:
toVC
)
!
let
fromVCIndex
=
tabBarController
.
child
ren
.
index
(
of
:
fromVC
)
!
let
toVCIndex
=
tabBarController
.
child
ren
.
index
(
of
:
toVC
)
!
isPresenting
=
toVCIndex
>
fromVCIndex
fromViewController
=
fromViewController
??
fromVC
...
...
Sources/Transition/MotionTransition.swift
View file @
a1f023fd
...
...
@@ -207,7 +207,7 @@ extension Motion {
*/
public
class
func
animate
(
group
animations
:
[
CAAnimation
],
timingFunction
:
CAMediaTimingFunction
=
.
easeInOut
,
duration
:
CFTimeInterval
=
0.5
)
->
CAAnimationGroup
{
let
group
=
CAAnimationGroup
()
group
.
fillMode
=
MotionAnimationFillModeToValue
(
mode
:
.
both
)
group
.
fillMode
=
.
both
group
.
isRemovedOnCompletion
=
false
group
.
animations
=
animations
group
.
duration
=
duration
...
...
@@ -722,3 +722,8 @@ internal extension MotionTransition {
}
}
}
// Helper function inserted by Swift 4.2 migrator.
fileprivate
func
convertToCAMediaTimingFillMode
(
_
input
:
String
)
->
CAMediaTimingFillMode
{
return
CAMediaTimingFillMode
(
rawValue
:
input
)
}
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