Skip to content

Commit

Permalink
Merge pull request #35 from weiran/nuke
Browse files Browse the repository at this point in the history
Nuke
  • Loading branch information
weiran authored May 24, 2020
2 parents e60d44b + 080a22a commit 5fecaff
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
7 changes: 5 additions & 2 deletions App/DetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import AVKit
import TVUIKit

import Kingfisher
import Nuke
import PromiseKit
import TVVLCPlayer
import SwiftyUserDefaults
Expand Down Expand Up @@ -51,7 +51,10 @@ class DetailViewController: UIViewController {
if let videoProvider = try? VideoProvider.videoProvider(for: video.urlString) {
self.videoProvider = videoProvider
videoProvider.videoStream(preferredFormatType: Defaults[\.defaultVideoQualityKey]).done { [weak self] (videoStream) in
self?.thumbnailImageView.kf.setImage(with: videoStream.thumbnailURL)
if let imageView = self?.thumbnailImageView, let url = videoStream.thumbnailURL {
let options = ImageLoadingOptions(placeholder: UIImage(named: "ThumbnailPlaceholder"))
Nuke.loadImage(with: url, options: options, into: imageView)
}
self?.durationLabel.text = self?.formatTimeInterval(duration: videoStream.duration)
self?.duration = CMTime(seconds: videoStream.duration, preferredTimescale: CMTimeScale(videoStream.duration * 60))
if let format = videoStream.videoFormatType {
Expand Down
5 changes: 3 additions & 2 deletions App/VideoCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import UIKit
import TVUIKit
import Kingfisher
import Nuke

class VideoCell: UICollectionViewCell {
var posterView: TVPosterView
Expand Down Expand Up @@ -38,7 +38,8 @@ class VideoCell: UICollectionViewCell {
func setImageURL(url: URL) {
if let imageView = posterView.subviews[0].subviews[0] as? UIImageView {
imageView.contentMode = .scaleAspectFill
imageView.kf.setImage(with: url)
let options = ImageLoadingOptions(placeholder: UIImage(named: "ThumbnailPlaceholder"))
Nuke.loadImage(with: url, options: options, into: imageView)
}
}
}
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target 'WatchItLater' do
pod 'XCDYouTubeKit'
pod 'YTVimeoExtractor', :git => 'https://github.com/lilfaf/YTVimeoExtractor', :commit => '57bf479e860abd7dcd5fcbc520062cea3c7b5587'
pod 'Locksmith'
pod 'Kingfisher'
pod 'Nuke'
pod 'PromiseKit/CorePromise'
pod 'RealmSwift'
pod 'TVVLCKit'
Expand Down
34 changes: 16 additions & 18 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
PODS:
- Kingfisher (5.13.4):
- Kingfisher/Core (= 5.13.4)
- Kingfisher/Core (5.13.4)
- Locksmith (4.0.0)
- Nuke (9.0.0)
- PromiseKit/CorePromise (6.13.1)
- Realm (4.4.1):
- Realm/Headers (= 4.4.1)
- Realm/Headers (4.4.1)
- RealmSwift (4.4.1):
- Realm (= 4.4.1)
- Realm (5.0.0):
- Realm/Headers (= 5.0.0)
- Realm/Headers (5.0.0)
- RealmSwift (5.0.0):
- Realm (= 5.0.0)
- SwiftyUserDefaults (5.0.0)
- Swinject (2.7.1)
- SwinjectStoryboard (2.2.0):
- Swinject (~> 2.7.1)
- TVVLCKit (3.3.10)
- TVVLCKit (3.3.11)
- TVVLCPlayer (1.1.0):
- TVVLCKit
- XCDYouTubeKit (2.13.0)
- XCDYouTubeKit (2.14.0)
- YTVimeoExtractor (1.2.0)

DEPENDENCIES:
- Kingfisher
- Locksmith
- Nuke
- PromiseKit/CorePromise
- RealmSwift
- SwiftyUserDefaults
Expand All @@ -34,8 +32,8 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- Kingfisher
- Locksmith
- Nuke
- PromiseKit
- Realm
- RealmSwift
Expand Down Expand Up @@ -68,19 +66,19 @@ CHECKOUT OPTIONS:
:git: https://github.com/lilfaf/YTVimeoExtractor

SPEC CHECKSUMS:
Kingfisher: d2279a7abece3c7f25a80cd2b7f363ca5cf3f44c
Locksmith: e9bebbaaa4cee3c511bc358a44f843c3fe00e21f
Nuke: 4390bfb0fcde6aecf314f854439d03914ee7c604
PromiseKit: 28fda91c973cc377875d8c0ea4f973013c05b6db
Realm: 4eb04d7487bd43c0581256f40b424eafb711deff
RealmSwift: 3eb8924ff7100df5928c7602f71d0fec51e7c9c5
Realm: 76066d333de26f97e9caedaa85ee3ff4a62ca265
RealmSwift: c1bdff09b422569dc6881410d9ccf712bcdb79b0
SwiftyUserDefaults: 33fcb42bd1feb53a37d873feb62c82967db5f7f6
Swinject: ddf78b8486dd9b71a667b852cad919ab4484478e
SwinjectStoryboard: f0d5b1c16459949d6ff1cbb6610107946b18e1f8
TVVLCKit: f638dcaf37a6ba4027161cbc27be86f0cb02d2f7
TVVLCKit: 56f8ea4eaf17c2f46902590f758bf9083ac230c9
TVVLCPlayer: 357ae9ec2c52ff6cdd41588fe3e58525640a41eb
XCDYouTubeKit: 4902fca1721b593112b6607c509a089e911294f3
XCDYouTubeKit: 04a2f89dca6c5c53d1786701a0e98dcb484be7a8
YTVimeoExtractor: f4ed90f43e08d33d56c1d1aff3f4f64663747966

PODFILE CHECKSUM: 292b9cd9ac2e0d4bfed463267829e5c3a46a5bef
PODFILE CHECKSUM: 6c830d36ed915cef7de598851abfc6d5a3a828dd

COCOAPODS: 1.9.1
8 changes: 4 additions & 4 deletions WatchItLater.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,15 @@
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/WatchItLater.entitlements";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 35;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/**",
);
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.0;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = co.weiran.WatchItLater;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
Expand All @@ -594,15 +594,15 @@
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/WatchItLater.entitlements";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 35;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/**",
);
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.0;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = co.weiran.WatchItLater;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
Expand Down

0 comments on commit 5fecaff

Please sign in to comment.