This is a project built on top of Baton Rouge's Open Data API. It uses a query to find parks with bathrooms.
The results can be sorted according to how close the parks are to a given location or the user's location.
This project has 2 dependencies that are not included:
- Install the AFNetworking dependency
- Add the Core Location framework to your project
- Clone the BREC Bathroom Finder project and add the files from the
BRECBathroomFinderdirectory to your project.
Finding park restrooms:
BBFBathroomLocator.sharedLocator().findBathrooms(success: { (bathrooms: Array<BBFBathroom>) -> Void in
self.bathrooms = bathrooms
self.tableView.reloadData()
}, failure: { (error: NSError) -> Void in
// Handle the error
})Finding park restrooms near a location
BBFBathroomLocator.sharedLocator().findBathroomNearLocation(location, success: { (bathrooms: Array<BBFBathroom>) -> Void in
self.bathrooms = bathrooms
self.tableView.reloadData()
}, failure: { (error: NSError) -> Void in
// Handle the error
})Finding park restrooms near the current user
BBFBathroomLocator.sharedLocator().findBathroomsNearby(success: { (bathrooms: Array<BBFBathroom>) -> Void in
self.bathrooms = bathrooms
self.tableView.reloadData()
}, failure: { (error: NSError) -> Void in
// Handle the error
})- Add a demo project
- Setup a podspec
- Cache bathrooms since that data doesn't change regularly