From 20a44ddf99bba62f3e80925c01349ed87ba01725 Mon Sep 17 00:00:00 2001 From: Ting Chen Date: Mon, 8 Jun 2020 23:38:35 -0700 Subject: [PATCH] Fix the scope of operator According to https://github.com/realm/SwiftLint/issues/2395, it is better not to declare it as a free function. --- Sources/FloatyItem.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/FloatyItem.swift b/Sources/FloatyItem.swift index 91e3ac0..3fac7fd 100644 --- a/Sources/FloatyItem.swift +++ b/Sources/FloatyItem.swift @@ -286,6 +286,8 @@ open class FloatyItem: UIView { } } -func + (left: CGPoint, right: CGPoint) -> CGPoint { - return CGPoint(x: left.x + right.x, y: left.y + right.y) +private extension CGPoint { + static func + (left: CGPoint, right: CGPoint) -> CGPoint { + return CGPoint(x: left.x + right.x, y: left.y + right.y) + } }