GithubHelp home page GithubHelp logo

isabella232 / swiftygiphy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 52inc/swiftygiphy

0.0 0.0 0.0 2.05 MB

A UI and API layer for Giphy discovery and integration.

License: MIT License

Swift 97.45% Ruby 2.55%

swiftygiphy's Introduction

SwiftyGiphy

SwiftyGiphy is a library to allow you to easily integrate Giphy image search into your app.

The library consists of 2 primary components

  1. SwiftyGiphyViewController, which provides a simple UI for search, and callbacks for selected images so you can quickly integrate Giphy in to your app. The controller also supports paging so your users can contiously scroll and see results.

  2. SwiftyGiphyAPI, which provides an API layer to access Giphy. This does not require you to use SwiftyGiphyViewController for your UI, and can be used standalone.



Installing

SwiftyGiphy supports Cocoapods and manual includes.

Cocoapods

pod 'SwiftyGiphy', '~> 1.0'

Manual Include

Add the files in the Library and Assets folder to your project. You'll also need to include the dependencies:

Carthage / Swift Package Manager

Carthage and Swift Package Manager are not currently supported. But, if you'd like to create a pull request with support for either of these I'd be happy to consider including it.

Usage

Setup

You'll need to configure SwiftyGiphy with your Giphy API key. We recommend you do this in your AppDelegate's -didFinishLaunching method.

SwiftyGiphyAPI.shared.apiKey = "my_api_key"

Note: For testing, you can use the Giphy public beta key. However, you MUST change it before releasing your app.

SwiftyGiphyAPI.shared.apiKey = SwiftyGiphyAPI.publicBetaKey

Recommendations

Recommended usage is to present SwiftyGiphyViewController modally in a UINavigationController, with another object (such as the presenting view controller) assigned as the delegate of SwiftyGiphyViewController.

You should dismiss SwiftyGiphyViewController in the delegate methods, when you need to.

IMPORTANT: SwiftyGiphyViewController will not dismiss itself. Similar to UIImagePickerController, you'll need to dismiss it from a delegate callback when you want it to go away.

Components

SwiftyGiphy provides a few useful things for your Giphy integration:

  • SwiftyGiphyViewController (outlined above) gives you an easy to use UI for interacting with Giphy image search.
  • SwiftyGiphyViewControllerDelegate is called by SwiftyGiphyViewController to notify you when the user selects GIFs, or is ready to close the screen.
  • SwiftyGiphyAPI provides easy access to the Giphy API. Currently this supports all of the Giphy API documented here, with the exception of image uploads.
  • SwiftyGiphy Data Models are provided by the API layer so you can interact with real objects instead of dictionaries and arrays.

Questions

If you have questions on how to integrate SwiftyGiphy into your project, feel free to create an issue and we'll try to help the best we can. Please note that we'll only be able to provide assistance for SwiftyGiphy in its 'stock' form, and we won't assist with problems you have due to custom modifications.

Pull requests are encouraged, especially if you feel like assisting in more full implementing the Giphy API layer.

Apps using SwiftyGiphy

If you have an app using SwiftyGiphy, let me know and I'll link to it here.

swiftygiphy's People

Contributors

amyleecodes avatar ulmentflam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.