How do I use the Yelp API in Swift?

时间:2015-07-13 21:13:46

标签: ios swift api yelp

I don't know Objective-C. They have no code samples on their page for Swift. Has anyone used their new V2 API with Swift yet who can provide some examples or simple searches such as querying local restaurants nearby and more importantly how to provide their required keys?

1 个答案:

答案 0 :(得分:0)

试试这个:https://github.com/codepath/ios_yelp_swift

  

基本Yelp客户端

     

这是如何实现OAuth 1.0a Yelp API的无头示例   客户。 Yelp API提供允许的应用程序令牌   应用程序对其搜索API进行未经身份验证的请求。

     

后续步骤

     

查看BusinessesViewController.swift以了解如何使用   商业模式。样品申请

     

使用查询进行基本搜索

-webkit-overflow-scrolling: touch
     

使用类别进行高级搜索,排序和处理过滤器

Business.searchWithTerm("Thai", completion: { (businesses: [Business]!, error: NSError!) -> Void in
    self.businesses = businesses

    for business in businesses {
        print(business.name!)
        print(business.address!)
    }
})