diff --git a/Cartfile b/Cartfile index afc5f1e..176f310 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "RamonGilabert/Walker" "master" +github "RamonGilabert/Walker" "swift-3" diff --git a/Cartfile.resolved b/Cartfile.resolved index 3f19692..ab0bfb7 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "RamonGilabert/Walker" "2b98a312810756f4c92c8f7cf1c8cb3a5c800e84" +github "RamonGilabert/Walker" "47b9490594e29fea29ba6ce0b53763da3ccecc77" diff --git a/Demo/Morgan/Morgan/AppDelegate.swift b/Demo/Morgan/Morgan/AppDelegate.swift index 41fa018..d99a14d 100644 --- a/Demo/Morgan/Morgan/AppDelegate.swift +++ b/Demo/Morgan/Morgan/AppDelegate.swift @@ -7,9 +7,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { window = UIWindow() - window?.frame = UIScreen.mainScreen().bounds + window?.frame = UIScreen.main.bounds window?.rootViewController = controller window?.makeKeyAndVisible() diff --git a/Demo/Morgan/Morgan/ViewController.swift b/Demo/Morgan/Morgan/ViewController.swift index d6ba634..a7168d7 100644 --- a/Demo/Morgan/Morgan/ViewController.swift +++ b/Demo/Morgan/Morgan/ViewController.swift @@ -10,10 +10,10 @@ class ViewController: UIViewController { lazy var animationView: UIView = { let view = UIView() - view.backgroundColor = UIColor.whiteColor() + view.backgroundColor = UIColor.white view.translatesAutoresizingMaskIntoConstraints = false view.layer.cornerRadius = 7.5 - view.layer.shadowColor = UIColor.blackColor().colorWithAlphaComponent(0.15).CGColor + view.layer.shadowColor = UIColor.black.withAlphaComponent(0.15).cgColor view.layer.shadowOffset.height = 5 view.layer.shadowRadius = 5 view.layer.shadowOpacity = 1 @@ -24,8 +24,8 @@ class ViewController: UIViewController { lazy var codeLabel: UILabel = { let label = UILabel() label.font = UIFont(name: "Menlo-Regular", size: 16) - label.textColor = UIColor.whiteColor() - label.textAlignment = .Center + label.textColor = UIColor.white + label.textAlignment = .center label.text = "Tap the view to animate" label.translatesAutoresizingMaskIntoConstraints = false @@ -34,7 +34,7 @@ class ViewController: UIViewController { lazy var tapGesture: UITapGestureRecognizer = { [unowned self] in let gesture = UITapGestureRecognizer() - gesture.addTarget(self, action: "handleTapGesture") + gesture.addTarget(self, action: #selector(ViewController.handleTapGesture)) return gesture }() @@ -85,20 +85,20 @@ class ViewController: UIViewController { // MARK: - Configuration func setupConstraints() { - NSLayoutConstraint.activateConstraints([ - codeLabel.centerXAnchor.constraintEqualToAnchor(view.centerXAnchor), - codeLabel.centerYAnchor.constraintGreaterThanOrEqualToAnchor(animationView.topAnchor, constant: -75), - - animationView.widthAnchor.constraintEqualToConstant(Dimensions.viewSize), - animationView.heightAnchor.constraintEqualToConstant(Dimensions.viewSize), - animationView.centerXAnchor.constraintEqualToAnchor(view.centerXAnchor), - animationView.centerYAnchor.constraintGreaterThanOrEqualToAnchor(view.centerYAnchor, constant: -120) + NSLayoutConstraint.activate([ + codeLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor), + codeLabel.centerYAnchor.constraint(greaterThanOrEqualTo: animationView.topAnchor, constant: -75), + + animationView.widthAnchor.constraint(equalToConstant: Dimensions.viewSize), + animationView.heightAnchor.constraint(equalToConstant: Dimensions.viewSize), + animationView.centerXAnchor.constraint(equalTo: view.centerXAnchor), + animationView.centerYAnchor.constraint(greaterThanOrEqualTo: view.centerYAnchor, constant: -120) ]) } // MARK: - Helper methods - override func preferredStatusBarStyle() -> UIStatusBarStyle { - return .LightContent + override var preferredStatusBarStyle : UIStatusBarStyle { + return .lightContent } } diff --git a/Demo/Morgan/MorganDemo.xcodeproj/project.pbxproj b/Demo/Morgan/MorganDemo.xcodeproj/project.pbxproj index 115b234..19b48c5 100644 --- a/Demo/Morgan/MorganDemo.xcodeproj/project.pbxproj +++ b/Demo/Morgan/MorganDemo.xcodeproj/project.pbxproj @@ -11,19 +11,20 @@ 292D71F91C94A8B600CFC060 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 292D71F81C94A8B600CFC060 /* ViewController.swift */; }; 292D71FE1C94A8B600CFC060 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 292D71FD1C94A8B600CFC060 /* Assets.xcassets */; }; 292D72011C94A8B600CFC060 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 292D71FF1C94A8B600CFC060 /* LaunchScreen.storyboard */; }; - 45579E752024A00F64B9AF8F /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A432EA12B87936021380A1BC /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + CB83812CBA247881C2F5C6D4 /* Pods_MorganDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A30B468D350C63FCF4B883AD /* Pods_MorganDemo.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 292D71F31C94A8B600CFC060 /* MorganDemoDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MorganDemoDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 292D71F31C94A8B600CFC060 /* MorganDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MorganDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 292D71F61C94A8B600CFC060 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 292D71F81C94A8B600CFC060 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 292D71FD1C94A8B600CFC060 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 292D72001C94A8B600CFC060 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 292D72021C94A8B600CFC060 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 770E2BDA39EF0F869117FDED /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + 3FC181F93B1C398BBFEB973D /* Pods-MorganDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MorganDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-MorganDemo/Pods-MorganDemo.release.xcconfig"; sourceTree = ""; }; + A30B468D350C63FCF4B883AD /* Pods_MorganDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MorganDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A432EA12B87936021380A1BC /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - DA319F3D60C66C06465AD417 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + FE0392565841E703803D9D17 /* Pods-MorganDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MorganDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MorganDemo/Pods-MorganDemo.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -31,7 +32,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 45579E752024A00F64B9AF8F /* Pods.framework in Frameworks */, + CB83812CBA247881C2F5C6D4 /* Pods_MorganDemo.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -43,15 +44,15 @@ children = ( 292D71F51C94A8B600CFC060 /* Morgan */, 292D71F41C94A8B600CFC060 /* Products */, - 6E414493080EC22AA7FAFCB8 /* Pods */, 9DDF929442EE3A071541D37B /* Frameworks */, + C00DA1E61423DD9B1103818A /* Pods */, ); sourceTree = ""; }; 292D71F41C94A8B600CFC060 /* Products */ = { isa = PBXGroup; children = ( - 292D71F31C94A8B600CFC060 /* MorganDemoDemo.app */, + 292D71F31C94A8B600CFC060 /* MorganDemo.app */, ); name = Products; sourceTree = ""; @@ -68,44 +69,45 @@ path = Morgan; sourceTree = ""; }; - 6E414493080EC22AA7FAFCB8 /* Pods */ = { + 9DDF929442EE3A071541D37B /* Frameworks */ = { isa = PBXGroup; children = ( - DA319F3D60C66C06465AD417 /* Pods.debug.xcconfig */, - 770E2BDA39EF0F869117FDED /* Pods.release.xcconfig */, + A432EA12B87936021380A1BC /* Pods.framework */, + A30B468D350C63FCF4B883AD /* Pods_MorganDemo.framework */, ); - name = Pods; + name = Frameworks; sourceTree = ""; }; - 9DDF929442EE3A071541D37B /* Frameworks */ = { + C00DA1E61423DD9B1103818A /* Pods */ = { isa = PBXGroup; children = ( - A432EA12B87936021380A1BC /* Pods.framework */, + FE0392565841E703803D9D17 /* Pods-MorganDemo.debug.xcconfig */, + 3FC181F93B1C398BBFEB973D /* Pods-MorganDemo.release.xcconfig */, ); - name = Frameworks; + name = Pods; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 292D71F21C94A8B600CFC060 /* MorganDemoDemo */ = { + 292D71F21C94A8B600CFC060 /* MorganDemo */ = { isa = PBXNativeTarget; - buildConfigurationList = 292D72051C94A8B600CFC060 /* Build configuration list for PBXNativeTarget "MorganDemoDemo" */; + buildConfigurationList = 292D72051C94A8B600CFC060 /* Build configuration list for PBXNativeTarget "MorganDemo" */; buildPhases = ( - 2CFA418D57C4ADD17770DB1B /* Check Pods Manifest.lock */, + 418DBD9A9BA5C9321B6B74D4 /* [CP] Check Pods Manifest.lock */, 292D71EF1C94A8B600CFC060 /* Sources */, 292D71F01C94A8B600CFC060 /* Frameworks */, 292D71F11C94A8B600CFC060 /* Resources */, - 93C696F91B64E99F59243A22 /* Embed Pods Frameworks */, - 1B5EF2CFF7354A6DB658D736 /* Copy Pods Resources */, + 8DE9FBB88DEB46D68BFAAD1F /* [CP] Embed Pods Frameworks */, + F0FF4046365805FB3156ED9B /* [CP] Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); - name = MorganDemoDemo; + name = MorganDemo; productName = Morgan; - productReference = 292D71F31C94A8B600CFC060 /* MorganDemoDemo.app */; + productReference = 292D71F31C94A8B600CFC060 /* MorganDemo.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -115,11 +117,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0800; ORGANIZATIONNAME = RamonGilabert; TargetAttributes = { 292D71F21C94A8B600CFC060 = { CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; }; }; }; @@ -136,7 +139,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 292D71F21C94A8B600CFC060 /* MorganDemoDemo */, + 292D71F21C94A8B600CFC060 /* MorganDemo */, ); }; /* End PBXProject section */ @@ -154,49 +157,49 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1B5EF2CFF7354A6DB658D736 /* Copy Pods Resources */ = { + 418DBD9A9BA5C9321B6B74D4 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - 2CFA418D57C4ADD17770DB1B /* Check Pods Manifest.lock */ = { + 8DE9FBB88DEB46D68BFAAD1F /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MorganDemo/Pods-MorganDemo-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 93C696F91B64E99F59243A22 /* Embed Pods Frameworks */ = { + F0FF4046365805FB3156ED9B /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MorganDemo/Pods-MorganDemo-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -238,8 +241,10 @@ 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -282,8 +287,10 @@ 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -302,31 +309,36 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; }; 292D72061C94A8B600CFC060 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DA319F3D60C66C06465AD417 /* Pods.debug.xcconfig */; + baseConfigurationReference = FE0392565841E703803D9D17 /* Pods-MorganDemo.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Morgan/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.RamonGilabert.Morgan; - PRODUCT_NAME = MorganDemoDemo; + PRODUCT_NAME = MorganDemo; + SWIFT_VERSION = 3.0; }; name = Debug; }; 292D72071C94A8B600CFC060 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 770E2BDA39EF0F869117FDED /* Pods.release.xcconfig */; + baseConfigurationReference = 3FC181F93B1C398BBFEB973D /* Pods-MorganDemo.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Morgan/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.RamonGilabert.Morgan; - PRODUCT_NAME = MorganDemoDemo; + PRODUCT_NAME = MorganDemo; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -342,7 +354,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 292D72051C94A8B600CFC060 /* Build configuration list for PBXNativeTarget "MorganDemoDemo" */ = { + 292D72051C94A8B600CFC060 /* Build configuration list for PBXNativeTarget "MorganDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( 292D72061C94A8B600CFC060 /* Debug */, diff --git a/Demo/Morgan/Podfile b/Demo/Morgan/Podfile index 208b837..fa6b439 100644 --- a/Demo/Morgan/Podfile +++ b/Demo/Morgan/Podfile @@ -3,4 +3,5 @@ use_frameworks! platform :ios, '8.0' pod 'Morgan', path: '../../' -pod 'Walker', git: 'https://www.github.com/RamonGilabert/Walker' +pod 'Walker', git: 'https://www.github.com/RamonGilabert/Walker', :branch => 'swift-3' +target 'MorganDemo' diff --git a/Demo/Morgan/Podfile.lock b/Demo/Morgan/Podfile.lock index 802369d..1452f72 100644 --- a/Demo/Morgan/Podfile.lock +++ b/Demo/Morgan/Podfile.lock @@ -1,25 +1,28 @@ PODS: - - Morgan (0.9): + - Morgan (0.9.1): - Walker - - Walker (0.9) + - Walker (0.9.1) DEPENDENCIES: - Morgan (from `../../`) - - Walker (from `https://www.github.com/RamonGilabert/Walker`) + - Walker (from `https://www.github.com/RamonGilabert/Walker`, branch `swift-3`) EXTERNAL SOURCES: Morgan: - :path: ../../ + :path: "../../" Walker: + :branch: swift-3 :git: https://www.github.com/RamonGilabert/Walker CHECKOUT OPTIONS: Walker: - :commit: 7a06bc367203aa687c71ab00e834206724fc59ba + :commit: 47b9490594e29fea29ba6ce0b53763da3ccecc77 :git: https://www.github.com/RamonGilabert/Walker SPEC CHECKSUMS: - Morgan: a87ce46d516b79b92a781fa45e1bd0735b912ab3 - Walker: a9401362364ed7fb4e816b1946ca44bc8e233f9a + Morgan: 9cb6cdfd5eaafcdc98af5c05620cad575ace77de + Walker: 9a765e7f35adb19ce59079e26d425c1e8c463241 -COCOAPODS: 0.39.0.beta.4 +PODFILE CHECKSUM: 1e42c290945760aff81f50b01bf8d0e82df4984d + +COCOAPODS: 1.0.1 diff --git a/Morgan.xcodeproj/project.pbxproj b/Morgan.xcodeproj/project.pbxproj index 56860a1..fa09732 100644 --- a/Morgan.xcodeproj/project.pbxproj +++ b/Morgan.xcodeproj/project.pbxproj @@ -109,11 +109,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0800; ORGANIZATIONNAME = "Hyper Interaktiv AS"; TargetAttributes = { D5B2E89E1C3A780C00C0327D = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0800; }; }; }; @@ -188,8 +189,10 @@ 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -217,6 +220,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -236,8 +240,10 @@ 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_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -257,6 +263,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -268,6 +276,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -284,6 +293,7 @@ PRODUCT_NAME = Morgan; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -291,6 +301,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -306,6 +317,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.RamonGilabert.Morgan; PRODUCT_NAME = Morgan; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/Morgan.xcodeproj/xcshareddata/xcschemes/Morgan.xcscheme b/Morgan.xcodeproj/xcshareddata/xcschemes/Morgan.xcscheme index bb261ec..5a7c645 100644 --- a/Morgan.xcodeproj/xcshareddata/xcschemes/Morgan.xcscheme +++ b/Morgan.xcodeproj/xcshareddata/xcschemes/Morgan.xcscheme @@ -1,6 +1,6 @@ ())? = nil) { + public func buttonDown(_ completion: (() -> ())? = nil) { guard let imageView = imageView else { return } imageView.pushDown(completion: { @@ -11,7 +11,7 @@ public extension UIButton { }) } - public func buttonUp(completion: (() -> ())? = nil) { + public func buttonUp(_ completion: (() -> ())? = nil) { guard let imageView = imageView else { return } imageView.pushUp(completion: { diff --git a/Sources/Morgan+UIView.swift b/Sources/Morgan+UIView.swift index f850668..6f22d81 100644 --- a/Sources/Morgan+UIView.swift +++ b/Sources/Morgan+UIView.swift @@ -3,18 +3,18 @@ import Walker public extension UIView { - public func shake(landscape: Bool = true, duration: NSTimeInterval = 0.075, completion: (() -> ())? = nil) { + public func shake(_ landscape: Bool = true, duration: TimeInterval = 0.075, completion: (() -> ())? = nil) { let x: CGFloat = landscape ? 25 : 0 let y: CGFloat = landscape ? 0 : 25 animate(self, duration: duration) { - $0.transform = CGAffineTransformMakeTranslation(-x, -y) + $0.transform = CGAffineTransform(translationX: -x, y: -y) }.chain(duration: duration) { - $0.transform = CGAffineTransformMakeTranslation(x, y) + $0.transform = CGAffineTransform(translationX: x, y: y) }.chain(duration: duration) { - $0.transform = CGAffineTransformMakeTranslation(-x / 2, -y / 2) + $0.transform = CGAffineTransform(translationX: -x / 2, y: -y / 2) }.chain(duration: duration) { - $0.transform = CGAffineTransformIdentity + $0.transform = CGAffineTransform.identity }.finally { completion?() } @@ -22,8 +22,8 @@ public extension UIView { // MARK: - Float - public func levitate(duration: NSTimeInterval = 0.5, times: Float = Float.infinity, completion: (() -> ())? = nil) { - animate(self, duration: duration, options: [.Reverse, .Repeat(times)]) { + public func levitate(_ duration: TimeInterval = 0.5, times: Float = Float.infinity, completion: (() -> ())? = nil) { + animate(self, duration: duration, options: [.reverse, .repeat(times)]) { $0.transform3D = CATransform3DMakeScale(0.97, 0.97, 0.97) }.finally { completion?() @@ -32,35 +32,35 @@ public extension UIView { // MARK: - Push - public func pushDown(duration: NSTimeInterval = 0.15, completion: (() -> ())? = nil) { + public func pushDown(_ duration: TimeInterval = 0.15, completion: (() -> ())? = nil) { animate(self, duration: duration) { - $0.transform = CGAffineTransformMakeScale(0.9, 0.9) + $0.transform = CGAffineTransform(scaleX: 0.9, y: 0.9) }.chain(duration: duration / 2) { - $0.transform = CGAffineTransformMakeScale(1.1, 1.1) + $0.transform = CGAffineTransform(scaleX: 1.1, y: 1.1) }.chain(duration: duration / 2) { - $0.transform = CGAffineTransformIdentity + $0.transform = CGAffineTransform.identity }.finally { completion?() } } - public func pushUp(duration: NSTimeInterval = 0.2, completion: (() -> ())? = nil) { + public func pushUp(_ duration: TimeInterval = 0.2, completion: (() -> ())? = nil) { animate(self, duration: duration) { - $0.transform = CGAffineTransformMakeScale(1.1, 1.1) + $0.transform = CGAffineTransform(scaleX: 1.1, y: 1.1) }.chain(duration: duration / 2) { - $0.transform = CGAffineTransformMakeScale(0.9, 0.9) + $0.transform = CGAffineTransform(scaleX: 0.9, y: 0.9) }.chain(duration: duration / 2) { - $0.transform = CGAffineTransformIdentity + $0.transform = CGAffineTransform.identity }.finally { completion?() } } - public func peek(completion: (() -> ())? = nil) { + public func peek(_ completion: (() -> ())? = nil) { layer.transform = CATransform3DMakeScale(0.01, 0.01, 1) spring(self, delay: 0.01, spring: 100, friction: 10, mass: 10) { - $0.transform = CGAffineTransformIdentity + $0.transform = CGAffineTransform.identity }.finally { completion?() } @@ -68,7 +68,7 @@ public extension UIView { // MARK: - Fade - public func fade(appear: Bool = false, duration: NSTimeInterval = 0.4, + public func fade(_ appear: Bool = false, duration: TimeInterval = 0.4, remove: Bool = false, completion: (() -> ())? = nil) { animate(self, duration: duration) { @@ -82,21 +82,21 @@ public extension UIView { // MARK: - Transformations - public func morph(duration: NSTimeInterval = 0.2, completion: (() -> ())? = nil) { + public func morph(_ duration: TimeInterval = 0.2, completion: (() -> ())? = nil) { animate(self, duration: duration) { - $0.transform = CGAffineTransformMakeScale(1.3, 0.7) + $0.transform = CGAffineTransform(scaleX: 1.3, y: 0.7) }.chain(duration: duration) { - $0.transform = CGAffineTransformMakeScale(0.7, 1.3) + $0.transform = CGAffineTransform(scaleX: 0.7, y: 1.3) }.chain(duration: duration) { - $0.transform = CGAffineTransformMakeScale(1.2, 0.8) + $0.transform = CGAffineTransform(scaleX: 1.2, y: 0.8) }.chain(spring: 100, friction: 10, mass: 10) { - $0.transform = CGAffineTransformIdentity + $0.transform = CGAffineTransform.identity }.finally { completion?() } } - public func swing(duration: NSTimeInterval = 0.075, completion: (() -> ())? = nil) { + public func swing(_ duration: TimeInterval = 0.075, completion: (() -> ())? = nil) { animate(self, duration: duration) { $0.transform3D = CATransform3DMakeRotation(0.25, 0, 0, 1) }.chain(duration: duration) { @@ -104,7 +104,7 @@ public extension UIView { }.chain(duration: duration) { $0.transform3D = CATransform3DMakeRotation(0.1, 0, 0, 1) }.chain(duration: duration) { - $0.transform = CGAffineTransformIdentity + $0.transform = CGAffineTransform.identity }.finally { completion?() } @@ -112,7 +112,7 @@ public extension UIView { // MARK: - Fall - public func fall(duration: NSTimeInterval = 0.15, reset: Bool = false, completion: (() -> ())? = nil) { + public func fall(_ duration: TimeInterval = 0.15, reset: Bool = false, completion: (() -> ())? = nil) { let initialAnchor = layer.anchorPoint let initialOrigin = layer.frame.origin @@ -128,7 +128,7 @@ public extension UIView { }.chain(duration: duration / 1.2) { $0.transform3D = CATransform3DMakeRotation(0.25, 0, 0, 1) }.chain(delay: 0.25, duration: duration * 4.5) { - $0.transform = CGAffineTransformMakeTranslation(0, 1000) + $0.transform = CGAffineTransform(translationX: 0, y: 1000) }.finally { if reset { self.layer.anchorPoint = initialAnchor @@ -142,12 +142,12 @@ public extension UIView { // MARK: - Flip - public func flip(duration: NSTimeInterval = 0.5, vertical: Bool = true, completion: (() -> ())? = nil) { + public func flip(_ duration: TimeInterval = 0.5, vertical: Bool = true, completion: (() -> ())? = nil) { let initialZ = layer.zPosition let x: CGFloat = vertical ? 0 : 1 let y: CGFloat = vertical ? 1 : 0 - transform = CGAffineTransformIdentity + transform = CGAffineTransform.identity layer.zPosition = 400 var perspective = CATransform3DIdentity @@ -171,10 +171,10 @@ public extension UIView { // MARK: - Appear - public func slide(duration: NSTimeInterval = 0.5, - fade: Bool = true, origin: CGPoint = CGPointZero, completion: (() -> ())? = nil) { + public func slide(_ duration: TimeInterval = 0.5, + fade: Bool = true, origin: CGPoint = CGPoint.zero, completion: (() -> ())? = nil) { - let point = origin == CGPointZero ? layer.frame.origin : origin + let point = origin == CGPoint.zero ? layer.frame.origin : origin let anchorPoint = layer.anchorPoint let initialOrigin = layer.frame.origin @@ -203,7 +203,7 @@ public extension UIView { // MARK: - Disappear - public func disappear(duration: NSTimeInterval = 0.5, reset: Bool = false, completion: (() -> ())? = nil) { + public func disappear(_ duration: TimeInterval = 0.5, reset: Bool = false, completion: (() -> ())? = nil) { let anchorPoint = layer.anchorPoint layer.anchorPoint = CGPoint(x: 0, y: 0) @@ -212,9 +212,9 @@ public extension UIView { y: layer.frame.origin.y - layer.frame.size.height / 2) animate(self, duration: 0.1) { - $0.transform = CGAffineTransformMakeTranslation(-15, 0) + $0.transform = CGAffineTransform(translationX: -15, y: 0) }.chain(duration: duration) { - $0.transform = CGAffineTransformMakeTranslation(500, 0) + $0.transform = CGAffineTransform(translationX: 500, y: 0) }.finally { self.layer.anchorPoint = anchorPoint self.layer.frame.origin = CGPoint( @@ -231,11 +231,11 @@ public extension UIView { // MARK: - Zoom - public func zoom(duration: NSTimeInterval = 0.5, zoomOut: Bool = true, completion: (() -> ())? = nil) { + public func zoom(_ duration: TimeInterval = 0.5, zoomOut: Bool = true, completion: (() -> ())? = nil) { if zoomOut { animate(self) { - $0.transform = CGAffineTransformMakeScale(3, 3) + $0.transform = CGAffineTransform(scaleX: 3, y: 3) $0.alpha = 0 }.finally { completion?() @@ -244,7 +244,7 @@ public extension UIView { layer.transform = CATransform3DMakeScale(0.01, 0.01, 1) spring(self, spring: 75, friction: 10, mass: 10) { - $0.transform = CGAffineTransformIdentity + $0.transform = CGAffineTransform.identity }.finally { completion?() } diff --git a/Sources/Morgan.swift b/Sources/Morgan.swift index 863b051..a1c0b8b 100644 --- a/Sources/Morgan.swift +++ b/Sources/Morgan.swift @@ -4,16 +4,16 @@ public struct Morgan { // MARK: - Transitions - public static func flip(view: T, subview: T, - right: Bool = true, duration: NSTimeInterval = 0.6, + public static func flip(_ view: T, subview: T, + right: Bool = true, duration: TimeInterval = 0.6, completion: (() -> ())? = nil) { let options: UIViewAnimationOptions = right - ? .TransitionFlipFromRight : .TransitionFlipFromLeft + ? .transitionFlipFromRight : .transitionFlipFromLeft - UIView.transitionFromView(view, toView: subview, + UIView.transition(from: view, to: subview, duration: duration, options: [options, - .BeginFromCurrentState, .OverrideInheritedOptions], + .beginFromCurrentState, .overrideInheritedOptions], completion: { _ in completion?() })