Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
coolryze committed May 19, 2017
1 parent 9803abf commit 3bdab49
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions YZPlayerDemo/YZPlayerDemo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

let videoListController = YZVideoListController()
let rootController = UINavigationController(rootViewController: videoListController)
let navigationController = UINavigationController(rootViewController: videoListController)

window = UIWindow()
window?.backgroundColor = UIColor.white
window?.rootViewController = rootController
window?.rootViewController = navigationController
window?.makeKeyAndVisible()

return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import UIKit
class YZCommentEditController: UIViewController {

deinit {
print("VideoCommentEditController deinit")
print("YZCommentEditController deinit")
NotificationCenter.default.removeObserver(self)
}

Expand Down
3 changes: 2 additions & 1 deletion YZPlayerDemo/YZPlayerDemo/Controller/YZVideoController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class YZVideoController: UIViewController {
}

deinit {
print("YZVideoController")
print("YZVideoController deinit")
}


Expand Down Expand Up @@ -195,6 +195,7 @@ extension YZVideoController: UITableViewDataSource {
extension YZVideoController: YZPlayerViewDelegate {

func backAction() {
print("back")
navigationController?.popViewController(animated: true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class YZVideoListController: UIViewController, UITableViewDelegate, UITableViewD


deinit {
print("MUMovController deinit")
print("YZVideoListController deinit")
}

override func viewWillAppear(_ animated: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@

import UIKit


extension UIBarButtonItem {


// 分类里 使用遍历构造器
convenience init(imageName: String? = nil, title: String? = nil, target: AnyObject?, action: Selector)
{
convenience init(imageName: String? = nil, title: String? = nil, target: AnyObject?, action: Selector) {
self.init() //遍历构造器必须调用自己的init

let button = UIButton()
Expand Down Expand Up @@ -43,5 +40,4 @@ extension UIBarButtonItem {
customView = button
}


}
9 changes: 4 additions & 5 deletions YZPlayerDemo/YZPlayerDemo/Tools/UIImage+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ fileprivate func > <T : Comparable>(lhs: T?, rhs: T?) -> Bool {

extension UIImage {

class func getScreenImage() -> UIImage
{
class func getScreenImage() -> UIImage {
let window = UIApplication.shared.keyWindow

// 开启图片类型上下文
Expand All @@ -56,7 +55,6 @@ extension UIImage {
return image!
}



/**
通过color获取纯色图片
Expand Down Expand Up @@ -121,7 +119,7 @@ extension UIImage {

extension UIImage {

///对指定图片进行拉伸
// 对指定图片进行拉伸
func resizableImage(name: String) -> UIImage {

var normal = UIImage(named: name)!
Expand Down Expand Up @@ -220,5 +218,6 @@ extension UIImage {
let result = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return result!
}
}

}
2 changes: 1 addition & 1 deletion YZPlayerDemo/YZPlayerDemo/View/List/YZVideoListCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class YZVideoListCell: UITableViewCell {

var video: YZDemoVideo? {
didSet {
frontCoverView.yy_setImage(with: URL(string: video!.poster), placeholder: UIImage(named: PLACEHOLDER_VIDEO))
frontCoverView.yy_setImage(with: URL(string: video!.poster), placeholder: UIImage(named: PLACEHOLDER_VIDEO), options: [.showNetworkActivity, .setImageWithFadeAnimation, .progressiveBlur])
lengthLabel.text = getTimeLengthStr(length: video!.length)
typeLabel.text = video!.typeString
// timeLabel.text = getTimeLengthStr(length: video!.length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class YZVideoListViewModel: NSObject {
// video 数组
var videoArr = [YZDemoVideo]()

// 舒适化数据
// 初始化数据
func setupData(success: ()->Void) {
let path = Bundle.main.bundlePath
let filePath = path+"/video"
Expand Down

0 comments on commit 3bdab49

Please sign in to comment.