The Smart Tourism Taiwan Data Provider is a framework that gives your application access to
the Smart Tourism Taiwan Open Data made available by the Institute for Information Industry .
This iOS framework uses AFNetworking HTTP Client in combination with JSONModel under the hood to streamline access to Smart Tourism Taiwan's web services.
- Build the framework from source in Xcode & add the framework to your project
- Getting a reference to the data provider:
/**
* Get a reference to the data provider
*/
let dataProvider = SmartTourismDataProvider.instance
- Accessing Smart Tourism Taiwan Open Data (Example):
/**
* Query a list of counties
*/
dataProvider.getCountyList { (error: NSError?, countyList: [County]?) -> () in
/**
* Handle response data
*/
if error == nil {
if let list = countyList {
for county in list {
/**
* Do some stuff...
*/
print("getCountyList: ", county.countyID, county.name, county.region)
}
}
} else {
/**
* Follow-up failure case
*/
print(error?.userInfo)
}
}
- Setting the Language Pack (Optional):
/**
* Set the language pack to English (US)
*/
dataProvider.supportedLanguage = SmartTourismDataProvider.SupportedLanguage.en_us
#####Intelligent & ACL APIs Pending
#####Licensed under the MIT License.