Skip to content

Commit

Permalink
Update SwiftyGiphy for Swift 3.1, fix README markdown issues
Browse files Browse the repository at this point in the history
  • Loading branch information
amyleecodes committed Apr 27, 2017
1 parent 7378e48 commit ed0e1fe
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
3.1
2 changes: 1 addition & 1 deletion Library/SwiftyGiphyAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public class SwiftyGiphyAPI {

request.httpMethod = method

if let localparams = params as? [String : AnyObject]
if let localparams = params as [String : AnyObject]?
{
if method == "GET"
{
Expand Down
4 changes: 2 additions & 2 deletions Library/SwiftyGiphyViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public class SwiftyGiphyViewController: UIViewController {
self?.errorLabel.isHidden = false
}

print("Giphy error: \(error?.localizedDescription)")
print("Giphy error: \(String(describing: error?.localizedDescription))")
return
}

Expand Down Expand Up @@ -298,7 +298,7 @@ public class SwiftyGiphyViewController: UIViewController {
self?.errorLabel.isHidden = false
}

print("Giphy error: \(error?.localizedDescription)")
print("Giphy error: \(String(describing: error?.localizedDescription))")
return
}

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#SwiftyGiphy
# SwiftyGiphy

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

###The library consists of 2 primary components
### 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.

Expand All @@ -13,26 +13,26 @@ SwiftyGiphy is a library to allow you to easily integrate Giphy image search int
<br/>
<img src="https://github.com/52inc/SwiftyGiphy/blob/master/Screenshots/SearchScreenshot.png?raw=true" width=320/>

##Installing
## Installing
SwiftyGiphy supports Cocoapods and manual includes.

####Cocoapods
#### Cocoapods
`pod 'SwiftyGiphy', '~> 1.0'`

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

* [ObjectMapper](https://github.com/Hearst-DD/ObjectMapper) - v2.2
* [SDWebImage/GIF](https://github.com/rs/SDWebImage)
* [NSTimer-Blocks](https://github.com/jivadevoe/NSTimer-Blocks)
* [FLAnimatedImage](https://github.com/Flipboard/FLAnimatedImage) - v1.0

####Carthage / Swift Package Manager
#### 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
## Usage

###Setup
### 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"`
Expand All @@ -41,25 +41,25 @@ You'll need to configure SwiftyGiphy with your Giphy API key. We recommend you d

`SwiftyGiphyAPI.shared.apiKey = SwiftyGiphyAPI.publicBetaKey`

###Recommendations
### 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
## 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](https://github.com/Giphy/GiphyAPI), 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
## 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
## Apps using SwiftyGiphy
If you have an app using SwiftyGiphy, let me know and I'll link to it here.
2 changes: 1 addition & 1 deletion SwiftyGiphy.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SwiftyGiphy'
s.version = '1.0.7'
s.version = '1.0.8'
s.summary = 'Provides a UI and API layer for Giphy discovery and integration.'

# This description is used to generate tags and improve search results.
Expand Down

0 comments on commit ed0e1fe

Please sign in to comment.