Network layer to communicate with 4D server rest API. Part of iOS SDK
To download dependencies use carthage checkout
then open workspace with Xcode and compile
You can open Package.swift with Xcode and compile or launch standards command line for swift, see build.sh
Create your endpoint to make request
let url = URL(string: "http://your4dserverURL")!
let api = APIManager(url: url)
api.loadStatus { result in
switch result {
case .success(let info):
print("\(status.ok)")
case .failure(let error):
print("\(error)")
}
}
api.loadInfo { result in
switch result {
case .success(let info):
...
case .failure(let error):
print("\(error)")
}
}
api.loadTables { result in
switch result {
case .success(let tables):
for table in tables {
...
}
case .failure(let error):
print("\(error)")
}
}
api.loadTable(name: "ATable") { result in
switch result {
case .success(let table):
...
case .failure(let error):
print("\(error)")
}
}
api.loadCatalog { result in
switch result {
case .success(let catalogs):
for catalog in catalogs {
...
}
case .failure(let error):
print("\(error)")
}
}