Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Sources/Grovs/Grovs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ public protocol GrovsDelegate {

/// A class representing Grovs SDK.
public class Grovs {
private static var _delegate: GrovsDelegate?

/// The delegate to receive callbacks from the SDK.
public static var delegate: GrovsDelegate? {
set {
_delegate = newValue
manager?.delegate = newValue
}

Expand All @@ -30,7 +32,11 @@ public class Grovs {
private static var APIKey: String!

/// The manager handling Grovs functionality.
private static var manager: GrovsManager?
private static var manager: GrovsManager? {
didSet {
manager?.delegate = _delegate
}
}

// MARK: Public methods

Expand Down