Make GIF search more responsive
This commit is contained in:
parent
fb9a27df90
commit
2aa6fbb829
|
@ -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))
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue