diff --git a/Example/LiquidFloatingActionButton.xcodeproj/project.pbxproj b/Example/LiquidFloatingActionButton.xcodeproj/project.pbxproj index eef5bf1..b4d7dda 100644 --- a/Example/LiquidFloatingActionButton.xcodeproj/project.pbxproj +++ b/Example/LiquidFloatingActionButton.xcodeproj/project.pbxproj @@ -500,7 +500,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -516,7 +516,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Example/LiquidFloatingActionButton.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/LiquidFloatingActionButton.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/LiquidFloatingActionButton.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/LiquidFloatingActionButton/AppDelegate.swift b/Example/LiquidFloatingActionButton/AppDelegate.swift index c3203f1..57367a6 100644 --- a/Example/LiquidFloatingActionButton/AppDelegate.swift +++ b/Example/LiquidFloatingActionButton/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } diff --git a/Example/LiquidFloatingActionButton/ViewController.swift b/Example/LiquidFloatingActionButton/ViewController.swift index 2dcf8bc..41a62dc 100644 --- a/Example/LiquidFloatingActionButton/ViewController.swift +++ b/Example/LiquidFloatingActionButton/ViewController.swift @@ -42,7 +42,7 @@ public class CustomDrawingActionButton: LiquidFloatingActionButton { override public func createPlusLayer(_ frame: CGRect) -> CAShapeLayer { let plusLayer = CAShapeLayer() - plusLayer.lineCap = kCALineCapRound + plusLayer.lineCap = CAShapeLayerLineCap.round plusLayer.strokeColor = UIColor.white.cgColor plusLayer.lineWidth = 3.0 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index b93eac5..87f270e 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -778,7 +778,7 @@ PRODUCT_NAME = LiquidFloatingActionButton; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -919,7 +919,7 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -984,7 +984,7 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1016,7 +1016,7 @@ PRODUCT_NAME = LiquidFloatingActionButton; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; diff --git a/Pod/Classes/LiquidFloatingActionButton.swift b/Pod/Classes/LiquidFloatingActionButton.swift index abdaa73..838818a 100644 --- a/Pod/Classes/LiquidFloatingActionButton.swift +++ b/Pod/Classes/LiquidFloatingActionButton.swift @@ -115,7 +115,7 @@ open class LiquidFloatingActionButton : UIView { // rotate plus icon CATransaction.setAnimationDuration(0.8) - self.plusLayer.transform = CATransform3DMakeRotation((CGFloat(M_PI) * rotationDegrees) / 180, 0, 0, 1) + self.plusLayer.transform = CATransform3DMakeRotation((CGFloat(Double.pi) * rotationDegrees) / 180, 0, 0, 1) let cells = cellArray() for cell in cells { @@ -151,7 +151,7 @@ open class LiquidFloatingActionButton : UIView { // draw plus shape let plusLayer = CAShapeLayer() - plusLayer.lineCap = kCALineCapRound + plusLayer.lineCap = CAShapeLayerLineCap.round plusLayer.strokeColor = UIColor.white.cgColor plusLayer.lineWidth = 3.0 @@ -262,9 +262,9 @@ class ActionBarBaseView : UIView { func translateY(_ layer: CALayer, duration: CFTimeInterval, f: (CABasicAnimation) -> ()) { let translate = CABasicAnimation(keyPath: "transform.translation.y") f(translate) - translate.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) + translate.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) translate.isRemovedOnCompletion = false - translate.fillMode = kCAFillModeForwards + translate.fillMode = CAMediaTimingFillMode.forwards translate.duration = duration layer.add(translate, forKey: "transYAnim") } @@ -316,7 +316,7 @@ class CircleLiquidBaseView : ActionBarBaseView { func open(_ cells: [LiquidFloatingCell]) { stop() displayLink = CADisplayLink(target: self, selector: #selector(CircleLiquidBaseView.didDisplayRefresh(_:))) - displayLink?.add(to: RunLoop.current, forMode: RunLoopMode.commonModes) + displayLink?.add(to: RunLoop.current, forMode: RunLoop.Mode.common) opening = true for cell in cells { cell.layer.removeAllAnimations() @@ -329,7 +329,7 @@ class CircleLiquidBaseView : ActionBarBaseView { stop() opening = false displayLink = CADisplayLink(target: self, selector: #selector(CircleLiquidBaseView.didDisplayRefresh(_:))) - displayLink?.add(to: RunLoop.current, forMode: RunLoopMode.commonModes) + displayLink?.add(to: RunLoop.current, forMode: RunLoop.Mode.common) for cell in cells { cell.layer.removeAllAnimations() cell.layer.eraseShadow() @@ -375,12 +375,12 @@ class CircleLiquidBaseView : ActionBarBaseView { } if let firstCell = openingCells.first { - bigEngine?.push(circle: baseLiquid!, other: firstCell) + _ = bigEngine?.push(circle: baseLiquid!, other: firstCell) } for i in 1.. CGFloat { - return rad * 180 / CGFloat(M_PI) + return rad * 180 / CGFloat(Double.pi) } static func degToRad(_ deg: CGFloat) -> CGFloat { - return deg * CGFloat(M_PI) / 180 + return deg * CGFloat(Double.pi) / 180 } static func circlePoint(_ center: CGPoint, radius: CGFloat, rad: CGFloat) -> CGPoint { diff --git a/Pod/Classes/LiquittableCircle.swift b/Pod/Classes/LiquittableCircle.swift index c262134..31d7d59 100644 --- a/Pod/Classes/LiquittableCircle.swift +++ b/Pod/Classes/LiquittableCircle.swift @@ -61,7 +61,7 @@ open class LiquittableCircle : UIView { func drawCircle() { let bezierPath = UIBezierPath(ovalIn: CGRect(origin: CGPoint.zero, size: CGSize(width: radius * 2, height: radius * 2))) - draw(bezierPath) + _ = draw(bezierPath) } func draw(_ path: UIBezierPath) -> CAShapeLayer { diff --git a/Pod/Classes/SimpleCircleLiquidEngine.swift b/Pod/Classes/SimpleCircleLiquidEngine.swift index a24bff6..9acb292 100644 --- a/Pod/Classes/SimpleCircleLiquidEngine.swift +++ b/Pod/Classes/SimpleCircleLiquidEngine.swift @@ -70,7 +70,7 @@ class SimpleCircleLiquidEngine { private func circleConnectedPoint(circle: LiquittableCircle, other: LiquittableCircle) -> (CGPoint, CGPoint) { var ratio = circleRatio(circle: circle, other: other) ratio = (ratio + ConnectThresh) / (1.0 + ConnectThresh) - let angle = CGFloat(M_PI_2) * angleOpen * ratio + let angle = CGFloat(Double.pi / 2) * angleOpen * ratio return circleConnectedPoint(circle: circle, other: other, angle: angle) }