Swiftpack.co - kschins/YelpKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kschins.
kschins/YelpKit 1.0.0
A wrapper around the Yelp API written in Swift.
⭐️ 1
🕓 5 years ago
.package(url: "https://github.com/kschins/YelpKit.git", from: "1.0.0")

YelpKit

A framework around the Yelp Fusion API written in Swift.

See below for all of the endpoints this framework covers:

Installation

Swift Package Manager

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

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

Usage

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
    }
}

GitHub

link
Stars: 1
Last commit: 5 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics