iOS SDK Samples - Roles Operations

Get All Roles
          
          
//company is the object of getCompanyInfoDelegate()
$company.getRoles { ( result ) in
            switch result
            {
            case .success(let roles, let response) :
            print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print("Throws exception : \(error)")
            }
        }
 
Get a Role
          
          
let id = try roleDetails.getInt64(key: "id")
//company is the object of getCompanyInfoDelegate()
 $company.getRole(id: id) { ( result ) in
            switch result
            {
            case .success (let roles, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print("Throws exception : \(error)")
            }
        }