Skip to content

Commit

Permalink
v1.2.5 (#59)
Browse files Browse the repository at this point in the history
* v1.2.5 (recently picked feature)

* recently picked docs

* switch to released pod
  • Loading branch information
cgmaier authored Mar 31, 2020
1 parent c176f82 commit 9c0b1a8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
37 changes: 35 additions & 2 deletions Docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ _Objective-C_:
[giphy setMediaConfigWithTypes: [[ NSMutableArray alloc] initWithObjects:
@(GPHContentTypeGifs), @(GPHContentTypeStickers), @(GPHContentTypeText), @(GPHContentTypeEmoji), nil ] ];
```
- **Recently Picked**:
As of `v1.2.5`, you can add an additional `GPHContentType` to the `mediaTypeConfig` array: `.recents`
```swift
giphy.mediaTypeConfig = [.gifs, .stickers, .recents]
```

GIFs that are selected by the user are automatically added to the recents tab, which is only displayed if the user has previously picked a gif.

Users can remove gifs from recents with a long-press on the GIF in the recents grid.

- **Confirmation screen**: we provide the option to show a secondary confirmation screen when the user taps a GIF, which shows a larger rendition of the asset.
This confirmation screen is only available for `.waterfall` mode - this property will be ignored if the `layout` is `.carousel`.
Expand Down Expand Up @@ -340,14 +351,36 @@ let emoji = GPHContent.emoji
```

##### Search
```
```
let search = GPHContent.search(withQuery: "Hello", mediaType: .gif, language: .english)
```


##### Recents

Show GIFs that the user has previously picked.
```
let recentlyPicked = GPHContent.recents
```

Only show a "recents" tab if there are any recents. Get the number of recents via:
```
let numberOfRecents = GPHRecents.count
```

Optionally, we also provide the option to clear the set of recents:

```
GPHRecents.clear()
```

##### Updating the content

Set the grid controller's `content` property and call update:
```
gridController.content = GPHContent.search(withQuery: "Sup", mediaType: .text, language: .english)
gridController.update()
```
#### GiphyGridController: GPHGridDelegate

Expand Down
2 changes: 2 additions & 0 deletions Swift/Example/ContentTypeSettingCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class ContentTypeSettingCell: UICollectionViewCell {
case .stickers: button.setTitle("Stickers", for: .normal)
case .text: button.setTitle("Text", for: .normal)
case .emoji: button.setTitle("Emoji", for: .normal)
case .recents: button.setTitle("Recents", for: .normal)
@unknown default: break
}
buttons.append(button)
button.addTarget(self, action: #selector(buttonSelected(button:)), for: .touchUpInside)
Expand Down
1 change: 1 addition & 0 deletions Swift/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use_frameworks!
target "Example" do
pod 'Giphy'

end
6 changes: 3 additions & 3 deletions Swift/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- DeepDiff (2.3.1)
- Giphy (1.2.3):
- Giphy (1.2.5):
- DeepDiff
- libwebp
- PINCache
Expand All @@ -27,10 +27,10 @@ SPEC REPOS:

SPEC CHECKSUMS:
DeepDiff: e5ae6c50d0321568e4508cec5930b9f10bb293fc
Giphy: 622540676cee6939daec392cdf59f786ef9a7bdd
Giphy: 76a033587d9291d5e6d2001897bd8fb11840c7df
libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3
PINCache: ce36ed282031b92fc7733ffe831f474ff80fddc2

PODFILE CHECKSUM: d659713d06e820a4ac8d6a631ef9c1ab030fdb5c
PODFILE CHECKSUM: 4df53eea3b338c70feb8cedc06b59db69f449c91

COCOAPODS: 1.8.4

0 comments on commit 9c0b1a8

Please sign in to comment.