Skip to content

Commit cdec68c

Browse files
author
Clément Le Provost
committed
Update documentation about Objective-C bridging of structs
1 parent 80b5ec3 commit cdec68c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Source/Query.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ import Foundation
7676
// allows Swift users to leverage the full type safety of enums (at the price
7777
// of a little confusion).
7878
//
79+
// ## The case of structs
80+
//
81+
// Auxiliary types used for query parameters, like `LatLng` or `GeoRect`, have
82+
// value semantics. However, structs are not bridgeable to Objective-C. Therefore
83+
// we use plain classes (inheriting from `NSObject`) and we make them immutable.
84+
//
85+
// Equality comparison is implemented in those classes only for the sake of
86+
// testability (we use comparisons extensively in unit tests).
87+
//
7988
// ## Annotations
8089
//
8190
// Properties and methods visible in Objective-C are annotated with `@objc`.

0 commit comments

Comments
 (0)