Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Added @objc to compile with objective-c #184

Merged
merged 1 commit into from Apr 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Sources/ParseLiveQuery/Client.swift
Expand Up @@ -49,6 +49,7 @@ open class Client: NSObject {
- parameter applicationId: The application id to use
- parameter clientKey: The client key to use
*/
@objc(initWithServer:applicationId:clientKey:)
public init(server: String, applicationId: String? = nil, clientKey: String? = nil) {
guard let cmpts = URLComponents(string: server) else {
fatalError("Server should be a valid URL.")
Expand Down Expand Up @@ -227,6 +228,7 @@ extension Client {
This will disconnect and resubscribe all existing subscriptions. This is not required to be called the first time
you use the client, and should usually only be called when an error occurs.
*/
@objc(reconnect)
public func reconnect() {
guard socket == nil || !isConnecting else { return }
socket?.disconnect()
Expand All @@ -247,6 +249,7 @@ extension Client {
This does not remove any subscriptions - if you `reconnect()` your existing subscriptions will be restored.
Use this if you wish to dispose of the live query client.
*/
@objc(disconnect)
public func disconnect() {
isConnecting = false
guard let socket = socket
Expand Down