A framework around the Yelp Fusion API written in Swift.
See below for all of the endpoints this framework covers:
-
Business Endpoints
-
Category Endpoints
-
Event Endpoints
If you do not have any additional dependencies then add the following lines to your Package.swift file:
dependencies: [
.Package(url: "https://github.com/kschins/YelpKit.git", "1.0.0")
]
Otherwise just add the following line to the dependencies node:
.Package(url: "https://github.com/kschins/YelpKit.git", "1.0.0")
Then, run the following command in Terminal:
swift package fetch
CocoaPods is a third-party dependency manager that allows you to easily integrate external frameworks. You can install CocoaPods with the following command:
gem install cocoapods
To add KSYelpKit to your project, add the following line to your Podfile:
pod 'KSYelpKit', '1.0.0'
Then, run the following command in Terminal:
pod install
First, you will need to visit Yelp to create an account so you can generate an API key. An API key is required to use this framework.
Once you have obtained your API key, you can do the following:
import KSYelpKit
let client = YelpAPIClient(apiKey: "YOUR_API_KEY")
let request = YelpBusinessSearch(term: "sushi", location: "Denver")
client.request(request: request) {
switch $0 {
case .success(let response):
// do something with the response
case .failure(let error):
// do something with the error
}
}