iOS SDK Samples - Currencies Operations
//company is the object of getCompanyInfo()
$company.getCurrencies() { result in
switch result
{
case .success( let currencies, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
//company is the object of getCompanyInfo()
$company.getCurrenciesFromServer() { result in
switch result
{
case .success( let currencies, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
//company is the object of getCompanyInfo()
$company.getCurrency(id : 345xxx56) { result in
switch result
{
case .success( let currencies, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
//company is the object of getCompanyInfo()
$company.getCurrenciesFromServer(id : 345xxx456) { result in
switch result
{
case .success( let currencies, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
// currency is the object of newCurrency
//company is the object of getCompanyInfo()
$company.enableMultiCurrency(currency) { result in
switch result
{
case .success( let currency, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}
// currency1 and currency2 are the objects of newCurrency
//company is the object of getCompanyInfo()
$company.updateCurrencies( [ currency1, currency2 ] ) { result in
switch result
{
case .success( let updatedCurrencies, let response) :
print ("ResponseJSON : \( response.responseJSON )")
case .failure(let error) :
print ( "Throws exception : \(error)" )
}
}