From 764f570401d7bb111646b9abaa6807cf385dca51 Mon Sep 17 00:00:00 2001 From: Christopher Maier Date: Tue, 31 Mar 2020 10:50:08 -0400 Subject: [PATCH 1/3] v1.2.5 (recently picked feature) --- Swift/Example/ContentTypeSettingCell.swift | 2 ++ Swift/Podfile | 3 ++- Swift/Podfile.lock | 13 ++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Swift/Example/ContentTypeSettingCell.swift b/Swift/Example/ContentTypeSettingCell.swift index fc669b44..3672e3bf 100644 --- a/Swift/Example/ContentTypeSettingCell.swift +++ b/Swift/Example/ContentTypeSettingCell.swift @@ -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) diff --git a/Swift/Podfile b/Swift/Podfile index e5a3add0..50856af8 100644 --- a/Swift/Podfile +++ b/Swift/Podfile @@ -1,4 +1,5 @@ use_frameworks! target "Example" do -pod 'Giphy' +pod 'Giphy', :podspec => 'https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.2.5/Giphy.podspec' + end diff --git a/Swift/Podfile.lock b/Swift/Podfile.lock index 71bdb815..f1c616d3 100644 --- a/Swift/Podfile.lock +++ b/Swift/Podfile.lock @@ -1,6 +1,6 @@ PODS: - DeepDiff (2.3.1) - - Giphy (1.2.3): + - Giphy (1.2.5): - DeepDiff - libwebp - PINCache @@ -16,21 +16,24 @@ PODS: - PINCache (2.3) DEPENDENCIES: - - Giphy + - Giphy (from `https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.2.5/Giphy.podspec`) SPEC REPOS: trunk: - DeepDiff - - Giphy - libwebp - PINCache +EXTERNAL SOURCES: + Giphy: + :podspec: https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.2.5/Giphy.podspec + SPEC CHECKSUMS: DeepDiff: e5ae6c50d0321568e4508cec5930b9f10bb293fc - Giphy: 622540676cee6939daec392cdf59f786ef9a7bdd + Giphy: 76a033587d9291d5e6d2001897bd8fb11840c7df libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3 PINCache: ce36ed282031b92fc7733ffe831f474ff80fddc2 -PODFILE CHECKSUM: d659713d06e820a4ac8d6a631ef9c1ab030fdb5c +PODFILE CHECKSUM: 2b661ef9c2b26e9320c53b939681c548eae0d399 COCOAPODS: 1.8.4 From 1694d8b36a03b50742b27f1dfbe3342b42d14240 Mon Sep 17 00:00:00 2001 From: Christopher Maier Date: Tue, 31 Mar 2020 12:04:05 -0400 Subject: [PATCH 2/3] recently picked docs --- Docs.md | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Docs.md b/Docs.md index 1db23043..988f4716 100644 --- a/Docs.md +++ b/Docs.md @@ -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`. @@ -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 From 985f0ae1e72a63899e7c718c40c00a5549624dbf Mon Sep 17 00:00:00 2001 From: Christopher Maier Date: Tue, 31 Mar 2020 12:15:46 -0400 Subject: [PATCH 3/3] switch to released pod --- Swift/Podfile | 2 +- Swift/Podfile.lock | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Swift/Podfile b/Swift/Podfile index 50856af8..fc6e9476 100644 --- a/Swift/Podfile +++ b/Swift/Podfile @@ -1,5 +1,5 @@ use_frameworks! target "Example" do -pod 'Giphy', :podspec => 'https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.2.5/Giphy.podspec' +pod 'Giphy' end diff --git a/Swift/Podfile.lock b/Swift/Podfile.lock index f1c616d3..c371e8f4 100644 --- a/Swift/Podfile.lock +++ b/Swift/Podfile.lock @@ -16,24 +16,21 @@ PODS: - PINCache (2.3) DEPENDENCIES: - - Giphy (from `https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.2.5/Giphy.podspec`) + - Giphy SPEC REPOS: trunk: - DeepDiff + - Giphy - libwebp - PINCache -EXTERNAL SOURCES: - Giphy: - :podspec: https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/1.2.5/Giphy.podspec - SPEC CHECKSUMS: DeepDiff: e5ae6c50d0321568e4508cec5930b9f10bb293fc Giphy: 76a033587d9291d5e6d2001897bd8fb11840c7df libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3 PINCache: ce36ed282031b92fc7733ffe831f474ff80fddc2 -PODFILE CHECKSUM: 2b661ef9c2b26e9320c53b939681c548eae0d399 +PODFILE CHECKSUM: 4df53eea3b338c70feb8cedc06b59db69f449c91 COCOAPODS: 1.8.4