Skip to content

Test Page

rohitphogat19 edited this page May 1, 2019 · 1 revision
    /// Get Numbers of Friends
    ///
    /// - parameter queryFilter: GetFriendsCountFilters of QueryBuilder Class
    /// - parameter completion: The closure called when the API response comes. Closure will have number of friends and a Optional Error
    /// ## Usage:
    /**
     let friendsCountFilter = QueryBuilder.instance.createUserFriendsCountFilter()
     friendsCountFilter.online = false
     friendsCountFilter.includeBlocked = true
     friendsCountFilter.search = "Search Name"
     CHService.main.getFriendsCount(queryFilter:friendsCountQueryFilter,completion:{(count,error) in
        guard error == nil else {
            print("Error in Getting Friends Count")
            return
        }
        "Do you stuff with Friends Count Result"
     */
    
    open func getFriendsCount(queryFilter:QueryBuilder.GetFriendsCountFilters,completion: @escaping CountResponse){
        let params = queryFilter.generateFilters()
        self.userService.getFriendsCount(queryParams: params, completion: completion)
    }