All Projects → codepath → Ios_yelp_swift

codepath / Ios_yelp_swift

Programming Languages

swift
15916 projects

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!)
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].