Skip to content

Commit

Permalink
Merge pull request #80 from olgadanylova/master
Browse files Browse the repository at this point in the history
Changes 0.0.11
  • Loading branch information
Olha Danylova authored Jun 18, 2019
2 parents d299c23 + ebf1b74 commit 80937e8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
8 changes: 3 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# RELEASE HISTORY

### 0.0.12, / June, 17 2019
* customized serialization/deserialization for the next classes: DeliveryOptions, GeoPoint, GeoQueryRectangle

### 0.0.11, / ?, 12 2019
### 0.0.11, / June, 18 2019
* fixed the GeoPoint saving issue which caused crash when sending custom object in metadata
* customized serialization/deserialization for the next classes: DeliveryOptions, GeoPoint, GeoQueryRectangle

### 0.0.10, / June, 12 2019
* fixed password issue when updating the BackendlessUser object
* fixed password issue when updating the BackendlessUser objects
* fixed Date type issue when retrieving object or registering BackendlessUser with custom Date field
* fixed the BackendlessUser properties methods
* added support of custom smart-text substitutions for push templates:
Expand Down
2 changes: 2 additions & 0 deletions Sources/SwiftSDK/Geo/BackendlessGeoQuery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
open var rectangle: GeoQueryRectangle?
open var pageSize: Int = 10
open var offset: Int = 0
open var relativeFindMetadata: [String : String]?
open var relativeFindPercentThreshold: Double = 0.0

open private(set) var degreePerPixel: Double = 0.0
open private(set) var clusterGridSize: Double = 100.0
Expand Down
13 changes: 13 additions & 0 deletions Sources/SwiftSDK/Geo/GeoPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@
try container.encodeIfPresent(_metadata, forKey: ._metadata)
}

public func pointDescription() -> String {
let categories = self.categories.joined(separator: ",")
var metadata = "{"
if let pointMetadata = self.metadata {
for (key, value) in pointMetadata {
metadata.append("\(key):\(value);")
}
}
metadata.removeLast()
metadata += "}"
return "GeoPoint{objectId='\(self.objectId ?? "")', latitude=\(self.latitude), longitude=\(self.longitude), categories=[\(categories)], metadata=\(metadata)}"
}

func setObjectId(objectId: String) {
self.objectId = objectId
}
Expand Down
4 changes: 4 additions & 0 deletions Sources/SwiftSDK/Geo/GeoService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@
restMethod += "&includemetadata=false"
}
restMethod += "&dpp=\(geoQuery.degreePerPixel)&clusterGridSize=\(geoQuery.clusterGridSize)"
if let relativeFindMetadata = geoQuery.relativeFindMetadata,
let relativeFindMetadataString = dataTypesUtils.dictionaryToUrlString(dictionary: relativeFindMetadata) {
restMethod += "&relativeFindMetadata=\(relativeFindMetadataString)&relativeFindPercentThreshold=\(geoQuery.relativeFindPercentThreshold)"
}
}
return restMethod
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,5 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Sources/SwiftSDK/Geo/GeoService.swift"
timestampString = "581966050.149226"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "236"
endingLineNumber = "236"
landmarkName = "unknown"
landmarkType = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

0 comments on commit 80937e8

Please sign in to comment.