├── JCYouku-master ├── JCYouku.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── mac.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── mac.xcuserdatad │ │ └── xcschemes │ │ ├── JCYouku.xcscheme │ │ └── xcschememanagement.plist ├── JCYouku.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── mac.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── JCYouku │ ├── AdView │ │ ├── AdView.h │ │ └── AdView.m │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── AppIcon29x29@2x.png │ │ │ ├── AppIcon29x29@3x.png │ │ │ ├── AppIcon40x40@2x.png │ │ │ ├── AppIcon57x57@2x.png │ │ │ ├── AppIcon60x60@2x.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── head_top50.imageset │ │ │ ├── Contents.json │ │ │ ├── head_top50.png │ │ │ └── head_top50@2x.png │ │ ├── navbar_icon_channel_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── navbar_icon_channel_normal@2x.png │ │ │ └── navbar_icon_channel_normal@3x.png │ │ ├── navbar_icon_channel_selected.imageset │ │ │ ├── Contents.json │ │ │ ├── navbar_icon_channel_selected@2x.png │ │ │ └── navbar_icon_channel_selected@3x.png │ │ ├── navbar_icon_home_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── navbar_icon_home_normal@2x.png │ │ │ └── navbar_icon_home_normal@3x.png │ │ ├── navbar_icon_home_selected.imageset │ │ │ ├── Contents.json │ │ │ ├── navbar_icon_home_selected@2x.png │ │ │ └── navbar_icon_home_selected@3x.png │ │ ├── navbar_icon_subscribe_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── navbar_icon_subscribe_normal@2x.png │ │ │ └── navbar_icon_subscribe_normal@3x.png │ │ ├── navbar_icon_subscribe_selected.imageset │ │ │ ├── Contents.json │ │ │ ├── navbar_icon_subscribe_selected@2x.png │ │ │ └── navbar_icon_subscribe_selected@3x.png │ │ ├── navbar_icon_user_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── navbar_icon_user_normal@2x.png │ │ │ └── navbar_icon_user_normal@3x.png │ │ ├── navbar_icon_user_selected.imageset │ │ │ ├── Contents.json │ │ │ ├── navbar_icon_user_selected@2x.png │ │ │ └── navbar_icon_user_selected@3x.png │ │ ├── navbar_search_icon.imageset │ │ │ ├── Contents.json │ │ │ ├── navbar_search_icon@2x.png │ │ │ └── navbar_search_icon@3x.png │ │ ├── search_smalldelete.imageset │ │ │ ├── Contents.json │ │ │ ├── search_smalldelete.png │ │ │ └── search_smalldelete@2x.png │ │ ├── search_smalltime.imageset │ │ │ ├── Contents.json │ │ │ ├── search_smalltime.png │ │ │ └── search_smalltime@2x.png │ │ ├── searchmore.imageset │ │ │ ├── Contents.json │ │ │ ├── searchmore.png │ │ │ └── searchmore@2x.png │ │ ├── topbar_icon_history_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── topbar_icon_history_normal@2x.png │ │ │ └── topbar_icon_history_normal@3x.png │ │ ├── topbar_icon_history_pressed.imageset │ │ │ ├── Contents.json │ │ │ ├── topbar_icon_history_pressed@2x.png │ │ │ └── topbar_icon_history_pressed@3x.png │ │ ├── topbar_icon_more_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── topbar_icon_more_normal@2x-1.png │ │ │ └── topbar_icon_more_normal@2x.png │ │ ├── topbar_icon_more_selected.imageset │ │ │ ├── Contents.json │ │ │ └── topbar_icon_more_selected@2x.png │ │ ├── topbar_icon_more_selected@2x 2.imageset │ │ │ ├── Contents.json │ │ │ └── topbar_icon_more_selected@2x 2.png │ │ ├── topbar_icon_search_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── topbar_icon_search_normal@2x.png │ │ │ └── topbar_icon_search_normal@3x.png │ │ ├── topbar_icon_search_pressed.imageset │ │ │ ├── Contents.json │ │ │ ├── topbar_icon_search_pressed@2x.png │ │ │ └── topbar_icon_search_pressed@3x.png │ │ ├── topbar_icon_upload_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── topbar_icon_upload_normal@2x.png │ │ │ └── topbar_icon_upload_normal@3x.png │ │ ├── topbar_icon_upload_pressed.imageset │ │ │ ├── Contents.json │ │ │ ├── topbar_icon_upload_pressed@2x.png │ │ │ └── topbar_icon_upload_pressed@3x.png │ │ ├── topbar_logo.imageset │ │ │ ├── Contents.json │ │ │ ├── topbar_logo@2x.png │ │ │ └── topbar_logo@3x.png │ │ ├── topbar_search_bg.imageset │ │ │ ├── Contents.json │ │ │ ├── topbar_search_bg@2x.png │ │ │ └── topbar_search_bg@3x.png │ │ ├── user_icon_vipcenter_click.imageset │ │ │ ├── Contents.json │ │ │ ├── user_icon_vipcenter_click@2x.png │ │ │ └── user_icon_vipcenter_click@3x.png │ │ └── user_icon_vipcenter_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── user_icon_vipcenter_normal@2x.png │ │ │ └── user_icon_vipcenter_normal@3x.png │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── Info.plist │ ├── JCChannelViewController.swift │ ├── JCConst.swift │ ├── JCFuzzyKeywordCell.swift │ ├── JCFuzzyKeywordViewController.swift │ ├── JCGradientView.swift │ ├── JCHomeSearchViewController.swift │ ├── JCHomeSliderCell.swift │ ├── JCHomeUnderSliderCell.swift │ ├── JCHomeViewController.swift │ ├── JCMineViewController.swift │ ├── JCSearchHistoryCell.swift │ ├── JCSearchHistoryClearCell.swift │ ├── JCSearchHistoryOpenCell.swift │ ├── JCSearchResultCell.swift │ ├── JCSearchResultViewController.swift │ ├── JCSubscribeViewController.swift │ ├── JCTabBarController.swift │ ├── JCYouku-Bridging-Header.h │ ├── SDWebImage │ │ ├── MKAnnotationView+WebCache.h │ │ ├── MKAnnotationView+WebCache.m │ │ ├── NSData+ImageContentType.h │ │ ├── NSData+ImageContentType.m │ │ ├── SDImageCache.h │ │ ├── SDImageCache.m │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageCompat.m │ │ ├── SDWebImageDecoder.h │ │ ├── SDWebImageDecoder.m │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloader.m │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageDownloaderOperation.m │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageManager.m │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImagePrefetcher.m │ │ ├── UIButton+WebCache.h │ │ ├── UIButton+WebCache.m │ │ ├── UIImage+GIF.h │ │ ├── UIImage+GIF.m │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImage+MultiFormat.m │ │ ├── UIImage+WebP.h │ │ ├── UIImage+WebP.m │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+HighlightedWebCache.m │ │ ├── UIImageView+WebCache.h │ │ ├── UIImageView+WebCache.m │ │ ├── UIView+WebCacheOperation.h │ │ └── UIView+WebCacheOperation.m │ └── UIView+extension.swift ├── JCYoukuTests │ ├── Info.plist │ └── JCYoukuTests.swift ├── JCYoukuUITests │ ├── Info.plist │ └── JCYoukuUITests.swift ├── Podfile ├── Podfile.lock └── Pods │ ├── Alamofire │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── Alamofire.swift │ │ ├── Download.swift │ │ ├── Error.swift │ │ ├── Manager.swift │ │ ├── MultipartFormData.swift │ │ ├── ParameterEncoding.swift │ │ ├── Request.swift │ │ ├── Response.swift │ │ ├── ResponseSerialization.swift │ │ ├── Result.swift │ │ ├── ServerTrustPolicy.swift │ │ ├── Stream.swift │ │ ├── Upload.swift │ │ └── Validation.swift │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── mac.xcuserdatad │ │ └── xcschemes │ │ ├── Alamofire.xcscheme │ │ ├── Pods.xcscheme │ │ └── xcschememanagement.plist │ └── Target Support Files │ ├── Alamofire │ ├── Alamofire-dummy.m │ ├── Alamofire-prefix.pch │ ├── Alamofire-umbrella.h │ ├── Alamofire.modulemap │ ├── Alamofire.xcconfig │ └── Info.plist │ └── Pods │ ├── Info.plist │ ├── Pods-acknowledgements.markdown │ ├── Pods-acknowledgements.plist │ ├── Pods-dummy.m │ ├── Pods-frameworks.sh │ ├── Pods-resources.sh │ ├── Pods-umbrella.h │ ├── Pods.debug.xcconfig │ ├── Pods.modulemap │ └── Pods.release.xcconfig ├── LICENSE └── README.md /JCYouku-master/JCYouku.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JCYouku-master/JCYouku.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/JCYouku.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JCYouku.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 04F72CA71C3FB83E008AA097 16 | 17 | primary 18 | 19 | 20 | 04F72CBB1C3FB83E008AA097 21 | 22 | primary 23 | 24 | 25 | 04F72CC61C3FB83E008AA097 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JCYouku-master/JCYouku.xcworkspace/xcuserdata/mac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/AdView/AdView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AdView.h 3 | // 广告循环滚动效果 4 | // 5 | // Created by QzydeMac on 14/12/24. 6 | // Copyright (c) 2014年 Qzy. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef NS_ENUM(NSUInteger, UIPageControlShowStyle) 11 | { 12 | /** 13 | * @author ZY, 15-04-26 14 | * 15 | * 不显示PageControl 16 | */ 17 | UIPageControlShowStyleNone,//default 18 | UIPageControlShowStyleLeft, 19 | UIPageControlShowStyleCenter, 20 | UIPageControlShowStyleRight, 21 | }; 22 | 23 | typedef NS_ENUM(NSUInteger, AdTitleShowStyle) 24 | { 25 | /** 26 | * @author ZY, 15-04-26 27 | * 28 | * 不显示标题 29 | */ 30 | AdTitleShowStyleNone, 31 | AdTitleShowStyleLeft, 32 | AdTitleShowStyleCenter, 33 | AdTitleShowStyleRight, 34 | }; 35 | 36 | @interface AdView : UIView 37 | { 38 | UILabel * _centerAdLabel; 39 | CGFloat _adMoveTime; 40 | } 41 | 42 | /* 43 | 可以在adScrollView上添加一些不随广告滚动的控件 44 | */ 45 | @property (retain,nonatomic,readonly) UIScrollView * adScrollView; 46 | @property (retain,nonatomic) UIPageControl * pageControl; 47 | @property (retain,nonatomic) NSArray * imageLinkURL; 48 | @property (retain,nonatomic) NSArray * adTitleArray; 49 | /** 50 | * @author ZY, 15-05-17 51 | * 52 | * 设置page显示位置 53 | */ 54 | @property (assign,nonatomic) UIPageControlShowStyle PageControlShowStyle; 55 | /** 56 | * @author ZY, 15-05-17 57 | * 58 | * 设置标题对应的位置 59 | */ 60 | @property (assign,nonatomic,readonly) AdTitleShowStyle adTitleStyle; 61 | 62 | /** 63 | * @author ZY, 15-05-17 64 | * 65 | * 设置占位图片 66 | */ 67 | @property (nonatomic,strong) UIImage * placeHoldImage; 68 | 69 | /** 70 | * @author ZY, 15-05-17 71 | * 72 | * 是否需要定时循环滚动 73 | */ 74 | @property (nonatomic,assign) BOOL isNeedCycleRoll; 75 | 76 | /** 77 | * @author ZY, 15-04-26 78 | * 79 | * @brief 图片移动计时器 80 | */ 81 | @property (nonatomic,assign) CGFloat adMoveTime; 82 | /** 83 | * @author ZY, 15-04-26 84 | * 85 | * @brief 在这里修改Label的一些属性 86 | */ 87 | @property (nonatomic,strong,readonly) UILabel * centerAdLabel; 88 | 89 | /** 90 | * @author ZY, 15-04-26 91 | * 92 | * @brief 给图片创建点击后的回调方法 93 | */ 94 | @property (nonatomic,strong) void (^callBack)(NSInteger index,NSString * imageURL); 95 | 96 | /* 97 | 通过模型获取当前被点击对象,并回传当前图片的模型,只有在使用模型初始化AdView时有效 98 | */ 99 | @property (nonatomic,strong) void (^callBackForModel)(id model); 100 | 101 | 102 | /** 103 | * @author ZY, 15-04-26 104 | * 105 | * @brief 设置每个图片下方的标题 106 | * 107 | * @param adTitleArray 标题数组 108 | * @param adTitleStyle 标题显示风格 109 | */ 110 | - (void)setAdTitleArray:(NSArray *)adTitleArray withShowStyle:(AdTitleShowStyle)adTitleStyle; 111 | 112 | /* 113 | 使用模型创建对象的时候可以使用该方法,创建标题,只需要指出文字在模型中对应的名称 114 | */ 115 | - (void)setAdTitlePropertyName:(NSString *)titleName withShowStyle:(AdTitleShowStyle)adTitleStyle; 116 | 117 | /** 118 | * @author ZY, 15-04-26 119 | * 120 | * @brief 创建AdView对象 121 | * 122 | * @param frame 设置Frame 123 | * @param imageLinkURL 图片链接地址数组,数组的每一项均为字符串 124 | * @param imageName 占位图片 125 | * @param PageControlShowStyle PageControl显示位置 126 | * @param object 控件在那个类文件中 127 | * @return 广告视图 128 | */ 129 | + (id)adScrollViewWithFrame:(CGRect)frame imageLinkURL:(NSArray *)imageLinkURL placeHoderImageName:(NSString *)imageName pageControlShowStyle:(UIPageControlShowStyle)PageControlShowStyle; 130 | 131 | /** 132 | * @author ZY, 15-04-26 133 | * 134 | * @brief 创建AdView对象 135 | * 136 | * @param frame 设置Frame 137 | * @param imageLinkURL 本地图片名称数组 138 | * @param PageControlShowStyle PageControl显示位置 139 | * @param object 控件在那个类文件中 140 | * @return 广告视图 141 | */ 142 | + (id)adScrollViewWithFrame:(CGRect)frame localImageLinkURL:(NSArray *)imageLinkURL pageControlShowStyle:(UIPageControlShowStyle)PageControlShowStyle; 143 | 144 | /** 145 | * 传递模型数组,每个模型中都拥有自己的图片链接属性 146 | * 147 | * @param modelArr 模型数组 148 | * @param imageName 属性名称 149 | */ 150 | + (id)adScrollViewWithFrame:(CGRect)frame modelArr:(NSArray *)modelArr imagePropertyName:(NSString *)imageName pageControlShowStyle:(UIPageControlShowStyle)PageControlShowStyle; 151 | @end 152 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/8. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | 20 | window = UIWindow(frame: UIScreen.mainScreen().bounds) 21 | window?.rootViewController = JCTabBarController() 22 | window?.makeKeyAndVisible() 23 | return true 24 | } 25 | 26 | func applicationWillResignActive(application: UIApplication) { 27 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 28 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 29 | } 30 | 31 | func applicationDidEnterBackground(application: UIApplication) { 32 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 33 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 34 | } 35 | 36 | func applicationWillEnterForeground(application: UIApplication) { 37 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | func applicationDidBecomeActive(application: UIApplication) { 41 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 42 | } 43 | 44 | func applicationWillTerminate(application: UIApplication) { 45 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 46 | } 47 | 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon57x57@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "size" : "29x29", 10 | "idiom" : "iphone", 11 | "filename" : "AppIcon29x29@2x.png", 12 | "scale" : "2x" 13 | }, 14 | { 15 | "size" : "29x29", 16 | "idiom" : "iphone", 17 | "filename" : "AppIcon29x29@3x.png", 18 | "scale" : "3x" 19 | }, 20 | { 21 | "size" : "40x40", 22 | "idiom" : "iphone", 23 | "filename" : "AppIcon40x40@2x.png", 24 | "scale" : "2x" 25 | }, 26 | { 27 | "idiom" : "iphone", 28 | "size" : "40x40", 29 | "scale" : "3x" 30 | }, 31 | { 32 | "idiom" : "iphone", 33 | "size" : "57x57", 34 | "scale" : "1x" 35 | }, 36 | { 37 | "size" : "57x57", 38 | "idiom" : "iphone", 39 | "filename" : "AppIcon57x57@2x.png", 40 | "scale" : "2x" 41 | }, 42 | { 43 | "size" : "60x60", 44 | "idiom" : "iphone", 45 | "filename" : "AppIcon60x60@2x.png", 46 | "scale" : "2x" 47 | }, 48 | { 49 | "idiom" : "iphone", 50 | "size" : "60x60", 51 | "scale" : "3x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "8.0", 8 | "subtype" : "736h", 9 | "scale" : "3x" 10 | }, 11 | { 12 | "orientation" : "landscape", 13 | "idiom" : "iphone", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "8.0", 16 | "subtype" : "736h", 17 | "scale" : "3x" 18 | }, 19 | { 20 | "orientation" : "portrait", 21 | "idiom" : "iphone", 22 | "extent" : "full-screen", 23 | "minimum-system-version" : "8.0", 24 | "subtype" : "667h", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "orientation" : "portrait", 29 | "idiom" : "iphone", 30 | "extent" : "full-screen", 31 | "minimum-system-version" : "7.0", 32 | "scale" : "2x" 33 | }, 34 | { 35 | "orientation" : "portrait", 36 | "idiom" : "iphone", 37 | "extent" : "full-screen", 38 | "minimum-system-version" : "7.0", 39 | "subtype" : "retina4", 40 | "scale" : "2x" 41 | }, 42 | { 43 | "orientation" : "portrait", 44 | "idiom" : "iphone", 45 | "extent" : "full-screen", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "orientation" : "portrait", 50 | "idiom" : "iphone", 51 | "extent" : "full-screen", 52 | "scale" : "2x" 53 | }, 54 | { 55 | "orientation" : "portrait", 56 | "idiom" : "iphone", 57 | "extent" : "full-screen", 58 | "subtype" : "retina4", 59 | "scale" : "2x" 60 | } 61 | ], 62 | "info" : { 63 | "version" : 1, 64 | "author" : "xcode" 65 | } 66 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/head_top50.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "head_top50.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "head_top50@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/head_top50.imageset/head_top50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/head_top50.imageset/head_top50.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/head_top50.imageset/head_top50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/head_top50.imageset/head_top50@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navbar_icon_channel_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navbar_icon_channel_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_normal.imageset/navbar_icon_channel_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_normal.imageset/navbar_icon_channel_normal@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_normal.imageset/navbar_icon_channel_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_normal.imageset/navbar_icon_channel_normal@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navbar_icon_channel_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navbar_icon_channel_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_selected.imageset/navbar_icon_channel_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_selected.imageset/navbar_icon_channel_selected@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_selected.imageset/navbar_icon_channel_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_channel_selected.imageset/navbar_icon_channel_selected@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navbar_icon_home_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navbar_icon_home_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_normal.imageset/navbar_icon_home_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_normal.imageset/navbar_icon_home_normal@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_normal.imageset/navbar_icon_home_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_normal.imageset/navbar_icon_home_normal@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navbar_icon_home_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navbar_icon_home_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_selected.imageset/navbar_icon_home_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_selected.imageset/navbar_icon_home_selected@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_selected.imageset/navbar_icon_home_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_home_selected.imageset/navbar_icon_home_selected@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navbar_icon_subscribe_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navbar_icon_subscribe_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_normal.imageset/navbar_icon_subscribe_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_normal.imageset/navbar_icon_subscribe_normal@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_normal.imageset/navbar_icon_subscribe_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_normal.imageset/navbar_icon_subscribe_normal@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navbar_icon_subscribe_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navbar_icon_subscribe_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_selected.imageset/navbar_icon_subscribe_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_selected.imageset/navbar_icon_subscribe_selected@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_selected.imageset/navbar_icon_subscribe_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_subscribe_selected.imageset/navbar_icon_subscribe_selected@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navbar_icon_user_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navbar_icon_user_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_normal.imageset/navbar_icon_user_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_normal.imageset/navbar_icon_user_normal@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_normal.imageset/navbar_icon_user_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_normal.imageset/navbar_icon_user_normal@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navbar_icon_user_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navbar_icon_user_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_selected.imageset/navbar_icon_user_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_selected.imageset/navbar_icon_user_selected@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_selected.imageset/navbar_icon_user_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_icon_user_selected.imageset/navbar_icon_user_selected@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_search_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "navbar_search_icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "navbar_search_icon@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_search_icon.imageset/navbar_search_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_search_icon.imageset/navbar_search_icon@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/navbar_search_icon.imageset/navbar_search_icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/navbar_search_icon.imageset/navbar_search_icon@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/search_smalldelete.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "search_smalldelete.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "search_smalldelete@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/search_smalldelete.imageset/search_smalldelete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/search_smalldelete.imageset/search_smalldelete.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/search_smalldelete.imageset/search_smalldelete@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/search_smalldelete.imageset/search_smalldelete@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/search_smalltime.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "search_smalltime.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "search_smalltime@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/search_smalltime.imageset/search_smalltime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/search_smalltime.imageset/search_smalltime.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/search_smalltime.imageset/search_smalltime@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/search_smalltime.imageset/search_smalltime@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/searchmore.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "searchmore.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "searchmore@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/searchmore.imageset/searchmore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/searchmore.imageset/searchmore.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/searchmore.imageset/searchmore@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/searchmore.imageset/searchmore@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_icon_history_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "topbar_icon_history_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_normal.imageset/topbar_icon_history_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_normal.imageset/topbar_icon_history_normal@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_normal.imageset/topbar_icon_history_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_normal.imageset/topbar_icon_history_normal@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_pressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_icon_history_pressed@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "topbar_icon_history_pressed@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_pressed.imageset/topbar_icon_history_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_pressed.imageset/topbar_icon_history_pressed@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_pressed.imageset/topbar_icon_history_pressed@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_history_pressed.imageset/topbar_icon_history_pressed@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_icon_more_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | }, 16 | { 17 | "idiom" : "universal", 18 | "filename" : "topbar_icon_more_normal@2x-1.png", 19 | "unassigned" : true, 20 | "scale" : "2x" 21 | } 22 | ], 23 | "info" : { 24 | "version" : 1, 25 | "author" : "xcode" 26 | } 27 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_normal.imageset/topbar_icon_more_normal@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_normal.imageset/topbar_icon_more_normal@2x-1.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_normal.imageset/topbar_icon_more_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_normal.imageset/topbar_icon_more_normal@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_icon_more_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_selected.imageset/topbar_icon_more_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_selected.imageset/topbar_icon_more_selected@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_selected@2x 2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "topbar_icon_more_selected@2x 2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_selected@2x 2.imageset/topbar_icon_more_selected@2x 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_more_selected@2x 2.imageset/topbar_icon_more_selected@2x 2.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_icon_search_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "topbar_icon_search_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_normal.imageset/topbar_icon_search_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_normal.imageset/topbar_icon_search_normal@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_normal.imageset/topbar_icon_search_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_normal.imageset/topbar_icon_search_normal@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_pressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_icon_search_pressed@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "topbar_icon_search_pressed@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_pressed.imageset/topbar_icon_search_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_pressed.imageset/topbar_icon_search_pressed@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_pressed.imageset/topbar_icon_search_pressed@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_search_pressed.imageset/topbar_icon_search_pressed@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_icon_upload_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "topbar_icon_upload_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_normal.imageset/topbar_icon_upload_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_normal.imageset/topbar_icon_upload_normal@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_normal.imageset/topbar_icon_upload_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_normal.imageset/topbar_icon_upload_normal@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_pressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_icon_upload_pressed@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "topbar_icon_upload_pressed@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_pressed.imageset/topbar_icon_upload_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_pressed.imageset/topbar_icon_upload_pressed@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_pressed.imageset/topbar_icon_upload_pressed@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_icon_upload_pressed.imageset/topbar_icon_upload_pressed@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_logo@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "topbar_logo@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_logo.imageset/topbar_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_logo.imageset/topbar_logo@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_logo.imageset/topbar_logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_logo.imageset/topbar_logo@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_search_bg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "topbar_search_bg@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "topbar_search_bg@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_search_bg.imageset/topbar_search_bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_search_bg.imageset/topbar_search_bg@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/topbar_search_bg.imageset/topbar_search_bg@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/topbar_search_bg.imageset/topbar_search_bg@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_click.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "user_icon_vipcenter_click@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "user_icon_vipcenter_click@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_click.imageset/user_icon_vipcenter_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_click.imageset/user_icon_vipcenter_click@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_click.imageset/user_icon_vipcenter_click@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_click.imageset/user_icon_vipcenter_click@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "user_icon_vipcenter_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "user_icon_vipcenter_normal@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_normal.imageset/user_icon_vipcenter_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_normal.imageset/user_icon_vipcenter_normal@2x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_normal.imageset/user_icon_vipcenter_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichDaddyCashMany/JCYouku/70077220c749b54e9004c716a6eee96b88aa3a58/JCYouku-master/JCYouku/Assets.xcassets/user_icon_vipcenter_normal.imageset/user_icon_vipcenter_normal@3x.png -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UIRequiredDeviceCapabilities 31 | 32 | armv7 33 | 34 | UISupportedInterfaceOrientations 35 | 36 | UIInterfaceOrientationPortrait 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCChannelViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCChannelViewController.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/11. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class JCChannelViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | // Do any additional setup after loading the view. 17 | } 18 | 19 | override func didReceiveMemoryWarning() { 20 | super.didReceiveMemoryWarning() 21 | // Dispose of any resources that can be recreated. 22 | } 23 | 24 | 25 | /* 26 | // MARK: - Navigation 27 | 28 | // In a storyboard-based application, you will often want to do a little preparation before navigation 29 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 30 | // Get the new view controller using segue.destinationViewController. 31 | // Pass the selected object to the new view controller. 32 | } 33 | */ 34 | 35 | } 36 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCConst.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | public let ScreenWidth = UIScreen.mainScreen().bounds.size.width 4 | public let ScreenHeight = UIScreen.mainScreen().bounds.size.height 5 | public func JCColor(r: CGFloat, g: CGFloat, b: CGFloat) -> UIColor { 6 | return UIColor(red: r/255.0, green: g/255.0, blue: b/255.0, alpha: 1) 7 | } 8 | // 背景色 9 | public let GlobalBackgroundColor = JCColor(222, g: 222, b: 222) 10 | // 分割线颜色 11 | public let GlobalLineColor = JCColor(220, g: 220, b: 220) 12 | // 历史搜索关键词保存的地址 13 | public var HistorySearchKeyFileName: String { 14 | var path = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true)[0] 15 | path.appendContentsOf("/HistorySearchKey.plist") 16 | return path 17 | } 18 | // 拉伸图片 19 | public func resizeImage(img: UIImage?) -> UIImage { 20 | if img == nil { 21 | print("Error:resizeImage received a wrong param") 22 | return UIImage() 23 | } else { 24 | return img!.stretchableImageWithLeftCapWidth(Int(img!.size.width / 2), topCapHeight: Int(img!.size.height / 2)) 25 | } 26 | } 27 | 28 | 29 | // --------------开放接口-------------- 30 | // 开放平台:cloud.youku.com 31 | // 优酷client_id 32 | public let ClientIdKey = "client_id" 33 | public let ClientIdValue = "c4e85b0f15342f4e" 34 | // 搜索视频 35 | public let API_SearchVideo = "https://openapi.youku.com/v2/searches/video/by_keyword.json" 36 | // 关键词联想 37 | public let API_FuzzyKeyword = "https://openapi.youku.com/v2/searches/keyword/complete.json" 38 | 39 | // --------------抓包接口-------------- 40 | // 首页请求连接 41 | public let URL_Home = "http://api.mobile.youku.com/layout/iphone/v5/home?pid=69b81504767483cf&ver=5.3.1" 42 | // 搜索排行榜 43 | public let URL_HotKey = "http://search.api.3g.youku.com/search/hotkeys?pid=69b81504767483cf&ver=5.3.1" 44 | 45 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCFuzzyKeywordCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCFuzzyKeywordCell.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/15. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class JCFuzzyKeywordCell: UITableViewCell { 12 | var nameLabel: UILabel! 13 | var bottomLine: UIView! 14 | 15 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 16 | super.init(style: style, reuseIdentifier: reuseIdentifier) 17 | 18 | setupViews() 19 | } 20 | 21 | required init?(coder aDecoder: NSCoder) { 22 | fatalError("init(coder:) has not been implemented") 23 | } 24 | 25 | func setupViews() { 26 | nameLabel = UILabel(frame: CGRectMake(16, 0, ScreenWidth - 32, 45)) 27 | nameLabel.font = UIFont.systemFontOfSize(14) 28 | nameLabel.textColor = JCColor(102, g: 102, b: 102) 29 | contentView.addSubview(nameLabel) 30 | 31 | bottomLine = UIView(frame: CGRectMake(9, 44.5, ScreenWidth - 18, 0.5)) 32 | bottomLine.backgroundColor = GlobalLineColor 33 | contentView.addSubview(bottomLine) 34 | } 35 | 36 | func configCell(name: String) { 37 | nameLabel.text = name 38 | } 39 | 40 | func hideBottmLine(hide: Bool) { 41 | bottomLine.hidden = hide 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCFuzzyKeywordViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCFuzzyKeywordViewController.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/15. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Alamofire 11 | 12 | protocol JCFuzzyKeywordViewControllerDelegate: NSObjectProtocol { 13 | // 选择了关键词 14 | func chooseFuzzyKeyword(keyword: String) 15 | } 16 | 17 | class JCFuzzyKeywordViewController: UITableViewController { 18 | weak var delegate: JCFuzzyKeywordViewControllerDelegate! 19 | var data: NSArray = NSArray() 20 | let fuzzyKeywordCellIdentifier = "fuzzyKeywordCellIdentifier" 21 | 22 | override func viewDidLoad() { 23 | super.viewDidLoad() 24 | 25 | self.tableView.backgroundColor = GlobalBackgroundColor 26 | self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None 27 | self.tableView.registerClass(JCFuzzyKeywordCell.self, forCellReuseIdentifier: fuzzyKeywordCellIdentifier) 28 | } 29 | 30 | func searchKeyword(keyword: String) { 31 | // 关键词联想 32 | let param = [ClientIdKey: ClientIdValue, "keyword": keyword] 33 | Alamofire.request(.GET, API_FuzzyKeyword, parameters: param).responseJSON { response in 34 | if let json = response.result.value { 35 | let dict = json as! NSDictionary 36 | if dict["error"] == nil { 37 | self.data = dict["r"] as! NSArray 38 | self.tableView.reloadData() 39 | } 40 | } 41 | } 42 | } 43 | 44 | override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { 45 | return 45 46 | } 47 | 48 | // MARK: - Table view data source 49 | 50 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 51 | return self.data.count 52 | } 53 | 54 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 55 | let cell = tableView.dequeueReusableCellWithIdentifier(fuzzyKeywordCellIdentifier, forIndexPath: indexPath) as! JCFuzzyKeywordCell 56 | let dict = self.data[indexPath.row] as! NSDictionary 57 | cell.configCell(dict["c"] as! String) 58 | if indexPath.row == self.data.count - 1 { 59 | cell.hideBottmLine(true) 60 | } else { 61 | cell.hideBottmLine(false) 62 | } 63 | cell.selectionStyle = UITableViewCellSelectionStyle.None 64 | return cell 65 | } 66 | 67 | override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 68 | let dict = self.data[indexPath.row] as! NSDictionary 69 | self.delegate?.chooseFuzzyKeyword(dict["c"] as! String) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCGradientView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCGradientView.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/13. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | // 渐变层,用于突出图片上的白色文字 10 | 11 | import UIKit 12 | 13 | class JCGradientView: UIView { 14 | override func willMoveToSuperview(newSuperview: UIView?) { 15 | self.frame = newSuperview!.bounds 16 | let gradientLayer = CAGradientLayer() 17 | gradientLayer.bounds = newSuperview!.bounds 18 | gradientLayer.position = newSuperview!.center 19 | gradientLayer.colors = [UIColor.clearColor().CGColor, UIColor.blackColor().CGColor] 20 | self.layer.addSublayer(gradientLayer) 21 | self.alpha = 0.5 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCHomeSliderCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCHomeSliderCell.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/13. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class JCHomeSliderCell: UITableViewCell { 12 | var adView: AdView! 13 | var menu: UIView! 14 | var btnImgViews: [UIImageView]! = [] 15 | var btnLabels: [UILabel]! = [] 16 | 17 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 18 | super.init(style: style, reuseIdentifier: reuseIdentifier) 19 | 20 | setupViews() 21 | } 22 | 23 | func setupViews() { 24 | // 轮播图 25 | adView = AdView(frame: CGRectMake(0, 0, ScreenWidth, 0.469 * ScreenWidth)) 26 | 27 | // 10个按钮的菜单 28 | menu = UIView(frame: CGRectMake(0, CGRectGetMaxY(adView.frame), ScreenWidth, 0.422 * ScreenWidth)) 29 | let btnWidth = ScreenWidth / 5 30 | let btnHeight = menu.height / 2 31 | for index in 0...9 { 32 | // 按钮 33 | let btn = UIButton(frame: CGRectMake(CGFloat(Int(CGFloat(index) % 5)) * btnWidth, CGFloat(Int(CGFloat(index) / 5)) * btnHeight + 10, btnWidth, menu.height / 2)) 34 | menu.addSubview(btn) 35 | // 图标 36 | let imgView = UIImageView(frame: CGRectMake(0, 0, 36, 36)) 37 | imgView.centerX = btn.width / 2 38 | imgView.centerY = 14 39 | btn.addSubview(imgView) 40 | // 文字 41 | let label = UILabel(frame: CGRectMake(0, 0, btnWidth, 11)) 42 | label.textAlignment = NSTextAlignment.Center 43 | label.textColor = JCColor(85, g: 85, b: 85) 44 | label.font = UIFont.systemFontOfSize(11) 45 | label.centerY = 40 46 | btn.addSubview(label) 47 | 48 | btnImgViews.append(imgView) 49 | btnLabels.append(label) 50 | } 51 | 52 | contentView.addSubview(adView) 53 | contentView.addSubview(menu) 54 | } 55 | 56 | func setJson(json: NSDictionary) { 57 | let results = json["results"] as! NSArray 58 | let result0 = results[0] 59 | let slider = result0["slider"] as! NSArray 60 | var imgs: [String] = [] 61 | var titles: [String] = [] 62 | for item in slider { 63 | imgs.append(item["img"] as! String) 64 | titles.append(item["title"] as! String) 65 | } 66 | 67 | adView.imageLinkURL = imgs 68 | adView.setAdTitleArray(titles, withShowStyle: AdTitleShowStyle.Left) 69 | 70 | let navigation = result0["navigation"] as! NSArray 71 | var menuTitles: [String] = [] 72 | var menuImages: [String] = [] 73 | for item in navigation { 74 | menuTitles.append(item["title"] as! String) 75 | menuImages.append(item["icon_large"] as! String) 76 | } 77 | 78 | for index in 0...9 { 79 | btnImgViews[index].sd_setImageWithURL(NSURL(string: menuImages[index])) 80 | btnLabels[index].text = menuTitles[index] 81 | } 82 | } 83 | 84 | required init?(coder aDecoder: NSCoder) { 85 | fatalError("init(coder:) has not been implemented") 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCHomeUnderSliderCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCHomeUnderSliderCell.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/13. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class JCHomeUnderSliderCell: UITableViewCell { 12 | var imgViews: [UIImageView]! = [] 13 | var imgLabels: [UILabel]! = [] 14 | var bigLabels: [UILabel]! = [] 15 | var smallLabels: [UILabel]! = [] 16 | 17 | 18 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 19 | super.init(style: style, reuseIdentifier: reuseIdentifier) 20 | 21 | setupViews() 22 | } 23 | 24 | required init?(coder aDecoder: NSCoder) { 25 | fatalError("init(coder:) has not been implemented") 26 | } 27 | 28 | func setupViews() { 29 | let bgViewWidth = ScreenWidth / 2 30 | let bgViewHeight = 0.281 * ScreenWidth + 50 31 | 32 | for index in 0...3 { 33 | let bgView0 = UIView(frame: CGRectMake(bgViewWidth * CGFloat(Int(CGFloat(index) % 2)), bgViewHeight * CGFloat(Int(CGFloat(index) / 2)), bgViewWidth, bgViewHeight)) 34 | contentView.addSubview(bgView0) 35 | 36 | let imgView = UIImageView(frame: CGRectMake(0, 0, bgViewWidth, bgView0.height - 50)) 37 | bgView0.addSubview(imgView) 38 | 39 | imgView.addSubview(JCGradientView()) 40 | 41 | let imgLabel = UILabel(frame: CGRectMake(12, 0, bgViewWidth - 24, 11)) 42 | imgLabel.centerY = 0.244 * ScreenWidth 43 | imgLabel.textColor = UIColor.whiteColor() 44 | imgLabel.font = UIFont.systemFontOfSize(11) 45 | bgView0.addSubview(imgLabel) 46 | 47 | let bigLabel = UILabel(frame: CGRectMake(12, 0, bgViewWidth - 24, 14)) 48 | bigLabel.centerY = imgView.height + 14 49 | bigLabel.textColor = JCColor(51, g: 51, b: 51) 50 | bigLabel.font = UIFont.systemFontOfSize(14) 51 | bgView0.addSubview(bigLabel) 52 | 53 | let smallLabel = UILabel(frame: CGRectMake(12, 0, bgViewWidth - 24, 11)) 54 | smallLabel.centerY = imgView.height + 32 55 | smallLabel.textColor = JCColor(200, g: 200, b: 200) 56 | smallLabel.font = UIFont.systemFontOfSize(11) 57 | bgView0.addSubview(smallLabel) 58 | 59 | imgViews.append(imgView) 60 | imgLabels.append(imgLabel) 61 | bigLabels.append(bigLabel) 62 | smallLabels.append(smallLabel) 63 | } 64 | } 65 | 66 | func setJson(json: NSDictionary) { 67 | let results = json["results"] as! NSArray 68 | let result0 = results[0] 69 | let under_slider = result0["under_slider"] as! NSArray 70 | var imgs: [String] = [] 71 | var imgTitles: [String] = [] 72 | var bigTitles: [String] = [] 73 | var smallTitles: [String] = [] 74 | for item in under_slider { 75 | imgs.append(item["img"] as! String) 76 | imgTitles.append(item["summary"] as! String) 77 | bigTitles.append(item["title"] as! String) 78 | smallTitles.append(item["subtitle"] as! String) 79 | } 80 | 81 | for index in 0...3 { 82 | imgViews[index].sd_setImageWithURL(NSURL(string: imgs[index])) 83 | imgLabels[index].text = imgTitles[index] 84 | bigLabels[index].text = bigTitles[index] 85 | smallLabels[index].text = smallTitles[index] 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCMineViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCMineViewController.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/11. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class JCMineViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | // Do any additional setup after loading the view. 17 | } 18 | 19 | override func didReceiveMemoryWarning() { 20 | super.didReceiveMemoryWarning() 21 | // Dispose of any resources that can be recreated. 22 | } 23 | 24 | 25 | /* 26 | // MARK: - Navigation 27 | 28 | // In a storyboard-based application, you will often want to do a little preparation before navigation 29 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 30 | // Get the new view controller using segue.destinationViewController. 31 | // Pass the selected object to the new view controller. 32 | } 33 | */ 34 | 35 | } 36 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCSearchHistoryCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCSearchHistoryCell.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/14. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol JCSearchHistoryCellDelegate: NSObjectProtocol{ 12 | // 删除历史搜索关键字 13 | func deleteHistoryKey(key: String) 14 | // 点击历史搜索关键字 15 | func clickHistoryKey(key: String) 16 | } 17 | 18 | class JCSearchHistoryCell: UITableViewCell { 19 | var keyLabel: UILabel! 20 | weak var delegate: JCSearchHistoryCellDelegate! 21 | var line: UIView! 22 | 23 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 24 | super.init(style: style, reuseIdentifier: reuseIdentifier) 25 | 26 | setupViews() 27 | } 28 | 29 | required init?(coder aDecoder: NSCoder) { 30 | fatalError("init(coder:) has not been implemented") 31 | } 32 | 33 | func setupViews() { 34 | let icon = UIImageView(image: UIImage(named: "search_smalltime")) 35 | icon.x = 13.5 36 | icon.centerY = 22.5 37 | self.contentView.addSubview(icon) 38 | 39 | keyLabel = UILabel(frame: CGRectMake(34, 0, ScreenWidth - 68, 45)) 40 | keyLabel.textColor = JCColor(102, g: 102, b: 102) 41 | keyLabel.font = UIFont.systemFontOfSize(14) 42 | let gesture = UITapGestureRecognizer(target: self, action: "tapKeyLabel") 43 | keyLabel.addGestureRecognizer(gesture) 44 | keyLabel.userInteractionEnabled = true 45 | self.contentView.addSubview(keyLabel) 46 | 47 | let deleteBtn = UIButton(frame: CGRectMake(0, 0, 45, 45)) 48 | deleteBtn.center = CGPointMake(ScreenWidth - icon.centerX, 22.5) 49 | deleteBtn.setImage(UIImage(named: "search_smalldelete"), forState: UIControlState.Normal) 50 | deleteBtn.addTarget(self, action: "deleteBtnClick", forControlEvents: UIControlEvents.TouchUpInside) 51 | self.contentView.addSubview(deleteBtn) 52 | 53 | line = UIView(frame: CGRectMake(9, 44.5, ScreenWidth - 18, 0.5)) 54 | line.backgroundColor = GlobalLineColor 55 | self.contentView.addSubview(line) 56 | } 57 | 58 | func configKeyLabel(text: String) { 59 | keyLabel.text = text 60 | } 61 | 62 | func deleteBtnClick() { 63 | self.delegate.deleteHistoryKey(keyLabel.text!) 64 | } 65 | 66 | func tapKeyLabel() { 67 | self.delegate.clickHistoryKey(keyLabel.text!) 68 | } 69 | 70 | func showBottomLine(show: Bool) { 71 | line.hidden = !show 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCSearchHistoryClearCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCSearchHistoryClearCell.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/14. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol JCSearchHistoryClearCellDelegate: NSObjectProtocol { 12 | // 清空所有搜索历史 13 | func clearAllHistoryKeys() 14 | } 15 | 16 | class JCSearchHistoryClearCell: UITableViewCell { 17 | weak var delegate: JCSearchHistoryClearCellDelegate! 18 | 19 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 20 | super.init(style: style, reuseIdentifier: reuseIdentifier) 21 | 22 | setupViews() 23 | } 24 | 25 | required init?(coder aDecoder: NSCoder) { 26 | fatalError("init(coder:) has not been implemented") 27 | } 28 | 29 | func setupViews() { 30 | let btn = UIButton(frame: contentView.bounds) 31 | btn.setTitle("清空搜索历史", forState: UIControlState.Normal) 32 | btn.setTitleColor(JCColor(255, g: 60, b: 60), forState: UIControlState.Normal) 33 | btn.titleLabel?.font = UIFont.systemFontOfSize(14) 34 | btn.addTarget(self, action: "btnClick", forControlEvents: UIControlEvents.TouchUpInside) 35 | contentView.addSubview(btn) 36 | } 37 | 38 | func btnClick() { 39 | self.delegate?.clearAllHistoryKeys() 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCSearchHistoryOpenCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCSearchHistoryOpenCell.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/14. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol JCSearchHistoryOpenCellDelegate: NSObjectProtocol { 12 | // 展开搜索历史 13 | func openHistoryKeyCell() 14 | } 15 | 16 | class JCSearchHistoryOpenCell: UITableViewCell { 17 | weak var delegate: JCSearchHistoryOpenCellDelegate! 18 | 19 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 20 | super.init(style: style, reuseIdentifier: reuseIdentifier) 21 | 22 | setupViews() 23 | } 24 | 25 | required init?(coder aDecoder: NSCoder) { 26 | fatalError("init(coder:) has not been implemented") 27 | } 28 | 29 | func setupViews() { 30 | let btn = UIButton(frame: contentView.bounds) 31 | btn.setTitle("更多搜索历史", forState: UIControlState.Normal) 32 | btn.setTitleColor(JCColor(51, g: 51, b: 51), forState: UIControlState.Normal) 33 | btn.titleLabel?.font = UIFont.systemFontOfSize(14) 34 | btn.addTarget(self, action: "btnClick", forControlEvents: UIControlEvents.TouchUpInside) 35 | contentView.addSubview(btn) 36 | 37 | let icon = UIImageView(image: UIImage(named: "searchmore")) 38 | icon.x = ScreenWidth / 2 + 42 39 | icon.centerY = btn.height / 2 40 | btn.addSubview(icon) 41 | } 42 | 43 | func btnClick() { 44 | self.delegate?.openHistoryKeyCell() 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCSearchResultCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCSearchResultCell.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/15. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class JCSearchResultCell: UICollectionViewCell { 12 | var imgView: UIImageView! 13 | var nameLabel: UILabel! 14 | var nameRect: CGRect! 15 | 16 | override init(frame: CGRect) { 17 | super.init(frame: frame) 18 | 19 | let width = contentView.width 20 | imgView = UIImageView(frame: CGRectMake(0, 0, width, width * 0.56)) 21 | contentView.addSubview(imgView) 22 | 23 | nameRect = CGRectMake(6, width * 0.56, width - 12, 46) 24 | nameLabel = UILabel(frame: CGRectMake(6, width * 0.56, width - 12, 46)) 25 | nameLabel.textColor = JCColor(51, g: 51, b: 51) 26 | nameLabel.font = UIFont.systemFontOfSize(14) 27 | nameLabel.numberOfLines = 2 28 | contentView.addSubview(nameLabel) 29 | 30 | contentView.backgroundColor = UIColor.whiteColor() 31 | } 32 | 33 | required init?(coder aDecoder: NSCoder) { 34 | fatalError("init(coder:) has not been implemented") 35 | } 36 | 37 | func configCell(imgUrl: String, videoName: String) { 38 | imgView.sd_setImageWithURL(NSURL(string: imgUrl)) 39 | nameLabel.text = videoName 40 | 41 | setNeedsLayout() 42 | } 43 | 44 | override func layoutSubviews() { 45 | super.layoutSubviews() 46 | 47 | let str = NSString(string: nameLabel.text!) 48 | let size = str.sizeWithAttributes([NSFontAttributeName: nameLabel.font]) 49 | if size.width > nameRect.width { 50 | nameLabel.frame = nameRect 51 | } else { 52 | nameLabel.frame = CGRectMake(6, 0, size.width, size.height) 53 | nameLabel.centerY = contentView.width * 0.56 + 14 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCSearchResultViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCSearchResultViewController.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/15. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Alamofire 11 | 12 | protocol JCSearchResultViewControllerDelegate: NSObjectProtocol { 13 | func hideKeyboard() 14 | } 15 | 16 | private let reuseIdentifier = "JCSearchResultCell" 17 | 18 | class JCSearchResultViewController: UICollectionViewController { 19 | weak var delegate: JCSearchResultViewControllerDelegate! 20 | var data: NSMutableArray! = NSMutableArray() 21 | 22 | override func viewDidLoad() { 23 | super.viewDidLoad() 24 | 25 | // Uncomment the following line to preserve selection between presentations 26 | // self.clearsSelectionOnViewWillAppear = false 27 | 28 | // Register cell classes 29 | self.collectionView?.backgroundColor = GlobalBackgroundColor 30 | self.collectionView!.registerClass(JCSearchResultCell.self, forCellWithReuseIdentifier: reuseIdentifier) 31 | 32 | // Do any additional setup after loading the view. 33 | } 34 | 35 | override init(collectionViewLayout layout: UICollectionViewLayout) { 36 | super.init(collectionViewLayout: layout) 37 | } 38 | 39 | required init?(coder aDecoder: NSCoder) { 40 | fatalError("init(coder:) has not been implemented") 41 | } 42 | 43 | func search(keyword: String) { 44 | // 搜索视频 45 | let param = [ClientIdKey: ClientIdValue, "keyword": keyword, "count": "30"] 46 | Alamofire.request(.GET, API_SearchVideo, parameters: param).responseJSON { response in 47 | if let json = response.result.value { 48 | let dict = json as! NSDictionary 49 | if dict["error"] == nil { 50 | self.data = dict["videos"] as! NSMutableArray 51 | self.collectionView?.reloadData() 52 | } 53 | } 54 | } 55 | } 56 | 57 | // MARK: UICollectionViewDataSource 58 | 59 | override func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { 60 | // #warning Incomplete implementation, return the number of sections 61 | return 1 62 | } 63 | 64 | 65 | override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 66 | // #warning Incomplete implementation, return the number of items 67 | return self.data.count 68 | } 69 | 70 | override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { 71 | let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! JCSearchResultCell 72 | let dic = self.data[indexPath.row] as! NSDictionary 73 | cell.configCell(dic["thumbnail"] as! String, videoName: dic["title"] as! String) 74 | return cell 75 | } 76 | 77 | override func scrollViewDidScroll(scrollView: UIScrollView) { 78 | self.delegate?.hideKeyboard() 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCSubscribeViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCSubscribeViewController.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/11. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class JCSubscribeViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | // Do any additional setup after loading the view. 17 | } 18 | 19 | override func didReceiveMemoryWarning() { 20 | super.didReceiveMemoryWarning() 21 | // Dispose of any resources that can be recreated. 22 | } 23 | 24 | 25 | /* 26 | // MARK: - Navigation 27 | 28 | // In a storyboard-based application, you will often want to do a little preparation before navigation 29 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 30 | // Get the new view controller using segue.destinationViewController. 31 | // Pass the selected object to the new view controller. 32 | } 33 | */ 34 | 35 | } 36 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCTabBarController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCTabBarController.swift 3 | // JCYouku 4 | // 5 | // Created by mac on 16/1/8. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class JCTabBarController: UITabBarController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | addChildVC(JCHomeViewController(style: UITableViewStyle.Grouped), title: "首页", normalImage: "navbar_icon_home_normal", selectedImage: "navbar_icon_home_selected") 17 | addChildVC(JCChannelViewController(), title: "频道", normalImage: "navbar_icon_channel_normal", selectedImage: "navbar_icon_channel_selected") 18 | addChildVC(JCSubscribeViewController(), title: "订阅", normalImage: "navbar_icon_subscribe_normal", selectedImage: "navbar_icon_subscribe_selected") 19 | addChildVC(JCMineViewController(), title: "我的", normalImage: "navbar_icon_user_normal", selectedImage: "navbar_icon_user_selected") 20 | } 21 | 22 | func addChildVC(vc: UIViewController, title: String, normalImage: String, selectedImage: String){ 23 | let navVC = UINavigationController(rootViewController: vc) 24 | navVC.tabBarItem = UITabBarItem(title: title, image: UIImage(named: normalImage), selectedImage: UIImage(named: selectedImage)) 25 | addChildViewController(navVC) 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/JCYouku-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 桥接oc框架 2 | #import "AdView.h" 3 | #import "UIImageView+WebCache.h" -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/MKAnnotationView+WebCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // MKAnnotationView+WebCache.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 14/03/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "MapKit/MapKit.h" 10 | #import "SDWebImageManager.h" 11 | 12 | /** 13 | * Integrates SDWebImage async downloading and caching of remote images with MKAnnotationView. 14 | */ 15 | @interface MKAnnotationView (WebCache) 16 | 17 | /** 18 | * Get the current image URL. 19 | * 20 | * Note that because of the limitations of categories this property can get out of sync 21 | * if you use sd_setImage: directly. 22 | */ 23 | - (NSURL *)sd_imageURL; 24 | 25 | /** 26 | * Set the imageView `image` with an `url`. 27 | * 28 | * The download is asynchronous and cached. 29 | * 30 | * @param url The url for the image. 31 | */ 32 | - (void)sd_setImageWithURL:(NSURL *)url; 33 | 34 | /** 35 | * Set the imageView `image` with an `url` and a placeholder. 36 | * 37 | * The download is asynchronous and cached. 38 | * 39 | * @param url The url for the image. 40 | * @param placeholder The image to be set initially, until the image request finishes. 41 | * @see sd_setImageWithURL:placeholderImage:options: 42 | */ 43 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder; 44 | 45 | /** 46 | * Set the imageView `image` with an `url`, placeholder and custom options. 47 | * 48 | * The download is asynchronous and cached. 49 | * 50 | * @param url The url for the image. 51 | * @param placeholder The image to be set initially, until the image request finishes. 52 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 53 | */ 54 | 55 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options; 56 | 57 | /** 58 | * Set the imageView `image` with an `url`. 59 | * 60 | * The download is asynchronous and cached. 61 | * 62 | * @param url The url for the image. 63 | * @param completedBlock A block called when operation has been completed. This block has no return value 64 | * and takes the requested UIImage as first parameter. In case of error the image parameter 65 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 66 | * indicating if the image was retrived from the local cache or from the network. 67 | * The fourth parameter is the original image url. 68 | */ 69 | - (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; 70 | 71 | /** 72 | * Set the imageView `image` with an `url`, placeholder. 73 | * 74 | * The download is asynchronous and cached. 75 | * 76 | * @param url The url for the image. 77 | * @param placeholder The image to be set initially, until the image request finishes. 78 | * @param completedBlock A block called when operation has been completed. This block has no return value 79 | * and takes the requested UIImage as first parameter. In case of error the image parameter 80 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 81 | * indicating if the image was retrived from the local cache or from the network. 82 | * The fourth parameter is the original image url. 83 | */ 84 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock; 85 | 86 | /** 87 | * Set the imageView `image` with an `url`, placeholder and custom options. 88 | * 89 | * The download is asynchronous and cached. 90 | * 91 | * @param url The url for the image. 92 | * @param placeholder The image to be set initially, until the image request finishes. 93 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 94 | * @param completedBlock A block called when operation has been completed. This block has no return value 95 | * and takes the requested UIImage as first parameter. In case of error the image parameter 96 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 97 | * indicating if the image was retrived from the local cache or from the network. 98 | * The fourth parameter is the original image url. 99 | */ 100 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; 101 | 102 | /** 103 | * Cancel the current download 104 | */ 105 | - (void)sd_cancelCurrentImageLoad; 106 | 107 | @end 108 | 109 | 110 | @interface MKAnnotationView (WebCacheDeprecated) 111 | 112 | - (NSURL *)imageURL __deprecated_msg("Use `sd_imageURL`"); 113 | 114 | - (void)setImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:`"); 115 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:`"); 116 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:`"); 117 | 118 | - (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:completed:`"); 119 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:completed:`"); 120 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setImageWithURL:placeholderImage:options:completed:`"); 121 | 122 | - (void)cancelCurrentImageLoad __deprecated_msg("Use `sd_cancelCurrentImageLoad`"); 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/MKAnnotationView+WebCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // MKAnnotationView+WebCache.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 14/03/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "MKAnnotationView+WebCache.h" 10 | #import "objc/runtime.h" 11 | #import "UIView+WebCacheOperation.h" 12 | 13 | static char imageURLKey; 14 | 15 | @implementation MKAnnotationView (WebCache) 16 | 17 | - (NSURL *)sd_imageURL { 18 | return objc_getAssociatedObject(self, &imageURLKey); 19 | } 20 | 21 | - (void)sd_setImageWithURL:(NSURL *)url { 22 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:nil]; 23 | } 24 | 25 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { 26 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:nil]; 27 | } 28 | 29 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { 30 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:nil]; 31 | } 32 | 33 | - (void)sd_setImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { 34 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:completedBlock]; 35 | } 36 | 37 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletionBlock)completedBlock { 38 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:completedBlock]; 39 | } 40 | 41 | - (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { 42 | [self sd_cancelCurrentImageLoad]; 43 | 44 | objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 45 | self.image = placeholder; 46 | 47 | if (url) { 48 | __weak __typeof(self)wself = self; 49 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 50 | if (!wself) return; 51 | dispatch_main_sync_safe(^{ 52 | __strong MKAnnotationView *sself = wself; 53 | if (!sself) return; 54 | if (image) { 55 | sself.image = image; 56 | } 57 | if (completedBlock && finished) { 58 | completedBlock(image, error, cacheType, url); 59 | } 60 | }); 61 | }]; 62 | [self sd_setImageLoadOperation:operation forKey:@"MKAnnotationViewImage"]; 63 | } else { 64 | dispatch_main_async_safe(^{ 65 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 66 | if (completedBlock) { 67 | completedBlock(nil, error, SDImageCacheTypeNone, url); 68 | } 69 | }); 70 | } 71 | } 72 | 73 | - (void)sd_cancelCurrentImageLoad { 74 | [self sd_cancelImageLoadOperationWithKey:@"MKAnnotationViewImage"]; 75 | } 76 | 77 | @end 78 | 79 | 80 | @implementation MKAnnotationView (WebCacheDeprecated) 81 | 82 | - (NSURL *)imageURL { 83 | return [self sd_imageURL]; 84 | } 85 | 86 | - (void)setImageWithURL:(NSURL *)url { 87 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:nil]; 88 | } 89 | 90 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder { 91 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:nil]; 92 | } 93 | 94 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options { 95 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:nil]; 96 | } 97 | 98 | - (void)setImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { 99 | [self sd_setImageWithURL:url placeholderImage:nil options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 100 | if (completedBlock) { 101 | completedBlock(image, error, cacheType); 102 | } 103 | }]; 104 | } 105 | 106 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock { 107 | [self sd_setImageWithURL:url placeholderImage:placeholder options:0 completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 108 | if (completedBlock) { 109 | completedBlock(image, error, cacheType); 110 | } 111 | }]; 112 | } 113 | 114 | - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { 115 | [self sd_setImageWithURL:url placeholderImage:placeholder options:options completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 116 | if (completedBlock) { 117 | completedBlock(image, error, cacheType); 118 | } 119 | }]; 120 | } 121 | 122 | - (void)cancelCurrentImageLoad { 123 | [self sd_cancelCurrentImageLoad]; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @interface NSData (ImageContentType) 9 | 10 | /** 11 | * Compute the content type for an image data 12 | * 13 | * @param data the input data 14 | * 15 | * @return the content type as string (i.e. image/jpeg, image/gif) 16 | */ 17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data; 18 | 19 | @end 20 | 21 | 22 | @interface NSData (ImageContentTypeDeprecated) 23 | 24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import "NSData+ImageContentType.h" 7 | 8 | 9 | @implementation NSData (ImageContentType) 10 | 11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data { 12 | uint8_t c; 13 | [data getBytes:&c length:1]; 14 | switch (c) { 15 | case 0xFF: 16 | return @"image/jpeg"; 17 | case 0x89: 18 | return @"image/png"; 19 | case 0x47: 20 | return @"image/gif"; 21 | case 0x49: 22 | case 0x4D: 23 | return @"image/tiff"; 24 | case 0x52: 25 | // R as RIFF for WEBP 26 | if ([data length] < 12) { 27 | return nil; 28 | } 29 | 30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 32 | return @"image/webp"; 33 | } 34 | 35 | return nil; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | 42 | 43 | @implementation NSData (ImageContentTypeDeprecated) 44 | 45 | + (NSString *)contentTypeForImageData:(NSData *)data { 46 | return [self sd_contentTypeForImageData:data]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 17 | #error SDWebImage doesn't support Deployement Target version < 5.0 18 | #endif 19 | 20 | #if !TARGET_OS_IPHONE 21 | #import 22 | #ifndef UIImage 23 | #define UIImage NSImage 24 | #endif 25 | #ifndef UIImageView 26 | #define UIImageView NSImageView 27 | #endif 28 | #else 29 | 30 | #import 31 | 32 | #endif 33 | 34 | #ifndef NS_ENUM 35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 36 | #endif 37 | 38 | #ifndef NS_OPTIONS 39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 40 | #endif 41 | 42 | #if OS_OBJECT_USE_OBJC 43 | #undef SDDispatchQueueRelease 44 | #undef SDDispatchQueueSetterSementics 45 | #define SDDispatchQueueRelease(q) 46 | #define SDDispatchQueueSetterSementics strong 47 | #else 48 | #undef SDDispatchQueueRelease 49 | #undef SDDispatchQueueSetterSementics 50 | #define SDDispatchQueueRelease(q) (dispatch_release(q)) 51 | #define SDDispatchQueueSetterSementics assign 52 | #endif 53 | 54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 55 | 56 | typedef void(^SDWebImageNoParamsBlock)(); 57 | 58 | extern NSString *const SDWebImageErrorDomain; 59 | 60 | #define dispatch_main_sync_safe(block)\ 61 | if ([NSThread isMainThread]) {\ 62 | block();\ 63 | } else {\ 64 | dispatch_sync(dispatch_get_main_queue(), block);\ 65 | } 66 | 67 | #define dispatch_main_async_safe(block)\ 68 | if ([NSThread isMainThread]) {\ 69 | block();\ 70 | } else {\ 71 | dispatch_async(dispatch_get_main_queue(), block);\ 72 | } 73 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | // 2 | // SDWebImageCompat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 11/12/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { 16 | if (!image) { 17 | return nil; 18 | } 19 | 20 | if ([image.images count] > 0) { 21 | NSMutableArray *scaledImages = [NSMutableArray array]; 22 | 23 | for (UIImage *tempImage in image.images) { 24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 25 | } 26 | 27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 28 | } 29 | else { 30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 31 | CGFloat scale = 1.0; 32 | if (key.length >= 8) { 33 | // Search @2x. or @3x. at the end of the string, before a 3 to 4 extension length (only if key len is 8 or more @2x./@3x. + 4 len ext) 34 | NSRange range = [key rangeOfString:@"@2x." options:0 range:NSMakeRange(key.length - 8, 5)]; 35 | if (range.location != NSNotFound) { 36 | scale = 2.0; 37 | } 38 | 39 | range = [key rangeOfString:@"@3x." options:0 range:NSMakeRange(key.length - 8, 5)]; 40 | if (range.location != NSNotFound) { 41 | scale = 3.0; 42 | } 43 | } 44 | 45 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 46 | image = scaledImage; 47 | } 48 | return image; 49 | } 50 | } 51 | 52 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 53 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import 12 | #import "SDWebImageCompat.h" 13 | 14 | @interface UIImage (ForceDecode) 15 | 16 | + (UIImage *)decodedImageWithImage:(UIImage *)image; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/SDWebImageDecoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import "SDWebImageDecoder.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 16 | if (image.images) { 17 | // Do not decode animated images 18 | return image; 19 | } 20 | 21 | CGImageRef imageRef = image.CGImage; 22 | CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); 23 | CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize}; 24 | 25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 26 | CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); 27 | 28 | int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask); 29 | BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone || 30 | infoMask == kCGImageAlphaNoneSkipFirst || 31 | infoMask == kCGImageAlphaNoneSkipLast); 32 | 33 | // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB. 34 | // https://developer.apple.com/library/mac/#qa/qa1037/_index.html 35 | if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) { 36 | // Unset the old alpha info. 37 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 38 | 39 | // Set noneSkipFirst. 40 | bitmapInfo |= kCGImageAlphaNoneSkipFirst; 41 | } 42 | // Some PNGs tell us they have alpha but only 3 components. Odd. 43 | else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) { 44 | // Unset the old alpha info. 45 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 46 | bitmapInfo |= kCGImageAlphaPremultipliedFirst; 47 | } 48 | 49 | // It calculates the bytes-per-row based on the bitsPerComponent and width arguments. 50 | CGContextRef context = CGBitmapContextCreate(NULL, 51 | imageSize.width, 52 | imageSize.height, 53 | CGImageGetBitsPerComponent(imageRef), 54 | 0, 55 | colorSpace, 56 | bitmapInfo); 57 | CGColorSpaceRelease(colorSpace); 58 | 59 | // If failed, return undecompressed image 60 | if (!context) return image; 61 | 62 | CGContextDrawImage(context, imageRect, imageRef); 63 | CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context); 64 | 65 | CGContextRelease(context); 66 | 67 | UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation]; 68 | CGImageRelease(decompressedImageRef); 69 | return decompressedImage; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) { 14 | SDWebImageDownloaderLowPriority = 1 << 0, 15 | SDWebImageDownloaderProgressiveDownload = 1 << 1, 16 | 17 | /** 18 | * By default, request prevent the of NSURLCache. With this flag, NSURLCache 19 | * is used with default policies. 20 | */ 21 | SDWebImageDownloaderUseNSURLCache = 1 << 2, 22 | 23 | /** 24 | * Call completion block with nil image/imageData if the image was read from NSURLCache 25 | * (to be combined with `SDWebImageDownloaderUseNSURLCache`). 26 | */ 27 | 28 | SDWebImageDownloaderIgnoreCachedResponse = 1 << 3, 29 | /** 30 | * In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for 31 | * extra time in background to let the request finish. If the background task expires the operation will be cancelled. 32 | */ 33 | 34 | SDWebImageDownloaderContinueInBackground = 1 << 4, 35 | 36 | /** 37 | * Handles cookies stored in NSHTTPCookieStore by setting 38 | * NSMutableURLRequest.HTTPShouldHandleCookies = YES; 39 | */ 40 | SDWebImageDownloaderHandleCookies = 1 << 5, 41 | 42 | /** 43 | * Enable to allow untrusted SSL ceriticates. 44 | * Useful for testing purposes. Use with caution in production. 45 | */ 46 | SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6, 47 | 48 | /** 49 | * Put the image in the high priority queue. 50 | */ 51 | SDWebImageDownloaderHighPriority = 1 << 7, 52 | }; 53 | 54 | typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) { 55 | /** 56 | * Default value. All download operations will execute in queue style (first-in-first-out). 57 | */ 58 | SDWebImageDownloaderFIFOExecutionOrder, 59 | 60 | /** 61 | * All download operations will execute in stack style (last-in-first-out). 62 | */ 63 | SDWebImageDownloaderLIFOExecutionOrder 64 | }; 65 | 66 | extern NSString *const SDWebImageDownloadStartNotification; 67 | extern NSString *const SDWebImageDownloadStopNotification; 68 | 69 | typedef void(^SDWebImageDownloaderProgressBlock)(NSInteger receivedSize, NSInteger expectedSize); 70 | 71 | typedef void(^SDWebImageDownloaderCompletedBlock)(UIImage *image, NSData *data, NSError *error, BOOL finished); 72 | 73 | typedef NSDictionary *(^SDWebImageDownloaderHeadersFilterBlock)(NSURL *url, NSDictionary *headers); 74 | 75 | /** 76 | * Asynchronous downloader dedicated and optimized for image loading. 77 | */ 78 | @interface SDWebImageDownloader : NSObject 79 | 80 | /** 81 | * Decompressing images that are downloaded and cached can improve peformance but can consume lot of memory. 82 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 83 | */ 84 | @property (assign, nonatomic) BOOL shouldDecompressImages; 85 | 86 | @property (assign, nonatomic) NSInteger maxConcurrentDownloads; 87 | 88 | /** 89 | * Shows the current amount of downloads that still need to be downloaded 90 | */ 91 | @property (readonly, nonatomic) NSUInteger currentDownloadCount; 92 | 93 | 94 | /** 95 | * The timeout value (in seconds) for the download operation. Default: 15.0. 96 | */ 97 | @property (assign, nonatomic) NSTimeInterval downloadTimeout; 98 | 99 | 100 | /** 101 | * Changes download operations execution order. Default value is `SDWebImageDownloaderFIFOExecutionOrder`. 102 | */ 103 | @property (assign, nonatomic) SDWebImageDownloaderExecutionOrder executionOrder; 104 | 105 | /** 106 | * Singleton method, returns the shared instance 107 | * 108 | * @return global shared instance of downloader class 109 | */ 110 | + (SDWebImageDownloader *)sharedDownloader; 111 | 112 | /** 113 | * Set username 114 | */ 115 | @property (strong, nonatomic) NSString *username; 116 | 117 | /** 118 | * Set password 119 | */ 120 | @property (strong, nonatomic) NSString *password; 121 | 122 | /** 123 | * Set filter to pick headers for downloading image HTTP request. 124 | * 125 | * This block will be invoked for each downloading image request, returned 126 | * NSDictionary will be used as headers in corresponding HTTP request. 127 | */ 128 | @property (nonatomic, copy) SDWebImageDownloaderHeadersFilterBlock headersFilter; 129 | 130 | /** 131 | * Set a value for a HTTP header to be appended to each download HTTP request. 132 | * 133 | * @param value The value for the header field. Use `nil` value to remove the header. 134 | * @param field The name of the header field to set. 135 | */ 136 | - (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field; 137 | 138 | /** 139 | * Returns the value of the specified HTTP header field. 140 | * 141 | * @return The value associated with the header field field, or `nil` if there is no corresponding header field. 142 | */ 143 | - (NSString *)valueForHTTPHeaderField:(NSString *)field; 144 | 145 | /** 146 | * Sets a subclass of `SDWebImageDownloaderOperation` as the default 147 | * `NSOperation` to be used each time SDWebImage constructs a request 148 | * operation to download an image. 149 | * 150 | * @param operationClass The subclass of `SDWebImageDownloaderOperation` to set 151 | * as default. Passing `nil` will revert to `SDWebImageDownloaderOperation`. 152 | */ 153 | - (void)setOperationClass:(Class)operationClass; 154 | 155 | /** 156 | * Creates a SDWebImageDownloader async downloader instance with a given URL 157 | * 158 | * The delegate will be informed when the image is finish downloaded or an error has happen. 159 | * 160 | * @see SDWebImageDownloaderDelegate 161 | * 162 | * @param url The URL to the image to download 163 | * @param options The options to be used for this download 164 | * @param progressBlock A block called repeatedly while the image is downloading 165 | * @param completedBlock A block called once the download is completed. 166 | * If the download succeeded, the image parameter is set, in case of error, 167 | * error parameter is set with the error. The last parameter is always YES 168 | * if SDWebImageDownloaderProgressiveDownload isn't use. With the 169 | * SDWebImageDownloaderProgressiveDownload option, this block is called 170 | * repeatedly with the partial image object and the finished argument set to NO 171 | * before to be called a last time with the full image and finished argument 172 | * set to YES. In case of error, the finished argument is always YES. 173 | * 174 | * @return A cancellable SDWebImageOperation 175 | */ 176 | - (id )downloadImageWithURL:(NSURL *)url 177 | options:(SDWebImageDownloaderOptions)options 178 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 179 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock; 180 | 181 | /** 182 | * Sets the download queue suspension state 183 | */ 184 | - (void)setSuspended:(BOOL)suspended; 185 | 186 | @end 187 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | extern NSString *const SDWebImageDownloadStartNotification; 14 | extern NSString *const SDWebImageDownloadReceiveResponseNotification; 15 | extern NSString *const SDWebImageDownloadStopNotification; 16 | extern NSString *const SDWebImageDownloadFinishNotification; 17 | 18 | @interface SDWebImageDownloaderOperation : NSOperation 19 | 20 | /** 21 | * The request used by the operation's connection. 22 | */ 23 | @property (strong, nonatomic, readonly) NSURLRequest *request; 24 | 25 | 26 | @property (assign, nonatomic) BOOL shouldDecompressImages; 27 | 28 | /** 29 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. 30 | * 31 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. 32 | */ 33 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage; 34 | 35 | /** 36 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 37 | * 38 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 39 | */ 40 | @property (nonatomic, strong) NSURLCredential *credential; 41 | 42 | /** 43 | * The SDWebImageDownloaderOptions for the receiver. 44 | */ 45 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 46 | 47 | /** 48 | * The expected size of data. 49 | */ 50 | @property (assign, nonatomic) NSInteger expectedSize; 51 | 52 | /** 53 | * The response returned by the operation's connection. 54 | */ 55 | @property (strong, nonatomic) NSURLResponse *response; 56 | 57 | /** 58 | * Initializes a `SDWebImageDownloaderOperation` object 59 | * 60 | * @see SDWebImageDownloaderOperation 61 | * 62 | * @param request the URL request 63 | * @param options downloader options 64 | * @param progressBlock the block executed when a new chunk of data arrives. 65 | * @note the progress block is executed on a background queue 66 | * @param completedBlock the block executed when the download is done. 67 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 68 | * @param cancelBlock the block executed if the download (operation) is cancelled 69 | * 70 | * @return the initialized instance 71 | */ 72 | - (id)initWithRequest:(NSURLRequest *)request 73 | options:(SDWebImageDownloaderOptions)options 74 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 75 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock 76 | cancelled:(SDWebImageNoParamsBlock)cancelBlock; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher; 72 | 73 | /** 74 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 75 | * currently one image is downloaded at a time, 76 | * and skips images for failed downloads and proceed to the next image in the list 77 | * 78 | * @param urls list of URLs to prefetch 79 | */ 80 | - (void)prefetchURLs:(NSArray *)urls; 81 | 82 | /** 83 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 84 | * currently one image is downloaded at a time, 85 | * and skips images for failed downloads and proceed to the next image in the list 86 | * 87 | * @param urls list of URLs to prefetch 88 | * @param progressBlock block to be called when progress updates; 89 | * first parameter is the number of completed (successful or not) requests, 90 | * second parameter is the total number of images originally requested to be prefetched 91 | * @param completionBlock block to be called when prefetching is completed 92 | * first param is the number of completed (successful or not) requests, 93 | * second parameter is the number of skipped requests 94 | */ 95 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; 96 | 97 | /** 98 | * Remove and cancel queued list 99 | */ 100 | - (void)cancelPrefetching; 101 | 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/SDWebImagePrefetcher.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImagePrefetcher.h" 10 | 11 | #if (!defined(DEBUG) && !defined (SD_VERBOSE)) || defined(SD_LOG_NONE) 12 | #define NSLog(...) 13 | #endif 14 | 15 | @interface SDWebImagePrefetcher () 16 | 17 | @property (strong, nonatomic) SDWebImageManager *manager; 18 | @property (strong, nonatomic) NSArray *prefetchURLs; 19 | @property (assign, nonatomic) NSUInteger requestedCount; 20 | @property (assign, nonatomic) NSUInteger skippedCount; 21 | @property (assign, nonatomic) NSUInteger finishedCount; 22 | @property (assign, nonatomic) NSTimeInterval startedTime; 23 | @property (copy, nonatomic) SDWebImagePrefetcherCompletionBlock completionBlock; 24 | @property (copy, nonatomic) SDWebImagePrefetcherProgressBlock progressBlock; 25 | 26 | @end 27 | 28 | @implementation SDWebImagePrefetcher 29 | 30 | + (SDWebImagePrefetcher *)sharedImagePrefetcher { 31 | static dispatch_once_t once; 32 | static id instance; 33 | dispatch_once(&once, ^{ 34 | instance = [self new]; 35 | }); 36 | return instance; 37 | } 38 | 39 | - (id)init { 40 | if ((self = [super init])) { 41 | _manager = [SDWebImageManager new]; 42 | _options = SDWebImageLowPriority; 43 | _prefetcherQueue = dispatch_get_main_queue(); 44 | self.maxConcurrentDownloads = 3; 45 | } 46 | return self; 47 | } 48 | 49 | - (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads { 50 | self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads; 51 | } 52 | 53 | - (NSUInteger)maxConcurrentDownloads { 54 | return self.manager.imageDownloader.maxConcurrentDownloads; 55 | } 56 | 57 | - (void)startPrefetchingAtIndex:(NSUInteger)index { 58 | if (index >= self.prefetchURLs.count) return; 59 | self.requestedCount++; 60 | [self.manager downloadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 61 | if (!finished) return; 62 | self.finishedCount++; 63 | 64 | if (image) { 65 | if (self.progressBlock) { 66 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]); 67 | } 68 | NSLog(@"Prefetched %@ out of %@", @(self.finishedCount), @(self.prefetchURLs.count)); 69 | } 70 | else { 71 | if (self.progressBlock) { 72 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]); 73 | } 74 | NSLog(@"Prefetched %@ out of %@ (Failed)", @(self.finishedCount), @(self.prefetchURLs.count)); 75 | 76 | // Add last failed 77 | self.skippedCount++; 78 | } 79 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) { 80 | [self.delegate imagePrefetcher:self 81 | didPrefetchURL:self.prefetchURLs[index] 82 | finishedCount:self.finishedCount 83 | totalCount:self.prefetchURLs.count 84 | ]; 85 | } 86 | if (self.prefetchURLs.count > self.requestedCount) { 87 | dispatch_async(self.prefetcherQueue, ^{ 88 | [self startPrefetchingAtIndex:self.requestedCount]; 89 | }); 90 | } 91 | else if (self.finishedCount == self.requestedCount) { 92 | [self reportStatus]; 93 | if (self.completionBlock) { 94 | self.completionBlock(self.finishedCount, self.skippedCount); 95 | self.completionBlock = nil; 96 | } 97 | self.progressBlock = nil; 98 | } 99 | }]; 100 | } 101 | 102 | - (void)reportStatus { 103 | NSUInteger total = [self.prefetchURLs count]; 104 | NSLog(@"Finished prefetching (%@ successful, %@ skipped, timeElasped %.2f)", @(total - self.skippedCount), @(self.skippedCount), CFAbsoluteTimeGetCurrent() - self.startedTime); 105 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) { 106 | [self.delegate imagePrefetcher:self 107 | didFinishWithTotalCount:(total - self.skippedCount) 108 | skippedCount:self.skippedCount 109 | ]; 110 | } 111 | } 112 | 113 | - (void)prefetchURLs:(NSArray *)urls { 114 | [self prefetchURLs:urls progress:nil completed:nil]; 115 | } 116 | 117 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock { 118 | [self cancelPrefetching]; // Prevent duplicate prefetch request 119 | self.startedTime = CFAbsoluteTimeGetCurrent(); 120 | self.prefetchURLs = urls; 121 | self.completionBlock = completionBlock; 122 | self.progressBlock = progressBlock; 123 | 124 | if(urls.count == 0){ 125 | if(completionBlock){ 126 | completionBlock(0,0); 127 | } 128 | }else{ 129 | // Starts prefetching from the very first image on the list with the max allowed concurrency 130 | NSUInteger listCount = self.prefetchURLs.count; 131 | for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) { 132 | [self startPrefetchingAtIndex:i]; 133 | } 134 | } 135 | } 136 | 137 | - (void)cancelPrefetching { 138 | self.prefetchURLs = nil; 139 | self.skippedCount = 0; 140 | self.requestedCount = 0; 141 | self.finishedCount = 0; 142 | [self.manager cancelAll]; 143 | } 144 | 145 | @end 146 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.h 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (GIF) 12 | 13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name; 14 | 15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 16 | 17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.m 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "UIImage+GIF.h" 10 | #import 11 | 12 | @implementation UIImage (GIF) 13 | 14 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 15 | if (!data) { 16 | return nil; 17 | } 18 | 19 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); 20 | 21 | size_t count = CGImageSourceGetCount(source); 22 | 23 | UIImage *animatedImage; 24 | 25 | if (count <= 1) { 26 | animatedImage = [[UIImage alloc] initWithData:data]; 27 | } 28 | else { 29 | NSMutableArray *images = [NSMutableArray array]; 30 | 31 | NSTimeInterval duration = 0.0f; 32 | 33 | for (size_t i = 0; i < count; i++) { 34 | CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL); 35 | 36 | duration += [self sd_frameDurationAtIndex:i source:source]; 37 | 38 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]]; 39 | 40 | CGImageRelease(image); 41 | } 42 | 43 | if (!duration) { 44 | duration = (1.0f / 10.0f) * count; 45 | } 46 | 47 | animatedImage = [UIImage animatedImageWithImages:images duration:duration]; 48 | } 49 | 50 | CFRelease(source); 51 | 52 | return animatedImage; 53 | } 54 | 55 | + (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source { 56 | float frameDuration = 0.1f; 57 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil); 58 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties; 59 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary]; 60 | 61 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime]; 62 | if (delayTimeUnclampedProp) { 63 | frameDuration = [delayTimeUnclampedProp floatValue]; 64 | } 65 | else { 66 | 67 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime]; 68 | if (delayTimeProp) { 69 | frameDuration = [delayTimeProp floatValue]; 70 | } 71 | } 72 | 73 | // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. 74 | // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify 75 | // a duration of <= 10 ms. See and 76 | // for more information. 77 | 78 | if (frameDuration < 0.011f) { 79 | frameDuration = 0.100f; 80 | } 81 | 82 | CFRelease(cfFrameProperties); 83 | return frameDuration; 84 | } 85 | 86 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name { 87 | CGFloat scale = [UIScreen mainScreen].scale; 88 | 89 | if (scale > 1.0f) { 90 | NSString *retinaPath = [[NSBundle mainBundle] pathForResource:[name stringByAppendingString:@"@2x"] ofType:@"gif"]; 91 | 92 | NSData *data = [NSData dataWithContentsOfFile:retinaPath]; 93 | 94 | if (data) { 95 | return [UIImage sd_animatedGIFWithData:data]; 96 | } 97 | 98 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; 99 | 100 | data = [NSData dataWithContentsOfFile:path]; 101 | 102 | if (data) { 103 | return [UIImage sd_animatedGIFWithData:data]; 104 | } 105 | 106 | return [UIImage imageNamed:name]; 107 | } 108 | else { 109 | NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"gif"]; 110 | 111 | NSData *data = [NSData dataWithContentsOfFile:path]; 112 | 113 | if (data) { 114 | return [UIImage sd_animatedGIFWithData:data]; 115 | } 116 | 117 | return [UIImage imageNamed:name]; 118 | } 119 | } 120 | 121 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size { 122 | if (CGSizeEqualToSize(self.size, size) || CGSizeEqualToSize(size, CGSizeZero)) { 123 | return self; 124 | } 125 | 126 | CGSize scaledSize = size; 127 | CGPoint thumbnailPoint = CGPointZero; 128 | 129 | CGFloat widthFactor = size.width / self.size.width; 130 | CGFloat heightFactor = size.height / self.size.height; 131 | CGFloat scaleFactor = (widthFactor > heightFactor) ? widthFactor : heightFactor; 132 | scaledSize.width = self.size.width * scaleFactor; 133 | scaledSize.height = self.size.height * scaleFactor; 134 | 135 | if (widthFactor > heightFactor) { 136 | thumbnailPoint.y = (size.height - scaledSize.height) * 0.5; 137 | } 138 | else if (widthFactor < heightFactor) { 139 | thumbnailPoint.x = (size.width - scaledSize.width) * 0.5; 140 | } 141 | 142 | NSMutableArray *scaledImages = [NSMutableArray array]; 143 | 144 | UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); 145 | 146 | for (UIImage *image in self.images) { 147 | [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)]; 148 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 149 | 150 | [scaledImages addObject:newImage]; 151 | } 152 | 153 | UIGraphicsEndImageContext(); 154 | 155 | return [UIImage animatedImageWithImages:scaledImages duration:self.duration]; 156 | } 157 | 158 | @end 159 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MultiFormat) 12 | 13 | + (UIImage *)sd_imageWithData:(NSData *)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "UIImage+GIF.h" 11 | #import "NSData+ImageContentType.h" 12 | #import 13 | 14 | #ifdef SD_WEBP 15 | #import "UIImage+WebP.h" 16 | #endif 17 | 18 | @implementation UIImage (MultiFormat) 19 | 20 | + (UIImage *)sd_imageWithData:(NSData *)data { 21 | UIImage *image; 22 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; 23 | if ([imageContentType isEqualToString:@"image/gif"]) { 24 | image = [UIImage sd_animatedGIFWithData:data]; 25 | } 26 | #ifdef SD_WEBP 27 | else if ([imageContentType isEqualToString:@"image/webp"]) 28 | { 29 | image = [UIImage sd_imageWithWebPData:data]; 30 | } 31 | #endif 32 | else { 33 | image = [[UIImage alloc] initWithData:data]; 34 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; 35 | if (orientation != UIImageOrientationUp) { 36 | image = [UIImage imageWithCGImage:image.CGImage 37 | scale:image.scale 38 | orientation:orientation]; 39 | } 40 | } 41 | 42 | 43 | return image; 44 | } 45 | 46 | 47 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { 48 | UIImageOrientation result = UIImageOrientationUp; 49 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); 50 | if (imageSource) { 51 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); 52 | if (properties) { 53 | CFTypeRef val; 54 | int exifOrientation; 55 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); 56 | if (val) { 57 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); 58 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; 59 | } // else - if it's not set it remains at up 60 | CFRelease((CFTypeRef) properties); 61 | } else { 62 | //NSLog(@"NO PROPERTIES, FAIL"); 63 | } 64 | CFRelease(imageSource); 65 | } 66 | return result; 67 | } 68 | 69 | #pragma mark EXIF orientation tag converter 70 | // Convert an EXIF image orientation to an iOS one. 71 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html 72 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { 73 | UIImageOrientation orientation = UIImageOrientationUp; 74 | switch (exifOrientation) { 75 | case 1: 76 | orientation = UIImageOrientationUp; 77 | break; 78 | 79 | case 3: 80 | orientation = UIImageOrientationDown; 81 | break; 82 | 83 | case 8: 84 | orientation = UIImageOrientationLeft; 85 | break; 86 | 87 | case 6: 88 | orientation = UIImageOrientationRight; 89 | break; 90 | 91 | case 2: 92 | orientation = UIImageOrientationUpMirrored; 93 | break; 94 | 95 | case 4: 96 | orientation = UIImageOrientationDownMirrored; 97 | break; 98 | 99 | case 5: 100 | orientation = UIImageOrientationLeftMirrored; 101 | break; 102 | 103 | case 7: 104 | orientation = UIImageOrientationRightMirrored; 105 | break; 106 | default: 107 | break; 108 | } 109 | return orientation; 110 | } 111 | 112 | 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIImage+WebP.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+WebP.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #ifdef SD_WEBP 10 | 11 | #import 12 | 13 | // Fix for issue #416 Undefined symbols for architecture armv7 since WebP introduction when deploying to device 14 | void WebPInitPremultiplyNEON(void); 15 | 16 | void WebPInitUpsamplersNEON(void); 17 | 18 | void VP8DspInitNEON(void); 19 | 20 | @interface UIImage (WebP) 21 | 22 | + (UIImage *)sd_imageWithWebPData:(NSData *)data; 23 | 24 | @end 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIImage+WebP.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+WebP.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #ifdef SD_WEBP 10 | #import "UIImage+WebP.h" 11 | #import "webp/decode.h" 12 | 13 | // Callback for CGDataProviderRelease 14 | static void FreeImageData(void *info, const void *data, size_t size) 15 | { 16 | free((void *)data); 17 | } 18 | 19 | @implementation UIImage (WebP) 20 | 21 | + (UIImage *)sd_imageWithWebPData:(NSData *)data { 22 | WebPDecoderConfig config; 23 | if (!WebPInitDecoderConfig(&config)) { 24 | return nil; 25 | } 26 | 27 | if (WebPGetFeatures(data.bytes, data.length, &config.input) != VP8_STATUS_OK) { 28 | return nil; 29 | } 30 | 31 | config.output.colorspace = config.input.has_alpha ? MODE_rgbA : MODE_RGB; 32 | config.options.use_threads = 1; 33 | 34 | // Decode the WebP image data into a RGBA value array. 35 | if (WebPDecode(data.bytes, data.length, &config) != VP8_STATUS_OK) { 36 | return nil; 37 | } 38 | 39 | int width = config.input.width; 40 | int height = config.input.height; 41 | if (config.options.use_scaling) { 42 | width = config.options.scaled_width; 43 | height = config.options.scaled_height; 44 | } 45 | 46 | // Construct a UIImage from the decoded RGBA value array. 47 | CGDataProviderRef provider = 48 | CGDataProviderCreateWithData(NULL, config.output.u.RGBA.rgba, config.output.u.RGBA.size, FreeImageData); 49 | CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); 50 | CGBitmapInfo bitmapInfo = config.input.has_alpha ? kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast : 0; 51 | size_t components = config.input.has_alpha ? 4 : 3; 52 | CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault; 53 | CGImageRef imageRef = CGImageCreate(width, height, 8, components * 8, components * width, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent); 54 | 55 | CGColorSpaceRelease(colorSpaceRef); 56 | CGDataProviderRelease(provider); 57 | 58 | UIImage *image = [[UIImage alloc] initWithCGImage:imageRef]; 59 | CGImageRelease(imageRef); 60 | 61 | return image; 62 | } 63 | 64 | @end 65 | 66 | #if !COCOAPODS 67 | // Functions to resolve some undefined symbols when using WebP and force_load flag 68 | void WebPInitPremultiplyNEON(void) {} 69 | void WebPInitUpsamplersNEON(void) {} 70 | void VP8DspInitNEON(void) {} 71 | #endif 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageManager.h" 12 | 13 | /** 14 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 15 | */ 16 | @interface UIImageView (HighlightedWebCache) 17 | 18 | /** 19 | * Set the imageView `highlightedImage` with an `url`. 20 | * 21 | * The download is asynchronous and cached. 22 | * 23 | * @param url The url for the image. 24 | */ 25 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url; 26 | 27 | /** 28 | * Set the imageView `highlightedImage` with an `url` and custom options. 29 | * 30 | * The download is asynchronous and cached. 31 | * 32 | * @param url The url for the image. 33 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 34 | */ 35 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options; 36 | 37 | /** 38 | * Set the imageView `highlightedImage` with an `url`. 39 | * 40 | * The download is asynchronous and cached. 41 | * 42 | * @param url The url for the image. 43 | * @param completedBlock A block called when operation has been completed. This block has no return value 44 | * and takes the requested UIImage as first parameter. In case of error the image parameter 45 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 46 | * indicating if the image was retrived from the local cache or from the network. 47 | * The fourth parameter is the original image url. 48 | */ 49 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; 50 | 51 | /** 52 | * Set the imageView `highlightedImage` with an `url` and custom options. 53 | * 54 | * The download is asynchronous and cached. 55 | * 56 | * @param url The url for the image. 57 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 58 | * @param completedBlock A block called when operation has been completed. This block has no return value 59 | * and takes the requested UIImage as first parameter. In case of error the image parameter 60 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 61 | * indicating if the image was retrived from the local cache or from the network. 62 | * The fourth parameter is the original image url. 63 | */ 64 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; 65 | 66 | /** 67 | * Set the imageView `highlightedImage` with an `url` and custom options. 68 | * 69 | * The download is asynchronous and cached. 70 | * 71 | * @param url The url for the image. 72 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 73 | * @param progressBlock A block called while image is downloading 74 | * @param completedBlock A block called when operation has been completed. This block has no return value 75 | * and takes the requested UIImage as first parameter. In case of error the image parameter 76 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 77 | * indicating if the image was retrived from the local cache or from the network. 78 | * The fourth parameter is the original image url. 79 | */ 80 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; 81 | 82 | /** 83 | * Cancel the current download 84 | */ 85 | - (void)sd_cancelCurrentHighlightedImageLoad; 86 | 87 | @end 88 | 89 | 90 | @interface UIImageView (HighlightedWebCacheDeprecated) 91 | 92 | - (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`"); 93 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`"); 94 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`"); 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`"); 96 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`"); 97 | 98 | - (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`"); 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIImageView+HighlightedWebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | #import "UIView+WebCacheOperation.h" 11 | 12 | #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage" 13 | 14 | @implementation UIImageView (HighlightedWebCache) 15 | 16 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url { 17 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 18 | } 19 | 20 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 21 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 22 | } 23 | 24 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { 25 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 26 | } 27 | 28 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { 29 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 30 | } 31 | 32 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { 33 | [self sd_cancelCurrentHighlightedImageLoad]; 34 | 35 | if (url) { 36 | __weak __typeof(self)wself = self; 37 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 38 | if (!wself) return; 39 | dispatch_main_sync_safe (^ 40 | { 41 | if (!wself) return; 42 | if (image) { 43 | wself.highlightedImage = image; 44 | [wself setNeedsLayout]; 45 | } 46 | if (completedBlock && finished) { 47 | completedBlock(image, error, cacheType, url); 48 | } 49 | }); 50 | }]; 51 | [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey]; 52 | } else { 53 | dispatch_main_async_safe(^{ 54 | NSError *error = [NSError errorWithDomain:SDWebImageErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 55 | if (completedBlock) { 56 | completedBlock(nil, error, SDImageCacheTypeNone, url); 57 | } 58 | }); 59 | } 60 | } 61 | 62 | - (void)sd_cancelCurrentHighlightedImageLoad { 63 | [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey]; 64 | } 65 | 66 | @end 67 | 68 | 69 | @implementation UIImageView (HighlightedWebCacheDeprecated) 70 | 71 | - (void)setHighlightedImageWithURL:(NSURL *)url { 72 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 73 | } 74 | 75 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 76 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 77 | } 78 | 79 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { 80 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 81 | if (completedBlock) { 82 | completedBlock(image, error, cacheType); 83 | } 84 | }]; 85 | } 86 | 87 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { 88 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 89 | if (completedBlock) { 90 | completedBlock(image, error, cacheType); 91 | } 92 | }]; 93 | } 94 | 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { 96 | [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 97 | if (completedBlock) { 98 | completedBlock(image, error, cacheType); 99 | } 100 | }]; 101 | } 102 | 103 | - (void)cancelCurrentHighlightedImageLoad { 104 | [self sd_cancelCurrentHighlightedImageLoad]; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @interface UIView (WebCacheOperation) 13 | 14 | /** 15 | * Set the image load operation (storage in a UIView based dictionary) 16 | * 17 | * @param operation the operation 18 | * @param key key for storing the operation 19 | */ 20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; 21 | 22 | /** 23 | * Cancel all operations for the current UIView and key 24 | * 25 | * @param key key for identifying the operations 26 | */ 27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; 28 | 29 | /** 30 | * Just remove the operations corresponding to the current UIView and key without cancelling them 31 | * 32 | * @param key key for identifying the operations 33 | */ 34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | #import "objc/runtime.h" 11 | 12 | static char loadOperationKey; 13 | 14 | @implementation UIView (WebCacheOperation) 15 | 16 | - (NSMutableDictionary *)operationDictionary { 17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 18 | if (operations) { 19 | return operations; 20 | } 21 | operations = [NSMutableDictionary dictionary]; 22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | return operations; 24 | } 25 | 26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { 27 | [self sd_cancelImageLoadOperationWithKey:key]; 28 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 29 | [operationDictionary setObject:operation forKey:key]; 30 | } 31 | 32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { 33 | // Cancel in progress downloader from queue 34 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 35 | id operations = [operationDictionary objectForKey:key]; 36 | if (operations) { 37 | if ([operations isKindOfClass:[NSArray class]]) { 38 | for (id operation in operations) { 39 | if (operation) { 40 | [operation cancel]; 41 | } 42 | } 43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 44 | [(id) operations cancel]; 45 | } 46 | [operationDictionary removeObjectForKey:key]; 47 | } 48 | } 49 | 50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key { 51 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 52 | [operationDictionary removeObjectForKey:key]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /JCYouku-master/JCYouku/UIView+extension.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension UIView { 4 | var x: CGFloat { 5 | get { 6 | return self.frame.origin.x 7 | } 8 | set(value) { 9 | self.frame.origin.x = value 10 | } 11 | } 12 | var y: CGFloat { 13 | get { 14 | return self.frame.origin.y 15 | } 16 | set(value) { 17 | self.frame.origin.y = value 18 | } 19 | } 20 | var width: CGFloat { 21 | get { 22 | return self.frame.size.width 23 | } 24 | set(value) { 25 | self.frame.size.width = value 26 | } 27 | } 28 | var height: CGFloat { 29 | get { 30 | return self.frame.size.height 31 | } 32 | set(value) { 33 | self.frame.size.height = value 34 | } 35 | } 36 | var centerX: CGFloat { 37 | get { 38 | return self.center.x 39 | } 40 | set(value) { 41 | self.center.x = value 42 | } 43 | } 44 | var centerY: CGFloat { 45 | get { 46 | return self.center.y 47 | } 48 | set(value) { 49 | self.center.y = value 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /JCYouku-master/JCYoukuTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /JCYouku-master/JCYoukuTests/JCYoukuTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCYoukuTests.swift 3 | // JCYoukuTests 4 | // 5 | // Created by mac on 16/1/8. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import JCYouku 11 | 12 | class JCYoukuTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /JCYouku-master/JCYoukuUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /JCYouku-master/JCYoukuUITests/JCYoukuUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JCYoukuUITests.swift 3 | // JCYoukuUITests 4 | // 5 | // Created by mac on 16/1/8. 6 | // Copyright © 2016年 HJaycee. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class JCYoukuUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /JCYouku-master/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '8.0' 3 | use_frameworks! 4 | 5 | pod 'Alamofire', '~> 3.0' -------------------------------------------------------------------------------- /JCYouku-master/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (3.1.4) 3 | 4 | DEPENDENCIES: 5 | - Alamofire (~> 3.0) 6 | 7 | SPEC CHECKSUMS: 8 | Alamofire: fbc829692f351fa1d8a31dd75fd7f7f56fea31fb 9 | 10 | COCOAPODS: 0.39.0 11 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Alamofire/Source/Error.swift: -------------------------------------------------------------------------------- 1 | // Error.swift 2 | // 3 | // Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | import Foundation 24 | 25 | /// The `Error` struct provides a convenience for creating custom Alamofire NSErrors. 26 | public struct Error { 27 | /// The domain used for creating all Alamofire errors. 28 | public static let Domain = "com.alamofire.error" 29 | 30 | /// The custom error codes generated by Alamofire. 31 | public enum Code: Int { 32 | case InputStreamReadFailed = -6000 33 | case OutputStreamWriteFailed = -6001 34 | case ContentTypeValidationFailed = -6002 35 | case StatusCodeValidationFailed = -6003 36 | case DataSerializationFailed = -6004 37 | case StringSerializationFailed = -6005 38 | case JSONSerializationFailed = -6006 39 | case PropertyListSerializationFailed = -6007 40 | } 41 | 42 | /** 43 | Creates an `NSError` with the given error code and failure reason. 44 | 45 | - parameter code: The error code. 46 | - parameter failureReason: The failure reason. 47 | 48 | - returns: An `NSError` with the given error code and failure reason. 49 | */ 50 | public static func errorWithCode(code: Code, failureReason: String) -> NSError { 51 | return errorWithCode(code.rawValue, failureReason: failureReason) 52 | } 53 | 54 | /** 55 | Creates an `NSError` with the given error code and failure reason. 56 | 57 | - parameter code: The error code. 58 | - parameter failureReason: The failure reason. 59 | 60 | - returns: An `NSError` with the given error code and failure reason. 61 | */ 62 | public static func errorWithCode(code: Int, failureReason: String) -> NSError { 63 | let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason] 64 | return NSError(domain: Domain, code: code, userInfo: userInfo) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Alamofire/Source/Response.swift: -------------------------------------------------------------------------------- 1 | // Response.swift 2 | // 3 | // Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | import Foundation 24 | 25 | /// Used to store all response data returned from a completed `Request`. 26 | public struct Response { 27 | /// The URL request sent to the server. 28 | public let request: NSURLRequest? 29 | 30 | /// The server's response to the URL request. 31 | public let response: NSHTTPURLResponse? 32 | 33 | /// The data returned by the server. 34 | public let data: NSData? 35 | 36 | /// The result of response serialization. 37 | public let result: Result 38 | 39 | /** 40 | Initializes the `Response` instance with the specified URL request, URL response, server data and response 41 | serialization result. 42 | 43 | - parameter request: The URL request sent to the server. 44 | - parameter response: The server's response to the URL request. 45 | - parameter data: The data returned by the server. 46 | - parameter result: The result of response serialization. 47 | 48 | - returns: the new `Response` instance. 49 | */ 50 | public init(request: NSURLRequest?, response: NSHTTPURLResponse?, data: NSData?, result: Result) { 51 | self.request = request 52 | self.response = response 53 | self.data = data 54 | self.result = result 55 | } 56 | } 57 | 58 | // MARK: - CustomStringConvertible 59 | 60 | extension Response: CustomStringConvertible { 61 | /// The textual representation used when written to an output stream, which includes whether the result was a 62 | /// success or failure. 63 | public var description: String { 64 | return result.debugDescription 65 | } 66 | } 67 | 68 | // MARK: - CustomDebugStringConvertible 69 | 70 | extension Response: CustomDebugStringConvertible { 71 | /// The debug textual representation used when written to an output stream, which includes the URL request, the URL 72 | /// response, the server data and the response serialization result. 73 | public var debugDescription: String { 74 | var output: [String] = [] 75 | 76 | output.append(request != nil ? "[Request]: \(request!)" : "[Request]: nil") 77 | output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") 78 | output.append("[Data]: \(data?.length ?? 0) bytes") 79 | output.append("[Result]: \(result.debugDescription)") 80 | 81 | return output.joinWithSeparator("\n") 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Alamofire/Source/Result.swift: -------------------------------------------------------------------------------- 1 | // Result.swift 2 | // 3 | // Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | import Foundation 24 | 25 | /** 26 | Used to represent whether a request was successful or encountered an error. 27 | 28 | - Success: The request and all post processing operations were successful resulting in the serialization of the 29 | provided associated value. 30 | - Failure: The request encountered an error resulting in a failure. The associated values are the original data 31 | provided by the server as well as the error that caused the failure. 32 | */ 33 | public enum Result { 34 | case Success(Value) 35 | case Failure(Error) 36 | 37 | /// Returns `true` if the result is a success, `false` otherwise. 38 | public var isSuccess: Bool { 39 | switch self { 40 | case .Success: 41 | return true 42 | case .Failure: 43 | return false 44 | } 45 | } 46 | 47 | /// Returns `true` if the result is a failure, `false` otherwise. 48 | public var isFailure: Bool { 49 | return !isSuccess 50 | } 51 | 52 | /// Returns the associated value if the result is a success, `nil` otherwise. 53 | public var value: Value? { 54 | switch self { 55 | case .Success(let value): 56 | return value 57 | case .Failure: 58 | return nil 59 | } 60 | } 61 | 62 | /// Returns the associated error value if the result is a failure, `nil` otherwise. 63 | public var error: Error? { 64 | switch self { 65 | case .Success: 66 | return nil 67 | case .Failure(let error): 68 | return error 69 | } 70 | } 71 | } 72 | 73 | // MARK: - CustomStringConvertible 74 | 75 | extension Result: CustomStringConvertible { 76 | /// The textual representation used when written to an output stream, which includes whether the result was a 77 | /// success or failure. 78 | public var description: String { 79 | switch self { 80 | case .Success: 81 | return "SUCCESS" 82 | case .Failure: 83 | return "FAILURE" 84 | } 85 | } 86 | } 87 | 88 | // MARK: - CustomDebugStringConvertible 89 | 90 | extension Result: CustomDebugStringConvertible { 91 | /// The debug textual representation used when written to an output stream, which includes whether the result was a 92 | /// success or failure in addition to the value or error. 93 | public var debugDescription: String { 94 | switch self { 95 | case .Success(let value): 96 | return "SUCCESS: \(value)" 97 | case .Failure(let error): 98 | return "FAILURE: \(error)" 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Alamofire/Source/Stream.swift: -------------------------------------------------------------------------------- 1 | // Stream.swift 2 | // 3 | // Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | import Foundation 24 | 25 | #if !os(watchOS) 26 | 27 | @available(iOS 9.0, OSX 10.11, *) 28 | extension Manager { 29 | private enum Streamable { 30 | case Stream(String, Int) 31 | case NetService(NSNetService) 32 | } 33 | 34 | private func stream(streamable: Streamable) -> Request { 35 | var streamTask: NSURLSessionStreamTask! 36 | 37 | switch streamable { 38 | case .Stream(let hostName, let port): 39 | dispatch_sync(queue) { 40 | streamTask = self.session.streamTaskWithHostName(hostName, port: port) 41 | } 42 | case .NetService(let netService): 43 | dispatch_sync(queue) { 44 | streamTask = self.session.streamTaskWithNetService(netService) 45 | } 46 | } 47 | 48 | let request = Request(session: session, task: streamTask) 49 | 50 | delegate[request.delegate.task] = request.delegate 51 | 52 | if startRequestsImmediately { 53 | request.resume() 54 | } 55 | 56 | return request 57 | } 58 | 59 | /** 60 | Creates a request for bidirectional streaming with the given hostname and port. 61 | 62 | - parameter hostName: The hostname of the server to connect to. 63 | - parameter port: The port of the server to connect to. 64 | 65 | :returns: The created stream request. 66 | */ 67 | public func stream(hostName hostName: String, port: Int) -> Request { 68 | return stream(.Stream(hostName, port)) 69 | } 70 | 71 | /** 72 | Creates a request for bidirectional streaming with the given `NSNetService`. 73 | 74 | - parameter netService: The net service used to identify the endpoint. 75 | 76 | - returns: The created stream request. 77 | */ 78 | public func stream(netService netService: NSNetService) -> Request { 79 | return stream(.NetService(netService)) 80 | } 81 | } 82 | 83 | // MARK: - 84 | 85 | @available(iOS 9.0, OSX 10.11, *) 86 | extension Manager.SessionDelegate: NSURLSessionStreamDelegate { 87 | 88 | // MARK: Override Closures 89 | 90 | /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:readClosedForStreamTask:`. 91 | public var streamTaskReadClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { 92 | get { 93 | return _streamTaskReadClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void 94 | } 95 | set { 96 | _streamTaskReadClosed = newValue 97 | } 98 | } 99 | 100 | /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:writeClosedForStreamTask:`. 101 | public var streamTaskWriteClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { 102 | get { 103 | return _streamTaskWriteClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void 104 | } 105 | set { 106 | _streamTaskWriteClosed = newValue 107 | } 108 | } 109 | 110 | /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:betterRouteDiscoveredForStreamTask:`. 111 | public var streamTaskBetterRouteDiscovered: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { 112 | get { 113 | return _streamTaskBetterRouteDiscovered as? (NSURLSession, NSURLSessionStreamTask) -> Void 114 | } 115 | set { 116 | _streamTaskBetterRouteDiscovered = newValue 117 | } 118 | } 119 | 120 | /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:streamTask:didBecomeInputStream:outputStream:`. 121 | public var streamTaskDidBecomeInputStream: ((NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void)? { 122 | get { 123 | return _streamTaskDidBecomeInputStream as? (NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void 124 | } 125 | set { 126 | _streamTaskDidBecomeInputStream = newValue 127 | } 128 | } 129 | 130 | // MARK: Delegate Methods 131 | 132 | /** 133 | Tells the delegate that the read side of the connection has been closed. 134 | 135 | - parameter session: The session. 136 | - parameter streamTask: The stream task. 137 | */ 138 | public func URLSession(session: NSURLSession, readClosedForStreamTask streamTask: NSURLSessionStreamTask) { 139 | streamTaskReadClosed?(session, streamTask) 140 | } 141 | 142 | /** 143 | Tells the delegate that the write side of the connection has been closed. 144 | 145 | - parameter session: The session. 146 | - parameter streamTask: The stream task. 147 | */ 148 | public func URLSession(session: NSURLSession, writeClosedForStreamTask streamTask: NSURLSessionStreamTask) { 149 | streamTaskWriteClosed?(session, streamTask) 150 | } 151 | 152 | /** 153 | Tells the delegate that the system has determined that a better route to the host is available. 154 | 155 | - parameter session: The session. 156 | - parameter streamTask: The stream task. 157 | */ 158 | public func URLSession(session: NSURLSession, betterRouteDiscoveredForStreamTask streamTask: NSURLSessionStreamTask) { 159 | streamTaskBetterRouteDiscovered?(session, streamTask) 160 | } 161 | 162 | /** 163 | Tells the delegate that the stream task has been completed and provides the unopened stream objects. 164 | 165 | - parameter session: The session. 166 | - parameter streamTask: The stream task. 167 | - parameter inputStream: The new input stream. 168 | - parameter outputStream: The new output stream. 169 | */ 170 | public func URLSession( 171 | session: NSURLSession, 172 | streamTask: NSURLSessionStreamTask, 173 | didBecomeInputStream inputStream: NSInputStream, 174 | outputStream: NSOutputStream) 175 | { 176 | streamTaskDidBecomeInputStream?(session, streamTask, inputStream, outputStream) 177 | } 178 | } 179 | 180 | #endif 181 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Alamofire/Source/Validation.swift: -------------------------------------------------------------------------------- 1 | // Validation.swift 2 | // 3 | // Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | import Foundation 24 | 25 | extension Request { 26 | 27 | /** 28 | Used to represent whether validation was successful or encountered an error resulting in a failure. 29 | 30 | - Success: The validation was successful. 31 | - Failure: The validation failed encountering the provided error. 32 | */ 33 | public enum ValidationResult { 34 | case Success 35 | case Failure(NSError) 36 | } 37 | 38 | /** 39 | A closure used to validate a request that takes a URL request and URL response, and returns whether the 40 | request was valid. 41 | */ 42 | public typealias Validation = (NSURLRequest?, NSHTTPURLResponse) -> ValidationResult 43 | 44 | /** 45 | Validates the request, using the specified closure. 46 | 47 | If validation fails, subsequent calls to response handlers will have an associated error. 48 | 49 | - parameter validation: A closure to validate the request. 50 | 51 | - returns: The request. 52 | */ 53 | public func validate(validation: Validation) -> Self { 54 | delegate.queue.addOperationWithBlock { 55 | if let 56 | response = self.response where self.delegate.error == nil, 57 | case let .Failure(error) = validation(self.request, response) 58 | { 59 | self.delegate.error = error 60 | } 61 | } 62 | 63 | return self 64 | } 65 | 66 | // MARK: - Status Code 67 | 68 | /** 69 | Validates that the response has a status code in the specified range. 70 | 71 | If validation fails, subsequent calls to response handlers will have an associated error. 72 | 73 | - parameter range: The range of acceptable status codes. 74 | 75 | - returns: The request. 76 | */ 77 | public func validate(statusCode acceptableStatusCode: S) -> Self { 78 | return validate { _, response in 79 | if acceptableStatusCode.contains(response.statusCode) { 80 | return .Success 81 | } else { 82 | let failureReason = "Response status code was unacceptable: \(response.statusCode)" 83 | return .Failure(Error.errorWithCode(.StatusCodeValidationFailed, failureReason: failureReason)) 84 | } 85 | } 86 | } 87 | 88 | // MARK: - Content-Type 89 | 90 | private struct MIMEType { 91 | let type: String 92 | let subtype: String 93 | 94 | init?(_ string: String) { 95 | let components: [String] = { 96 | let stripped = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 97 | let split = stripped.substringToIndex(stripped.rangeOfString(";")?.startIndex ?? stripped.endIndex) 98 | return split.componentsSeparatedByString("/") 99 | }() 100 | 101 | if let 102 | type = components.first, 103 | subtype = components.last 104 | { 105 | self.type = type 106 | self.subtype = subtype 107 | } else { 108 | return nil 109 | } 110 | } 111 | 112 | func matches(MIME: MIMEType) -> Bool { 113 | switch (type, subtype) { 114 | case (MIME.type, MIME.subtype), (MIME.type, "*"), ("*", MIME.subtype), ("*", "*"): 115 | return true 116 | default: 117 | return false 118 | } 119 | } 120 | } 121 | 122 | /** 123 | Validates that the response has a content type in the specified array. 124 | 125 | If validation fails, subsequent calls to response handlers will have an associated error. 126 | 127 | - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. 128 | 129 | - returns: The request. 130 | */ 131 | public func validate(contentType acceptableContentTypes: S) -> Self { 132 | return validate { _, response in 133 | guard let validData = self.delegate.data where validData.length > 0 else { return .Success } 134 | 135 | if let 136 | responseContentType = response.MIMEType, 137 | responseMIMEType = MIMEType(responseContentType) 138 | { 139 | for contentType in acceptableContentTypes { 140 | if let acceptableMIMEType = MIMEType(contentType) where acceptableMIMEType.matches(responseMIMEType) { 141 | return .Success 142 | } 143 | } 144 | } else { 145 | for contentType in acceptableContentTypes { 146 | if let MIMEType = MIMEType(contentType) where MIMEType.type == "*" && MIMEType.subtype == "*" { 147 | return .Success 148 | } 149 | } 150 | } 151 | 152 | let failureReason: String 153 | 154 | if let responseContentType = response.MIMEType { 155 | failureReason = ( 156 | "Response content type \"\(responseContentType)\" does not match any acceptable " + 157 | "content types: \(acceptableContentTypes)" 158 | ) 159 | } else { 160 | failureReason = "Response content type was missing and acceptable content type does not match \"*/*\"" 161 | } 162 | 163 | return .Failure(Error.errorWithCode(.ContentTypeValidationFailed, failureReason: failureReason)) 164 | } 165 | } 166 | 167 | // MARK: - Automatic 168 | 169 | /** 170 | Validates that the response has a status code in the default acceptable range of 200...299, and that the content 171 | type matches any specified in the Accept HTTP header field. 172 | 173 | If validation fails, subsequent calls to response handlers will have an associated error. 174 | 175 | - returns: The request. 176 | */ 177 | public func validate() -> Self { 178 | let acceptableStatusCodes: Range = 200..<300 179 | let acceptableContentTypes: [String] = { 180 | if let accept = request?.valueForHTTPHeaderField("Accept") { 181 | return accept.componentsSeparatedByString(",") 182 | } 183 | 184 | return ["*/*"] 185 | }() 186 | 187 | return validate(statusCode: acceptableStatusCodes).validate(contentType: acceptableContentTypes) 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (3.1.4) 3 | 4 | DEPENDENCIES: 5 | - Alamofire (~> 3.0) 6 | 7 | SPEC CHECKSUMS: 8 | Alamofire: fbc829692f351fa1d8a31dd75fd7f7f56fea31fb 9 | 10 | COCOAPODS: 0.39.0 11 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Pods.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/Alamofire.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Pods.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Pods.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Alamofire.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 432ECC54282C84882B482CCB4CF227FC 21 | 22 | primary 23 | 24 | 25 | 57CFC4DF5A94826729A3A532FC59EE52 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Alamofire/Alamofire-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Alamofire : NSObject 3 | @end 4 | @implementation PodsDummy_Alamofire 5 | @end 6 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double AlamofireVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Alamofire/Alamofire.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Alamofire/Alamofire.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Alamofire" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Alamofire/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.1.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Alamofire 5 | 6 | Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | Alamofire 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Pods-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "Pods/Alamofire.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "Pods/Alamofire.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Pods-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double PodsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char PodsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Alamofire.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Pods.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods { 2 | umbrella header "Pods-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /JCYouku-master/Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Alamofire.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JCYouku 2 | 3 | ### 这个是我在学习Swift过程中利用业余时间边学边做的山寨优酷项目,希望可以帮助到想学习Swift的人。 4 | ### 原版的首页板块数量较多,我只做了2个板块,也就是可重用的cell,要增加板块只要套我写好的模板增加新的cell就可以了。 5 | ### 所有数据都是通过接口获得的,以达到更加真实的效果。 6 | 7 | # 项目截图 8 | 9 | ![(logo)](http://img0.ph.126.net/JCoLUgug-Csuy6bjKXdA0Q==/6630594975701838450.jpg) 10 | ![(logo)](http://img2.ph.126.net/Mfr1IEyb465oWE8I50-k6w==/6631413012354579122.jpg) 11 | ![(logo)](http://img2.ph.126.net/gsP3gJiYCdaXkiahxXWxRg==/6630842365818104114.jpg) 12 | 13 | # 联系方式 14 | 15 | #### 邮箱 : hjaycee@163.com 16 | #### 博客 : http://blog.csdn.net/hjaycee 17 | #### 如发现框架有bug或者有任何建议或疑问都请发我邮箱,谢谢! 18 | --------------------------------------------------------------------------------