Skip to content

Commit

Permalink
Merge pull request #6 from Giphy/v1.0.1
Browse files Browse the repository at this point in the history
v1.0.1
  • Loading branch information
cgmaier authored Jul 17, 2019
2 parents da64225 + a809924 commit 19fc359
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 20 deletions.
13 changes: 9 additions & 4 deletions Docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

#### Requirements
- iOS 10 or later
- Cocoapods v1.7.1
- Cocoapods v1.7.1 or later
- A Giphy API key from [Giphy Developer Portal](https://developers.giphy.com/dashboard/?create=true).
- Xcode 10.2 or later


#### CocoaPods
Expand Down Expand Up @@ -62,6 +63,8 @@ Create a new `GiphyViewController`, which takes care of most of the magic.
let giphy = GiphyViewController()
```

Create a new `GiphyViewController` every time you want to show GIPHY (maintaining a reference to the same `GiphyViewController` object isn't necesssary and can impact performance and lead to unexpected results)

### Settings
- **Theme**: set the theme to be `.dark` or `.light`.
```swift
Expand Down Expand Up @@ -119,9 +122,11 @@ giphy.delegate = self
```

```swift
extension YourController: GiphyDelegate {
func didSelectMedia(_ media: GPHMedia) {
// your user tapped a GIF!
extension YourController: GiphyDelegate {
func didSelectMedia(giphyViewController: GiphyViewController, media: GPHMedia) {

// your user tapped a GIF!
giphyViewController.dismiss(animated: true, completion: nil)
}

func didDismiss(controller: GiphyViewController?) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
5 changes: 4 additions & 1 deletion Objective C/ExampleObjectiveC/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ - (void)didSelectMedia:(GPHMedia * _Nonnull) media {
}

- (void)didDismissWithController:(GiphyViewController *)controller {
NSLog(@"dismissed");
}

- (void)didSelectMediaWithGiphyViewController:(GiphyViewController * _Nonnull)giphyViewController media:(GPHMedia * _Nonnull)media {

}
@end
2 changes: 1 addition & 1 deletion Objective C/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

use_frameworks!
target "ExampleObjectiveC" do
pod 'Giphy'
pod 'Giphy', :podspec => 'https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.0.1/Giphy.podspec'
end
15 changes: 9 additions & 6 deletions Objective C/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- DeepDiff (2.2.0)
- Giphy (1.0):
- Giphy (1.0.1):
- DeepDiff (~> 2.2.0)
- libwebp
- PINCache
Expand Down Expand Up @@ -31,21 +31,24 @@ PODS:
- PINCache (2.3)

DEPENDENCIES:
- Giphy
- Giphy (from `https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.0.1/Giphy.podspec`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- DeepDiff
- Giphy
- libwebp
- PINCache

EXTERNAL SOURCES:
Giphy:
:podspec: https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.0.1/Giphy.podspec

SPEC CHECKSUMS:
DeepDiff: e329bc46dd14ca788d8ec08d34420799ba1d77f2
Giphy: 976029d54b1fa1926ffeda884519f9129e490044
Giphy: 95cdf4e9028e192d2ed65b4f0cdd599f656b69da
libwebp: b068a3bd7c45f7460f6715be7bed1a18fd5d6b48
PINCache: ce36ed282031b92fc7733ffe831f474ff80fddc2

PODFILE CHECKSUM: 2ac72808236d2735ecd2d58d3452880bac498b7c
PODFILE CHECKSUM: fdc75eebffb9b72c70c76f604b2799c93ba06d05

COCOAPODS: 1.7.1
COCOAPODS: 1.7.2
4 changes: 2 additions & 2 deletions Swift/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ extension ViewController: SettingsDelegate {
}

extension ViewController: GiphyDelegate {
func didSelectMedia(_ media: GPHMedia) {
dismiss(animated: true, completion: { [weak self] in
func didSelectMedia(giphyViewController: GiphyViewController, media: GPHMedia) {
giphyViewController.dismiss(animated: true, completion: { [weak self] in
self?.addMessageToConversation(text: nil, media: media)
guard self?.conversation.count ?? 0 > 7 else { return }
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { [weak self] in
Expand Down
3 changes: 2 additions & 1 deletion Swift/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

use_frameworks!
target "Example" do
pod 'Giphy'
pod 'Giphy', :podspec => 'https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.0.1/Giphy.podspec'

end
13 changes: 8 additions & 5 deletions Swift/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- DeepDiff (2.2.0)
- Giphy (1.0):
- Giphy (1.0.1):
- DeepDiff (~> 2.2.0)
- libwebp
- PINCache
Expand Down Expand Up @@ -31,21 +31,24 @@ PODS:
- PINCache (2.3)

DEPENDENCIES:
- Giphy
- Giphy (from `https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.0.1/Giphy.podspec`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- DeepDiff
- Giphy
- libwebp
- PINCache

EXTERNAL SOURCES:
Giphy:
:podspec: https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.0.1/Giphy.podspec

SPEC CHECKSUMS:
DeepDiff: e329bc46dd14ca788d8ec08d34420799ba1d77f2
Giphy: 976029d54b1fa1926ffeda884519f9129e490044
Giphy: 95cdf4e9028e192d2ed65b4f0cdd599f656b69da
libwebp: b068a3bd7c45f7460f6715be7bed1a18fd5d6b48
PINCache: ce36ed282031b92fc7733ffe831f474ff80fddc2

PODFILE CHECKSUM: 1f6c8dc7b516e93843dc4421cd9aea8f50ab8389
PODFILE CHECKSUM: 0346df985f6398fd36f3d139aca42c318c9eb75d

COCOAPODS: 1.7.2

0 comments on commit 19fc359

Please sign in to comment.