diff --git a/.swift-version b/.swift-version index 9f55b2c..5186d07 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 +4.0 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6da499e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: swift +xcode_project: Anima.xcodeproj # path to your xcodeproj folder +xcode_scheme: Anima +osx_image: xcode9 diff --git a/Anima.framework.zip b/Anima.framework.zip new file mode 100644 index 0000000..bb32a7d Binary files /dev/null and b/Anima.framework.zip differ diff --git a/Anima.podspec b/Anima.podspec index 407efc8..6ea0079 100644 --- a/Anima.podspec +++ b/Anima.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Anima" - s.version = "0.5.1" + s.version = "0.8.0" s.authors = { "satoshin21" => "satoshi.nagasaka21@gmail.com" } s.homepage = "https://github.com/satoshin21/Anima" s.summary = "Anima is swifty animation library." @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/satoshin21/Anima.git", :tag => s.version.to_s } s.source_files = "Sources/*{.swift,.h}" s.pod_target_xcconfig = { - 'SWIFT_VERSION' => '3.0', + 'SWIFT_VERSION' => '4.0', } s.description = <<-DESC Anima is chainable Layer-Based Animation library for Swift3. diff --git a/Anima.xcodeproj/project.pbxproj b/Anima.xcodeproj/project.pbxproj index 2a30353..34a72ec 100644 --- a/Anima.xcodeproj/project.pbxproj +++ b/Anima.xcodeproj/project.pbxproj @@ -204,16 +204,17 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = satoshin21; TargetAttributes = { 63A950B81EAFAB6C007AFB34 = { CreatedOnToolsVersion = 8.3.2; - LastSwiftMigration = 0830; + LastSwiftMigration = 0900; ProvisioningStyle = Automatic; }; 63A950C71EAFAB92007AFB34 = { CreatedOnToolsVersion = 8.3.2; + LastSwiftMigration = 0900; ProvisioningStyle = Automatic; }; }; @@ -305,7 +306,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -313,7 +316,11 @@ 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_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -359,7 +366,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -367,7 +376,11 @@ 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_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -413,7 +426,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -433,7 +447,8 @@ PRODUCT_BUNDLE_IDENTIFIER = jp.hatenadiary.satoshin21.anima; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -446,7 +461,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.hatenadiary.satoshin21.anima.example; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 1; }; name = Debug; @@ -460,7 +476,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.hatenadiary.satoshin21.anima.example; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 1; }; name = Release; diff --git a/Anima.xcodeproj/xcshareddata/xcschemes/Anima.xcscheme b/Anima.xcodeproj/xcshareddata/xcschemes/Anima.xcscheme index 50d5505..48bf937 100644 --- a/Anima.xcodeproj/xcshareddata/xcschemes/Anima.xcscheme +++ b/Anima.xcodeproj/xcshareddata/xcschemes/Anima.xcscheme @@ -1,6 +1,6 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.5.1 + 0.8.0 CFBundleVersion 2 LSRequiresIPhoneOS @@ -30,11 +30,15 @@ armv7 + UIStatusBarStyle + UIStatusBarStyleLightContent UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIViewControllerBasedStatusBarAppearance + diff --git a/Example/LaunchScreen.storyboard b/Example/LaunchScreen.storyboard index 903e1d5..96583df 100644 --- a/Example/LaunchScreen.storyboard +++ b/Example/LaunchScreen.storyboard @@ -1,10 +1,11 @@ - + - + + @@ -27,7 +28,7 @@ - + diff --git a/Example/Main.storyboard b/Example/Main.storyboard index 6d5de47..e5c5db4 100644 --- a/Example/Main.storyboard +++ b/Example/Main.storyboard @@ -1,19 +1,25 @@ - + - + + + + + AvenirNext-Medium + + - + @@ -98,7 +104,7 @@ - + @@ -118,12 +124,12 @@ - + - + @@ -159,7 +165,7 @@ - + @@ -220,7 +226,7 @@ - + @@ -283,7 +289,7 @@ - + @@ -326,7 +332,7 @@ - + @@ -361,7 +367,7 @@ - + @@ -408,8 +414,8 @@ - - + + diff --git a/Example/MoveViewController.swift b/Example/MoveViewController.swift index 31af7fc..1b50043 100644 --- a/Example/MoveViewController.swift +++ b/Example/MoveViewController.swift @@ -32,7 +32,7 @@ class MoveViewController: UIViewController { // Dispose of any resources that can be recreated. } - func anywhereTapped(gesture: UITapGestureRecognizer) { + @objc func anywhereTapped(gesture: UITapGestureRecognizer) { let location = gesture.location(in: self.view) animaView.layer.anima diff --git a/Example/SpreadViewController.swift b/Example/SpreadViewController.swift index ba0f192..c823550 100644 --- a/Example/SpreadViewController.swift +++ b/Example/SpreadViewController.swift @@ -66,6 +66,7 @@ class SpreadViewController: UIViewController { }) } + @objc func segueList() { performSegue(withIdentifier: "segueList", sender: nil) } diff --git a/README.md b/README.md index 30a0ca1..ed8468b 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,20 @@ [![License](https://img.shields.io/cocoapods/l/Anima.svg?style=flat)](http://cocoapods.org/pods/Anima) [![Platform](https://img.shields.io/cocoapods/p/Anima.svg?style=flat)](http://cocoapods.org/pods/Anima) ![language](https://img.shields.io/badge/Language-Swift3-8E44AD.svg) +![language](https://img.shields.io/badge/Language-Swift4-8E44AD.svg) +![Version](https://img.shields.io/badge/Pod-%20v2.0.1%20-96281B.svg) ![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg) ![MIT License](https://img.shields.io/github/license/mashape/apistatus.svg) ![Platform](https://img.shields.io/badge/platform-%20iOS%20-lightgrey.svg) +![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)

# Anima -Anima is chainable Layer-Based Animation library for Swift3.
-It support to make sequential and grouped animation more easily. +Anima is chainable Layer-Based Animation library for Swift4.
+It support to make sequensial and grouped animation more easily. @@ -31,7 +34,7 @@ animaView.layer.anima .then(group: moveAnimations, options: labelAnimaOption(index: 2)) .then(group: moveAnimations, options: labelAnimaOption(index: 3)) .then(group: endAnimations, options: labelAnimaOption(index: 4)) - .then(group: [.scaleBy(0.0), AnimaType.opacity(0.0)]) + .then(group: [.scaleBy(0.0), .opacity(0.0)]) func labelAnimaOption(index: Int) -> [AnimaOption] { let labelAnima = labels[index]?.layer.anima @@ -43,13 +46,16 @@ func labelAnimaOption(index: Int) -> [AnimaOption] { ``` ## Requirements -Anima require for Swift3 iOS9.0📱
+Anima require for Swift4, 3 and greater than iOS9.0📱
-Sorry, Anima is not support macOS. -But I'm going to support it soon 💪 +### Anima version / Swift version +Anima support Swift 3 and Swift 4. + +Latest version is developed with Swift 4, +So if you want to use Anima with Swift 3, please specify Anima version to `0.5.1`. ## Features -* All timing modes from [easings.set](http://easings.net/) are implemented. +* Almost all timing modes from [easings.set](http://easings.net/) are implemented. * Spring Animation ( featured by [CASpringAnimation](https://developer.apple.com/reference/quartzcore/caspringanimation) ) * Type-Safed Animation KeyPath () @@ -168,7 +174,7 @@ layer.anima ## Example To run the example project, clone the repo, open `Anima.xcodeproj`, and run target `Anima iOS Example`. - + ## Installation ### Cocoapods @@ -177,6 +183,10 @@ it, simply add the following line to your Podfile: ```ruby pod "Anima" + +# If you want to use Swift 3 version, Please specify Anima version. + +pod "Anima", "0.5.1" ``` ### Carthage diff --git a/Sources/AnimaNode.swift b/Sources/AnimaNode.swift index 28705fb..b826ae9 100644 --- a/Sources/AnimaNode.swift +++ b/Sources/AnimaNode.swift @@ -52,7 +52,7 @@ internal struct AnimaNode { animations.forEach({$0.duration = duration}) group.duration = duration - } else if let duration = animations.max(by: { $0.0.duration > $0.1.duration } )?.duration { + } else if let duration = animations.max(by: { $0.duration > $1.duration } )?.duration { group.duration = duration } diff --git a/Sources/Info.plist b/Sources/Info.plist index 393e2ed..ebf74fa 100644 --- a/Sources/Info.plist +++ b/Sources/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.5.1 + 0.8.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass