From 2801e832ff02ff961c618842f1fa35ff28e98b40 Mon Sep 17 00:00:00 2001 From: paubins Date: Tue, 30 May 2017 11:57:44 -0700 Subject: [PATCH 1/3] Updated to Swift 3 --- Classes/WobbleView.swift | 130 +++++++++++----------- Example/Example.xcodeproj/project.pbxproj | 16 ++- Example/Example/TableViewCell.swift | 22 ++-- Example/Example/ViewController.swift | 8 +- 4 files changed, 93 insertions(+), 83 deletions(-) diff --git a/Classes/WobbleView.swift b/Classes/WobbleView.swift index 98c2f52..daf87a0 100644 --- a/Classes/WobbleView.swift +++ b/Classes/WobbleView.swift @@ -9,23 +9,23 @@ import UIKit import QuartzCore -public class WobbleView: UIView { +open class WobbleView: UIView { /* The frequency of oscillation for the wobble behavior. */ - @IBInspectable public var frequency: CGFloat = 3 + @IBInspectable open var frequency: CGFloat = 3 /* The amount of damping to apply to the wobble behavior. */ - @IBInspectable public var damping: CGFloat = 0.3 + @IBInspectable open var damping: CGFloat = 0.3 /* A bitmask value that identifies the edges that you want to wobble. You can use this parameter to wobble only a subset of the edges of the rectangle. */ - @IBInspectable public var edges: ViewEdge = .Right + @IBInspectable open var edges: ViewEdge = .Right // MARK: init required public init?(coder aDecoder: NSCoder) { @@ -40,7 +40,7 @@ public class WobbleView: UIView { setUp() } - private func setUp() { + fileprivate func setUp() { layer.masksToBounds = false layer.addSublayer(maskLayer) @@ -53,28 +53,28 @@ public class WobbleView: UIView { setUpDisplayLink() } - public func reset() { + open func reset() { setUpMidpoints() setUpCenters() setUpBehaviours() - if vertexViews[0].layer.presentationLayer() != nil { + if vertexViews[0].layer.presentation() != nil { let bezierPath = UIBezierPath() - bezierPath.moveToPoint(vertexViews[0].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - bezierPath.addLineToPoint(vertexViews[1].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - bezierPath.addLineToPoint(vertexViews[2].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - bezierPath.addLineToPoint(vertexViews[3].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - bezierPath.closePath() + bezierPath.move(to: vertexViews[0].layer.presentation()!.frame.origin - layer.presentation()!.frame.origin) + bezierPath.addLine(to: vertexViews[1].layer.presentation()!.frame.origin - layer.presentation()!.frame.origin) + bezierPath.addLine(to: vertexViews[2].layer.presentation()!.frame.origin - layer.presentation()!.frame.origin) + bezierPath.addLine(to: vertexViews[3].layer.presentation()!.frame.origin - layer.presentation()!.frame.origin) + bezierPath.close() - maskLayer.path = bezierPath.CGPath - (layer as! CAShapeLayer).path = bezierPath.CGPath + maskLayer.path = bezierPath.cgPath + (layer as! CAShapeLayer).path = bezierPath.cgPath layer.mask = maskLayer } } - private func setUpVertices() { + fileprivate func setUpVertices() { vertexViews = [] @@ -86,7 +86,7 @@ public class WobbleView: UIView { createAdditionalViews(&vertexViews, origins: verticesOrigins) } - private func setUpMidpoints() { + fileprivate func setUpMidpoints() { midpointViews = [] @@ -98,28 +98,28 @@ public class WobbleView: UIView { createAdditionalViews(&midpointViews, origins: midpointsOrigins) } - private func setUpCenters() { + fileprivate func setUpCenters() { centerViews = [] let radius = min(frame.size.width/2, frame.size.height/2) let centersOrigins = [CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + radius), - CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), - CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), + CGPoint(x: (frame.origin.x + frame.width) - radius, y: frame.origin.y + frame.height/2), + CGPoint(x: frame.origin.x + frame.width/2, y: (frame.origin.y + frame.height) - radius), CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] createAdditionalViews(¢erViews, origins: centersOrigins) } - private func setUpBehaviours() { + fileprivate func setUpBehaviours() { animator = UIDynamicAnimator(referenceView: self) animator!.delegate = self verticesAttachments = [] centersAttachments = [] - for (i, midPointView) in midpointViews.enumerate() { + for (i, midPointView) in midpointViews.enumerated() { let formerVertexIndex = i let latterVertexIndex = (i + 1) % vertexViews.count @@ -130,61 +130,61 @@ public class WobbleView: UIView { } } - private func setUpDisplayLink() { + fileprivate func setUpDisplayLink() { displayLink = CADisplayLink(target: self, selector: "displayLinkUpdate:") - displayLink!.addToRunLoop(NSRunLoop.mainRunLoop(), forMode: NSDefaultRunLoopMode) - displayLink!.paused = true + displayLink!.add(to: RunLoop.main, forMode: RunLoopMode.defaultRunLoopMode) + displayLink!.isPaused = true } // MARK: CADisplayLink selector - internal func displayLinkUpdate(sender: CADisplayLink) { + internal func displayLinkUpdate(_ sender: CADisplayLink) { for behavour in centersAttachments { - behavour.anchorPoint = centerViews[behavour.vertexIndex!].layer.presentationLayer()!.frame.origin + behavour.anchorPoint = centerViews[behavour.vertexIndex!].layer.presentation()!.frame.origin } for behavour in verticesAttachments { - behavour.anchorPoint = vertexViews[behavour.vertexIndex!].layer.presentationLayer()!.frame.origin + behavour.anchorPoint = vertexViews[behavour.vertexIndex!].layer.presentation()!.frame.origin } var bezierPath = UIBezierPath() - bezierPath.moveToPoint(vertexViews[0].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) - addEdge(&bezierPath, formerVertex: 0, latterVertex: 1, curved: edges.intersect(.Top)) - addEdge(&bezierPath, formerVertex: 1, latterVertex: 2, curved: edges.intersect(.Right)) - addEdge(&bezierPath, formerVertex: 2, latterVertex: 3, curved: edges.intersect(.Bottom)) - addEdge(&bezierPath, formerVertex: 3, latterVertex: 0, curved: edges.intersect(.Left)) - bezierPath.closePath() - - maskLayer.path = bezierPath.CGPath - (layer as! CAShapeLayer).path = bezierPath.CGPath + bezierPath.move(to: vertexViews[0].layer.presentation()!.frame.origin - layer.presentation()!.frame.origin) + addEdge(&bezierPath, formerVertex: 0, latterVertex: 1, curved: edges.intersection(.Top)) + addEdge(&bezierPath, formerVertex: 1, latterVertex: 2, curved: edges.intersection(.Right)) + addEdge(&bezierPath, formerVertex: 2, latterVertex: 3, curved: edges.intersection(.Bottom)) + addEdge(&bezierPath, formerVertex: 3, latterVertex: 0, curved: edges.intersection(.Left)) + bezierPath.close() + + maskLayer.path = bezierPath.cgPath + (layer as! CAShapeLayer).path = bezierPath.cgPath layer.mask = maskLayer } // MARK: overrides - override public var backgroundColor: UIColor? { + override open var backgroundColor: UIColor? { didSet { - (layer as! CAShapeLayer).fillColor = backgroundColor!.CGColor + (layer as! CAShapeLayer).fillColor = backgroundColor!.cgColor } } - override public class func layerClass() -> AnyClass { + override open class var layerClass : AnyClass { return WobbleLayer.self } // MARK: helpers - private func createAdditionalViews(inout views: [UIView], origins: [CGPoint]) { + fileprivate func createAdditionalViews(_ views: inout [UIView], origins: [CGPoint]) { for origin in origins { let view = UIView(frame: CGRect(origin: origin, size: CGSize(width: 1, height: 1))) - view.backgroundColor = UIColor.clearColor() + view.backgroundColor = UIColor.clear addSubview(view) views.append(view) } } - private func createAttachmentBehaviour(inout behaviours: [VertexAttachmentBehaviour], view: UIView, vertexIndex: Int) { + fileprivate func createAttachmentBehaviour(_ behaviours: inout [VertexAttachmentBehaviour], view: UIView, vertexIndex: Int) { let attachmentBehaviour = VertexAttachmentBehaviour(item: view, attachedToAnchor: vertexViews[vertexIndex].frame.origin) attachmentBehaviour.damping = damping @@ -195,48 +195,48 @@ public class WobbleView: UIView { behaviours.append(attachmentBehaviour) } - private func addEdge(inout bezierPath: UIBezierPath, formerVertex: Int, latterVertex: Int, curved: ViewEdge) { + fileprivate func addEdge(_ bezierPath: inout UIBezierPath, formerVertex: Int, latterVertex: Int, curved: ViewEdge) { - if (curved) { + if (curved).boolValue { - let controlPoint = (vertexViews[formerVertex].layer.presentationLayer()!.frame.origin - (midpointViews[formerVertex].layer.presentationLayer()!.frame.origin - vertexViews[latterVertex].layer.presentationLayer()!.frame.origin)) - layer.presentationLayer()!.frame.origin + let controlPoint = (vertexViews[formerVertex].layer.presentation()!.frame.origin - (midpointViews[formerVertex].layer.presentation()!.frame.origin - vertexViews[latterVertex].layer.presentation()!.frame.origin)) - layer.presentation()!.frame.origin - bezierPath.addQuadCurveToPoint(vertexViews[latterVertex].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin, + bezierPath.addQuadCurve(to: vertexViews[latterVertex].layer.presentation()!.frame.origin - layer.presentation()!.frame.origin, controlPoint: controlPoint) return; } - bezierPath.addLineToPoint(vertexViews[latterVertex].layer.presentationLayer()!.frame.origin - layer.presentationLayer()!.frame.origin) + bezierPath.addLine(to: vertexViews[latterVertex].layer.presentation()!.frame.origin - layer.presentation()!.frame.origin) } // MARK: private variables // views considered as rectangle's vertices - private var vertexViews:[UIView] = [] + fileprivate var vertexViews:[UIView] = [] // views considered as midpoints of rectangle's edges - private var midpointViews:[UIView] = [] + fileprivate var midpointViews:[UIView] = [] // views considered as centers for rectangle's edges - private var centerViews: [UIView] = [] + fileprivate var centerViews: [UIView] = [] - private var animator: UIDynamicAnimator? - private var displayLink: CADisplayLink? - private var maskLayer: CAShapeLayer = CAShapeLayer() + fileprivate var animator: UIDynamicAnimator? + fileprivate var displayLink: CADisplayLink? + fileprivate var maskLayer: CAShapeLayer = CAShapeLayer() // midpoints' attachment behaviours to vertices views - private var verticesAttachments:[VertexAttachmentBehaviour] = [] + fileprivate var verticesAttachments:[VertexAttachmentBehaviour] = [] // midpoints' attachment behaviours to center view - private var centersAttachments:[VertexAttachmentBehaviour] = [] + fileprivate var centersAttachments:[VertexAttachmentBehaviour] = [] } // MARK: UIDynamicAnimatorDelegate extension WobbleView: UIDynamicAnimatorDelegate { - public func dynamicAnimatorDidPause(animator: UIDynamicAnimator) { - displayLink!.paused = true + public func dynamicAnimatorDidPause(_ animator: UIDynamicAnimator) { + displayLink!.isPaused = true } } @@ -245,25 +245,25 @@ extension WobbleView: WobbleDelegate { func positionChanged() { - displayLink!.paused = false + displayLink!.isPaused = false let verticesOrigins = [CGPoint(x: frame.origin.x, y: frame.origin.y), CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y), CGPoint(x: frame.origin.x + frame.width, y: frame.origin.y + frame.height), CGPoint(x: frame.origin.x, y: frame.origin.y + frame.height)] - for (i, vertexView) in vertexViews.enumerate() { + for (i, vertexView) in vertexViews.enumerated() { vertexView.frame.origin = verticesOrigins[i] } let radius = min(frame.size.width/2, frame.size.height/2) let centersOrigins = [CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + radius), - CGPoint(x: frame.origin.x + frame.width - radius, y: frame.origin.y + frame.height/2), - CGPoint(x: frame.origin.x + frame.width/2, y: frame.origin.y + frame.height - radius), + CGPoint(x: (frame.origin.x + frame.width) - radius, y: frame.origin.y + frame.height/2), + CGPoint(x: frame.origin.x + frame.width/2, y: (frame.origin.y + frame.height) - radius), CGPoint(x: frame.origin.x + radius, y: frame.origin.y + frame.height/2)] - for (i, centerView) in centerViews.enumerate() { + for (i, centerView) in centerViews.enumerated() { centerView.frame.origin = centersOrigins[i] } } @@ -296,9 +296,9 @@ private class WobbleLayer: CAShapeLayer { } } -public struct ViewEdge : OptionSetType, BooleanType { +public struct ViewEdge : OptionSet { - private var value: UInt = 0 + fileprivate var value: UInt = 0 public init(nilLiteral: ()) {} @@ -341,4 +341,4 @@ public struct ViewEdge : OptionSetType, BooleanType { static public var All: ViewEdge { return self.init(rawValue: 0b1111) } -} \ No newline at end of file +} diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index c20a161..264b7eb 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -114,11 +114,12 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0830; ORGANIZATIONNAME = inFullMobile; TargetAttributes = { E7D6A68F1ABC166C006169C8 = { CreatedOnToolsVersion = 6.2; + LastSwiftMigration = 0830; }; }; }; @@ -200,8 +201,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"; @@ -210,6 +213,7 @@ ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -244,8 +248,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"; @@ -253,6 +259,7 @@ ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -262,6 +269,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -273,10 +281,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; INFOPLIST_FILE = Example/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.infullmobile.ui.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -286,10 +295,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; INFOPLIST_FILE = Example/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.infullmobile.ui.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/Example/Example/TableViewCell.swift b/Example/Example/TableViewCell.swift index 3619ef4..1228a76 100644 --- a/Example/Example/TableViewCell.swift +++ b/Example/Example/TableViewCell.swift @@ -19,11 +19,11 @@ class TableViewCell: UITableViewCell { super.awakeFromNib() if #available(iOS 8.0, *) { - layoutMargins = UIEdgeInsetsZero + layoutMargins = UIEdgeInsets.zero preservesSuperviewLayoutMargins = false } - let avatar = UIImage(named: "ic_user")?.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate) + let avatar = UIImage(named: "ic_user")?.withRenderingMode(UIImageRenderingMode.alwaysTemplate) avatarImageView.image = avatar avatarImageView.tintColor = UIColor(red: 187/255.0, green: 193/255.0, blue: 209/255.0, alpha: 1.0) @@ -40,23 +40,23 @@ class TableViewCell: UITableViewCell { panView.reset() } - func handlePanGesture(recognizer: UIPanGestureRecognizer) { + func handlePanGesture(_ recognizer: UIPanGestureRecognizer) { switch(recognizer.state) { - case UIGestureRecognizerState.Changed: + case UIGestureRecognizerState.changed: - let translation = recognizer.translationInView(recognizer.view!) + let translation = recognizer.translation(in: recognizer.view!) trailingSpaceConstraint.constant = fmax(0, trailingSpaceConstraint.constant - translation.x) leadingSpaceConstraint.constant = fmin(0, leadingSpaceConstraint.constant + translation.x) - recognizer.setTranslation(CGPointZero, inView: recognizer.view!) + recognizer.setTranslation(CGPoint.zero, in: recognizer.view!) - case UIGestureRecognizerState.Ended, UIGestureRecognizerState.Cancelled: + case UIGestureRecognizerState.ended, UIGestureRecognizerState.cancelled: leadingSpaceConstraint.constant = 0 trailingSpaceConstraint.constant = 0 - UIView.animateWithDuration(0.25, animations: { () -> Void in + UIView.animate(withDuration: 0.25, animations: { () -> Void in self.layoutIfNeeded() }) @@ -66,11 +66,11 @@ class TableViewCell: UITableViewCell { } } - override func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer) -> Bool { + override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { - if gestureRecognizer.isKindOfClass(UIPanGestureRecognizer) { + if gestureRecognizer.isKind(of: UIPanGestureRecognizer.self) { - let velocity = (gestureRecognizer as! UIPanGestureRecognizer).velocityInView(gestureRecognizer.view!) + let velocity = (gestureRecognizer as! UIPanGestureRecognizer).velocity(in: gestureRecognizer.view!) return fabs(velocity.x) > fabs(velocity.y) } diff --git a/Example/Example/ViewController.swift b/Example/Example/ViewController.swift index 8b76778..8106be3 100644 --- a/Example/Example/ViewController.swift +++ b/Example/Example/ViewController.swift @@ -14,14 +14,14 @@ class ViewController: UIViewController { extension ViewController: UITableViewDataSource { - func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 50 } - func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! TableViewCell + let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! TableViewCell return cell } -} \ No newline at end of file +} From 8b2b59a41da5f37c454f41deba91deb4fd86c718 Mon Sep 17 00:00:00 2001 From: paubins Date: Tue, 30 May 2017 12:11:40 -0700 Subject: [PATCH 2/3] Converted infix to groupprecedence --- Classes/WobbleView.swift | 7 ++++++- Example/Example/TableViewCell.swift | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Classes/WobbleView.swift b/Classes/WobbleView.swift index daf87a0..b72918f 100644 --- a/Classes/WobbleView.swift +++ b/Classes/WobbleView.swift @@ -271,7 +271,12 @@ extension WobbleView: WobbleDelegate { // MARK: helper classes -infix operator - { associativity left precedence 160 } +infix operator - : SubtractionPrecedence + +precedencegroup SubtractionPrecedence { + associativity: left + higherThan: AdditionPrecedence +} private func - (left: CGPoint, right: CGPoint) -> CGPoint { return CGPoint(x: left.x - right.x, y: left.y - right.y) diff --git a/Example/Example/TableViewCell.swift b/Example/Example/TableViewCell.swift index 1228a76..9d46632 100644 --- a/Example/Example/TableViewCell.swift +++ b/Example/Example/TableViewCell.swift @@ -29,7 +29,7 @@ class TableViewCell: UITableViewCell { panView.edges = ViewEdge.Right - let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: "handlePanGesture:") + let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(TableViewCell.handlePanGesture(_:))) panGestureRecognizer.delegate = self addGestureRecognizer(panGestureRecognizer) } From fef44549f7338b09e64f2d9d11ebd40c66713aa9 Mon Sep 17 00:00:00 2001 From: paubins Date: Tue, 30 May 2017 12:15:42 -0700 Subject: [PATCH 3/3] Removed overloading entirely --- Classes/WobbleView.swift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Classes/WobbleView.swift b/Classes/WobbleView.swift index b72918f..3afa68d 100644 --- a/Classes/WobbleView.swift +++ b/Classes/WobbleView.swift @@ -271,13 +271,6 @@ extension WobbleView: WobbleDelegate { // MARK: helper classes -infix operator - : SubtractionPrecedence - -precedencegroup SubtractionPrecedence { - associativity: left - higherThan: AdditionPrecedence -} - private func - (left: CGPoint, right: CGPoint) -> CGPoint { return CGPoint(x: left.x - right.x, y: left.y - right.y) }