Skip to content

Commit 37d7769

Browse files
author
Clément Le Provost
committed
Open the query classes to allow subclassing
Required to build useful helpers on top of `Query`.
1 parent 301e51e commit 37d7769

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Source/AbstractQuery.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ import Foundation
173173
/// + Warning: This class is not meant to be used directly. Please see `Query` or `PlacesQuery` instead.
174174
///
175175
@objc
176-
public class AbstractQuery : NSObject, NSCopying {
176+
open class AbstractQuery : NSObject, NSCopying {
177177

178178
// MARK: - Low-level (untyped) parameters
179179

180180
/// Parameters, as untyped values.
181-
internal var parameters: [String: String] = [:]
181+
@objc public private(set) var parameters: [String: String] = [:]
182182

183183
/// Get a parameter in an untyped fashion.
184184
///
@@ -217,7 +217,7 @@ public class AbstractQuery : NSObject, NSCopying {
217217

218218
// MARK: - Miscellaneous
219219

220-
@objc override public var description: String {
220+
@objc override open var description: String {
221221
get { return "\(String(describing: type(of: self))){\(parameters)}" }
222222
}
223223

@@ -238,7 +238,7 @@ public class AbstractQuery : NSObject, NSCopying {
238238
///
239239
/// + Note: Primarily intended for Objective-C use. Swift coders should use `init(copy:)`.
240240
///
241-
@objc public func copy(with zone: NSZone?) -> Any {
241+
@objc open func copy(with zone: NSZone?) -> Any {
242242
// NOTE: As per the docs, the zone argument is ignored.
243243
return AbstractQuery(parameters: self.parameters)
244244
}
@@ -278,7 +278,7 @@ public class AbstractQuery : NSObject, NSCopying {
278278

279279
// MARK: Equatable
280280

281-
override public func isEqual(_ object: Any?) -> Bool {
281+
override open func isEqual(_ object: Any?) -> Bool {
282282
guard let rhs = object as? AbstractQuery else {
283283
return false
284284
}

Source/Query.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import Foundation
3535
/// + Warning: All parameters are **optional**. When a parameter is `nil`, the API applies a default value.
3636
///
3737
@objc
38-
public class Query : AbstractQuery {
38+
open class Query : AbstractQuery {
3939

4040
// MARK: -
4141

@@ -728,7 +728,7 @@ public class Query : AbstractQuery {
728728
///
729729
/// + Note: Primarily intended for Objective-C use. Swift coders should use `init(copy:)`.
730730
///
731-
@objc public override func copy(with zone: NSZone?) -> Any {
731+
@objc open override func copy(with zone: NSZone?) -> Any {
732732
// NOTE: As per the docs, the zone argument is ignored.
733733
return Query(copy: self)
734734
}

0 commit comments

Comments
 (0)