Skip to content

Commit 4d6a23d

Browse files
committed
Make CGRect conform to Equatable protocol
1 parent 6eec5b9 commit 4d6a23d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Foundation/NSGeometry.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ public struct CGRect {
8888
}
8989
}
9090

91+
extension CGRect: Equatable { }
92+
93+
public func ==(lhs: CGRect, rhs: CGRect) -> Bool {
94+
return (lhs.origin == rhs.origin) && (lhs.size == lhs.size)
95+
}
96+
9197
public typealias NSPoint = CGPoint
9298

9399
public typealias NSPointPointer = UnsafeMutablePointer<NSPoint>

0 commit comments

Comments
 (0)