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 Example/LiquidFloatingActionButton.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Example/LiquidFloatingActionButton/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion Example/LiquidFloatingActionButton/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions Pod/Classes/LiquidFloatingActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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")
}
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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..<openingCells.count {
let prev = openingCells[i - 1]
let cell = openingCells[i]
engine?.push(circle: prev, other: cell)
_ = engine?.push(circle: prev, other: cell)
}
engine?.draw(parent: baseLiquid!)
bigEngine?.draw(parent: baseLiquid!)
Expand Down Expand Up @@ -437,7 +437,7 @@ class CircleLiquidBaseView : ActionBarBaseView {
return -1 * t * (t - 2)
}

func didDisplayRefresh(_ displayLink: CADisplayLink) {
@objc func didDisplayRefresh(_ displayLink: CADisplayLink) {
if opening {
keyDuration += CGFloat(displayLink.duration)
updateOpen()
Expand Down Expand Up @@ -489,7 +489,7 @@ open class LiquidFloatingCell : LiquittableCircle {
}

func setup(_ image: UIImage, tintColor: UIColor = UIColor.white) {
imageView.image = image.withRenderingMode(UIImageRenderingMode.alwaysTemplate)
imageView.image = image.withRenderingMode(UIImage.RenderingMode.alwaysTemplate)
imageView.tintColor = tintColor
setupView(imageView)
}
Expand Down
4 changes: 2 additions & 2 deletions Pod/Classes/LiquidUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ extension CALayer {
class CGMath {

static func radToDeg(_ rad: CGFloat) -> 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 {
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/LiquittableCircle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/SimpleCircleLiquidEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down