CR: better method names

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 6eaa49593d
commit 891cc6ee0d

@ -110,7 +110,7 @@ class GifPickerCell: UICollectionViewCell {
// Record high quality animated rendition, but to save bandwidth, don't start downloading // Record high quality animated rendition, but to save bandwidth, don't start downloading
// until it's selected. // until it's selected.
guard let highQualityAnimatedRendition = imageInfo.pickHighQualityAnimatedRendition() else { guard let highQualityAnimatedRendition = imageInfo.pickSendingRendition() else {
Logger.warn("\(TAG) could not pick gif rendition: \(imageInfo.giphyId)") Logger.warn("\(TAG) could not pick gif rendition: \(imageInfo.giphyId)")
clearAssetRequests() clearAssetRequests()
return return
@ -119,7 +119,7 @@ class GifPickerCell: UICollectionViewCell {
// The Giphy API returns a slew of "renditions" for a given image. // The Giphy API returns a slew of "renditions" for a given image.
// It's critical that we carefully "pick" the best rendition to use. // It's critical that we carefully "pick" the best rendition to use.
guard let animatedRendition = imageInfo.pickAnimatedRendition() else { guard let animatedRendition = imageInfo.pickPreviewRendition() else {
Logger.warn("\(TAG) could not pick gif rendition: \(imageInfo.giphyId)") Logger.warn("\(TAG) could not pick gif rendition: \(imageInfo.giphyId)")
clearAssetRequests() clearAssetRequests()
return return

@ -125,7 +125,7 @@ extension GiphyError: LocalizedError {
return pickRendition(renditionType: .stillPreview, pickingStrategy:.smallerIsBetter, maxFileSize:kPreferedPreviewFileSize) return pickRendition(renditionType: .stillPreview, pickingStrategy:.smallerIsBetter, maxFileSize:kPreferedPreviewFileSize)
} }
public func pickAnimatedRendition() -> GiphyRendition? { public func pickPreviewRendition() -> GiphyRendition? {
// Try to pick a small file... // Try to pick a small file...
if let rendition = pickRendition(renditionType: .animatedLowQuality, pickingStrategy:.largerIsBetter, maxFileSize:kPreferedPreviewFileSize) { if let rendition = pickRendition(renditionType: .animatedLowQuality, pickingStrategy:.largerIsBetter, maxFileSize:kPreferedPreviewFileSize) {
return rendition return rendition
@ -138,7 +138,7 @@ extension GiphyError: LocalizedError {
return pickRendition(renditionType: .animatedLowQuality, pickingStrategy:.smallerIsBetter, maxFileSize:kPreferedPreviewFileSize * 3) return pickRendition(renditionType: .animatedLowQuality, pickingStrategy:.smallerIsBetter, maxFileSize:kPreferedPreviewFileSize * 3)
} }
public func pickHighQualityAnimatedRendition() -> GiphyRendition? { public func pickSendingRendition() -> GiphyRendition? {
// Try to pick a small file... // Try to pick a small file...
if let rendition = pickRendition(renditionType: .animatedHighQuality, pickingStrategy:.largerIsBetter, maxFileSize:kPreferedSendingFileSize) { if let rendition = pickRendition(renditionType: .animatedHighQuality, pickingStrategy:.largerIsBetter, maxFileSize:kPreferedSendingFileSize) {
return rendition return rendition

Loading…
Cancel
Save