Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Animo.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Animo"
s.version = "1.4.0"
s.swift_version = "4.1"
s.version = "1.5.0"
s.swift_version = "5.0"
s.license = "MIT"
s.summary = "Bring life to CALayers with SpriteKit-like animation builders."
s.homepage = "https://github.com/eure/Animo"
Expand Down
30 changes: 22 additions & 8 deletions Animo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -274,16 +274,17 @@
attributes = {
LastSwiftMigration = 0710;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "eure, Inc.";
TargetAttributes = {
B5687D5E1BB45AFC00168B7E = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
B5687D681BB45AFC00168B7E = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
B5F331C21C843944009475AC = {
CreatedOnToolsVersion = 7.2.1;
Expand All @@ -293,10 +294,11 @@
};
buildConfigurationList = B5687D591BB45AFC00168B7E /* Build configuration list for PBXProject "Animo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = B5687D551BB45AFC00168B7E;
productRefGroup = B5687D601BB45AFC00168B7E /* Products */;
Expand Down Expand Up @@ -392,6 +394,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -400,12 +403,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -454,6 +459,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand All @@ -462,12 +468,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -519,7 +527,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -536,29 +544,35 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
B5687D771BB45AFC00168B7E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = AnimoTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = jp.eure.ios.AnimoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
B5687D781BB45AFC00168B7E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = AnimoTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = jp.eure.ios.AnimoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
4 changes: 1 addition & 3 deletions Animo.xcodeproj/xcshareddata/xcschemes/Animo-OSX.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
4 changes: 1 addition & 3 deletions Animo.xcodeproj/xcshareddata/xcschemes/Animo-iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
7 changes: 6 additions & 1 deletion Animo/Internal/CAAnimation+AnimoInternals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ internal extension CAAnimation {
internal func applyOptions(_ options: Options = .default) {

self.speed = Float(options.speed)
self.fillMode = options.fillMode
self.fillMode = convertToCAMediaTimingFillMode(options.fillMode)
self.isRemovedOnCompletion = options.removedOnCompletion
}
}

// Helper function inserted by Swift 4.2 migrator.
fileprivate func convertToCAMediaTimingFillMode(_ input: String) -> CAMediaTimingFillMode {
return CAMediaTimingFillMode(rawValue: input)
}
33 changes: 22 additions & 11 deletions Animo/Internal/Transition+AnimoInternals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,41 @@ internal extension Transition {

switch direction {

case .leftToRight: return kCATransitionFromLeft
case .rightToLeft: return kCATransitionFromRight
case .topToBottom: return kCATransitionFromTop
case .bottomToTop: return kCATransitionFromBottom
case .leftToRight: return convertFromCATransitionSubtype(CATransitionSubtype.fromLeft)
case .rightToLeft: return convertFromCATransitionSubtype(CATransitionSubtype.fromRight)
case .topToBottom: return convertFromCATransitionSubtype(CATransitionSubtype.fromTop)
case .bottomToTop: return convertFromCATransitionSubtype(CATransitionSubtype.fromBottom)
}
}

switch self {

case .fade:
object.type = kCATransitionFade
object.type = CATransitionType.fade
object.subtype = nil

case .moveIn(let direction):
object.type = kCATransitionMoveIn
object.subtype = subtypeForCATransition(direction)
object.type = CATransitionType.moveIn
object.subtype = convertToOptionalCATransitionSubtype(subtypeForCATransition(direction))

case .push(let direction):
object.type = kCATransitionPush
object.subtype = subtypeForCATransition(direction)
object.type = CATransitionType.push
object.subtype = convertToOptionalCATransitionSubtype(subtypeForCATransition(direction))

case .reveal(let direction):
object.type = kCATransitionReveal
object.subtype = subtypeForCATransition(direction)
object.type = CATransitionType.reveal
object.subtype = convertToOptionalCATransitionSubtype(subtypeForCATransition(direction))
}
}
}

// Helper function inserted by Swift 4.2 migrator.
fileprivate func convertFromCATransitionSubtype(_ input: CATransitionSubtype) -> String {
return input.rawValue
}

// Helper function inserted by Swift 4.2 migrator.
fileprivate func convertToOptionalCATransitionSubtype(_ input: String?) -> CATransitionSubtype? {
guard let input = input else { return nil }
return CATransitionSubtype(rawValue: input)
}
13 changes: 9 additions & 4 deletions Animo/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public struct Options {

switch fillMode {

case FillMode.forwards: return kCAFillModeForwards
case FillMode.backwards: return kCAFillModeBackwards
case FillMode.both: return kCAFillModeBoth
default: return kCAFillModeRemoved
case FillMode.forwards: return convertFromCAMediaTimingFillMode(CAMediaTimingFillMode.forwards)
case FillMode.backwards: return convertFromCAMediaTimingFillMode(CAMediaTimingFillMode.backwards)
case FillMode.both: return convertFromCAMediaTimingFillMode(CAMediaTimingFillMode.both)
default: return convertFromCAMediaTimingFillMode(CAMediaTimingFillMode.removed)
}
}

Expand All @@ -75,3 +75,8 @@ public struct Options {
internal let fillMode: String
internal let removedOnCompletion: Bool
}

// Helper function inserted by Swift 4.2 migrator.
fileprivate func convertFromCAMediaTimingFillMode(_ input: CAMediaTimingFillMode) -> String {
return input.rawValue
}
8 changes: 4 additions & 4 deletions Animo/TimingMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public enum TimingMode {

switch self {

case .linear: return CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
case .easeIn: return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
case .easeOut: return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
case .easeInOut: return CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
case .linear: return CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
case .easeIn: return CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeIn)
case .easeOut: return CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut)
case .easeInOut: return CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
case .spring(let damping): return CAMediaTimingFunction(controlPoints: 0.5, 1.1 + (Float(damping) / 3.0), 1, 1)
case .discrete: return CAMediaTimingFunction(controlPoints: 1, 0, 1, 1)

Expand Down