Make GIF search more responsive

This commit is contained in:
Niels Andriesse 2021-05-06 13:43:31 +10:00
parent fb9a27df90
commit 2aa6fbb829
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ class GifPickerLayout: UICollectionViewLayout {
// We use 2 or 3 columns, depending on the device.
// 2 columns will show fewer GIFs at a time,
// but use less network & be a more responsive experience.
let columnCount = UInt(max(2, collectionView.width() / 130))
let columnCount = UInt(2)
let totalViewWidth = UInt(collectionView.width())
let hTotalWhitespace = (2 * hInset) + (hSpacing * (columnCount - 1))

View File

@ -285,13 +285,13 @@ extension GiphyError: LocalizedError {
private let kGiphyBaseURL = "https://api.giphy.com/"
private func giphyAPISessionManager() -> AFHTTPSessionManager? {
return ContentProxy.jsonSessionManager(baseUrl: kGiphyBaseURL)
return AFHTTPSessionManager(baseURL: URL(string: kGiphyBaseURL), sessionConfiguration: .ephemeral)
}
// MARK: Search
// This is the Signal iOS API key.
let kGiphyApiKey = "ZsUpUm2L6cVbvei347EQNp7HrROjbOdc"
let kGiphyPageSize = 100
let kGiphyPageSize = 20
public func trending() -> Promise<[GiphyImageInfo]> {
guard let sessionManager = giphyAPISessionManager() else {