diff --git a/Sources/ParseSwift/Types/ParsePolygon.swift b/Sources/ParseSwift/Types/ParsePolygon.swift index 0bc84bdd4..0ee84c719 100644 --- a/Sources/ParseSwift/Types/ParsePolygon.swift +++ b/Sources/ParseSwift/Types/ParsePolygon.swift @@ -14,7 +14,7 @@ public struct ParsePolygon: ParseTypeable, Hashable { private let __type: String = "Polygon" // swiftlint:disable:this identifier_name public let coordinates: [ParseGeoPoint] - var flipEncodingCoordinates = false + var isSwappingCoordinates = false enum CodingKeys: String, CodingKey { case __type // swiftlint:disable:this identifier_name @@ -109,7 +109,7 @@ extension ParsePolygon { try container.encode(__type, forKey: .__type) var nestedUnkeyedContainer = container.nestedUnkeyedContainer(forKey: .coordinates) try coordinates.forEach { - guard flipEncodingCoordinates else { + guard isSwappingCoordinates else { try nestedUnkeyedContainer.encode([$0.latitude, $0.longitude]) return } diff --git a/Sources/ParseSwift/Types/QueryConstraint.swift b/Sources/ParseSwift/Types/QueryConstraint.swift index e1dca4d3e..11bd94010 100644 --- a/Sources/ParseSwift/Types/QueryConstraint.swift +++ b/Sources/ParseSwift/Types/QueryConstraint.swift @@ -621,7 +621,7 @@ public func withinPolygon(key: String, points: [ParseGeoPoint]) -> QueryConstrai */ public func geoPoint(_ key: String, within polygon: ParsePolygon) -> QueryConstraint { var polygon = polygon - polygon.flipEncodingCoordinates = true + polygon.isSwappingCoordinates = true let dictionary = [QueryConstraint.Comparator.polygon.rawValue: polygon] return .init(key: key, value: dictionary, comparator: .geoWithin) } diff --git a/Tests/ParseSwiftTests/ParsePolygonTests.swift b/Tests/ParseSwiftTests/ParsePolygonTests.swift index 03c4d15c0..d599f5a03 100644 --- a/Tests/ParseSwiftTests/ParsePolygonTests.swift +++ b/Tests/ParseSwiftTests/ParsePolygonTests.swift @@ -89,7 +89,7 @@ class ParsePolygonTests: XCTestCase { func testDecode() throws { var polygon = try ParsePolygon(points) - polygon.flipEncodingCoordinates = false + polygon.isSwappingCoordinates = false let encoded = try ParseCoding.jsonEncoder().encode(polygon) let decoded = try ParseCoding.jsonDecoder().decode(ParsePolygon.self, from: encoded) XCTAssertEqual(decoded, polygon)