https://github.com/codepath/ios_yelp_swift
https://github.com/codepath/ios_yelp_swift
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codepath/ios_yelp_swift
- Owner: codepath
- Created: 2014-09-20T03:53:55.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-07-26T22:49:05.000Z (over 7 years ago)
- Last Synced: 2023-05-10T14:13:30.201Z (over 2 years ago)
- Language: Swift
- Size: 261 KB
- Stars: 69
- Watchers: 17
- Forks: 109
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Basic Yelp client
This is a headless example of how to implement an OAuth 1.0a Yelp API client. The Yelp API provides an application token that allows applications to make unauthenticated requests to their search API.
### Next steps
- Check out `BusinessesViewController.swift` to see how to use the `Business` model.
### Sample request
**Basic search with query**
```
Business.searchWithTerm("Thai", completion: { (businesses: [Business]!, error: Error!) -> Void in
self.businesses = businesses
for business in businesses {
print(business.name!)
print(business.address!)
}
})
```
**Advanced search with categories, sort, and deal filters**
```
Business.searchWithTerm("Restaurants", sort: .distance, categories: ["asianfusion", "burgers"], deals: true) { (businesses: [Business]!, error: Error!) -> Void in
for business in businesses {
print(business.name!)
print(business.address!)
}
}
```