A simple swift package giving access to the Strasbourg open data for parking (location API and availability API)
Reference can be found here.
You can interact with the framework using callback closures responses, Combine or async methods
let client = ParkingAPIClient()
client.getLocations { (result) in
switch result {
case .success(let locations):
print("Locations: \(locations)")
case .failure(let error):
print("Error during the download: \(error)")
}
}
let client = ParkingAPIClient()
client.getLocationsPublisher().sink { result in
if case .failure(let error) = result {
print("Error: \(result)")
}
} receiveValue: { result in
print("Response: \(result)")
}
let client = ParkingAPIClient()
do {
let response = try await client.fetchLocations()
print("Response: \(response)")
} catch let error {
print("Error: \(error)")
}