QNGroupsRepository
public class QNGroupsRepository
Provides methods to retrieve all groups or by its identifier
-
Delegate to receive groups events
Declaration
Swift
public weak var delegate: QNGroupsDelegate? { get set }
-
Creates a new group
Declaration
Swift
public func createGroup(named: String, identified: String?, result: @escaping (Result<QNGroupRepository, QNSDKError>) -> Void)Parameters
namedName use as alias
identifiedGroup identifier, if empty server will create one
resultResult with the Group
-
Deletes a group
Declaration
Swift
public func delete(group: QNGroupRepository, result: @escaping (Result<Void, QNSDKError>) -> Void)Parameters
groupGroup to be deleted
resultResult success when operation is completed
-
Current user leaves all groups where he/she is participating
Declaration
Swift
public func leavesAllGroups(result: @escaping (Result<Void, QNSDKError>) -> Void)Parameters
taskResult success when operation is completed
-
Fetch all groups
Declaration
Swift
public func groups(userIsParticipating: Bool = true, fromCache: Bool = true, result: @escaping (Result<[QNGroupRepository], QNSDKError>) -> Void)Parameters
userIsParticipatingSet true to fetch only groups where user is participating
fromCacheRetrieve from cache or server; true by default
resultResult with Group
-
Fetch a group with a specific groupId
Declaration
Swift
public func group(with groupId: String, fromCache: Bool = true, result: @escaping (Result<QNGroupRepository, QNSDKError>) -> Void)Parameters
groupIdThe groupId to fetch
fromCacheRetrieve from cache or server; true by default
resultResult with the Group
QNGroupsRepository Class Reference