├── MBCLiveShow ├── Assets.xcassets │ ├── Contents.json │ ├── avplay │ │ ├── Contents.json │ │ ├── movie_back.imageset │ │ │ ├── movie_back@2x.png │ │ │ └── Contents.json │ │ ├── movie_lock.imageset │ │ │ ├── movie_lock@2x.png │ │ │ └── Contents.json │ │ ├── movie_mini.imageset │ │ │ ├── movie_mini@2x.png │ │ │ └── Contents.json │ │ ├── movie_next.imageset │ │ │ ├── movie_next@2x.png │ │ │ └── Contents.json │ │ ├── movie_play.imageset │ │ │ ├── movie_play@2x.png │ │ │ └── Contents.json │ │ ├── movie_prev.imageset │ │ │ ├── movie_prev@2x.png │ │ │ └── Contents.json │ │ ├── movie_pause.imageset │ │ │ ├── movie_pause@2x.png │ │ │ └── Contents.json │ │ ├── movie_back_s.imageset │ │ │ ├── movie_back_s@2x.png │ │ │ └── Contents.json │ │ ├── movie_setting.imageset │ │ │ ├── movie_setting@2x.png │ │ │ └── Contents.json │ │ ├── movie_unlock.imageset │ │ │ ├── movie_unlock@2x.png │ │ │ └── Contents.json │ │ ├── movie_playsmall.imageset │ │ │ ├── movie_playsmall@2x.png │ │ │ └── Contents.json │ │ ├── movie_fullscreen.imageset │ │ │ ├── movie_fullscreen@2x.png │ │ │ └── Contents.json │ │ ├── movie_pausesmall.imageset │ │ │ ├── movie_pausesmall@2x.png │ │ │ └── Contents.json │ │ ├── movie_subtitle_off.imageset │ │ │ ├── movie_subtitle_off@2x.png │ │ │ └── Contents.json │ │ └── movie_subtitle_on.imageset │ │ │ ├── movie_subtitle_on@2x.png │ │ │ └── Contents.json │ ├── tabbar │ │ ├── Contents.json │ │ ├── tabbar_me.imageset │ │ │ ├── tabbar_me@2x.png │ │ │ └── Contents.json │ │ ├── tabbar_new.imageset │ │ │ ├── tabbar_new@2x.png │ │ │ └── Contents.json │ │ ├── tabbar_game.imageset │ │ │ ├── tabbar_game@2x.png │ │ │ └── Contents.json │ │ ├── tabbar_home.imageset │ │ │ ├── tabbar_home@2x.png │ │ │ └── Contents.json │ │ ├── tabbar_room.imageset │ │ │ ├── tabbar_room@2x.png │ │ │ └── Contents.json │ │ ├── tabbar_me_sel.imageset │ │ │ ├── tabbar_me_sel@2x.png │ │ │ └── Contents.json │ │ ├── tabbar_game_sel.imageset │ │ │ ├── tabbar_game_sel@2x.png │ │ │ └── Contents.json │ │ ├── tabbar_home_sel.imageset │ │ │ ├── tabbar_home_sel@2x.png │ │ │ └── Contents.json │ │ └── tabbar_room_sel.imageset │ │ │ ├── tabbar_room_sel@2x.png │ │ │ └── Contents.json │ ├── titleButton.imageset │ │ ├── nil.png │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── AppIcon60x60@2x.png │ │ └── Contents.json │ ├── LaunchImage.imageset │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── Contents.json │ ├── Search.imageset │ │ ├── tabbar_discover@2x.png │ │ ├── tabbar_discover@3x.png │ │ └── Contents.json │ └── Search_selected.imageset │ │ ├── tabbar_discover_selected@2x.png │ │ ├── tabbar_discover_selected@3x.png │ │ └── Contents.json ├── MBCLiveShow.xcdatamodeld │ ├── .xccurrentversion │ └── MBCLiveShow.xcdatamodel │ │ └── contents ├── Info.plist └── Base.lproj │ └── LaunchScreen.storyboard ├── Classes ├── Lib │ ├── SDWebImage │ │ ├── placeholder.png │ │ ├── placeholder@2x.png │ │ ├── UIImage+MultiFormat.h │ │ ├── SDWebImageOperation.h │ │ ├── UIImage+GIF.h │ │ ├── SDWebImageDecoder.h │ │ ├── UIImage+WebP.h │ │ ├── NSData+ImageContentType.h │ │ ├── UIView+WebCacheOperation.h │ │ ├── NSData+ImageContentType.m │ │ ├── SDWebImageCompat.m │ │ ├── SDWebImageCompat.h │ │ ├── UIView+WebCacheOperation.m │ │ ├── UIImage+WebP.m │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageDecoder.m │ │ ├── UIImage+MultiFormat.m │ │ ├── SDWebImagePrefetcher.h │ │ ├── UIImageView+HighlightedWebCache.m │ │ ├── MKAnnotationView+WebCache.m │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImage+GIF.m │ │ ├── SDWebImagePrefetcher.m │ │ └── MKAnnotationView+WebCache.h │ ├── MJRefresh │ │ ├── MJRefresh.bundle │ │ │ └── arrow@2x.png │ │ ├── MJRefreshFooterView.h │ │ ├── MJRefreshHeaderView.h │ │ ├── UIView+MJExtension.h │ │ ├── UIScrollView+MJExtension.h │ │ ├── MJRefreshConst.m │ │ ├── MJRefresh.h │ │ ├── MJRefreshConst.h │ │ ├── UIView+MJExtension.m │ │ ├── MJRefreshBaseView.h │ │ ├── UIScrollView+MJExtension.m │ │ └── UIScrollView+MJRefresh.h │ ├── CycleScrollView │ │ ├── NSTimer+Addition.h │ │ ├── NSTimer+Addition.m │ │ └── CycleScrollView.h │ └── AFNetworking │ │ ├── LICENSE │ │ ├── UIKit+AFNetworking │ │ ├── UIImage+AFNetworking.h │ │ ├── UIKit+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── UIAlertView+AFNetworking.h │ │ └── UIWebView+AFNetworking.h │ │ └── AFNetworking │ │ ├── AFNetworking.h │ │ ├── AFHTTPRequestOperation.h │ │ └── AFSecurityPolicy.h ├── Column(栏目) │ ├── Model │ │ ├── MBCColumnModel.m │ │ └── MBCColumnModel.h │ ├── Controller │ │ ├── MBCColumnController.h │ │ └── MBCColumnController.m │ └── View │ │ ├── MBCColumnCell.h │ │ ├── MBCColumnCell.m │ │ └── MBCColumnCell.xib ├── DirectSeeding(直播) │ ├── Model │ │ ├── MBCMovieModel.m │ │ └── MBCMovieModel.h │ ├── Controller │ │ ├── MBCDirectSeedController.h │ │ └── MBCDirectSeedController.m │ └── View │ │ ├── MBCMoviewCell.h │ │ └── MBCMoviewCell.m ├── Recommend(推荐) │ ├── Model │ │ ├── MBCListClassModel.m │ │ ├── MBCRecomScrModel.m │ │ ├── MBCRecomHeaderModel.m │ │ ├── MBCRecomHeaderModel.h │ │ ├── MBCRecomScrModel.h │ │ └── MBCListClassModel.h │ ├── Controller │ │ └── MBCReconmendController.h │ └── View │ │ ├── MBCListClassCell.h │ │ ├── MBCRecomScrollCell.h │ │ ├── MBCRecomHeaderView.h │ │ ├── MBCRecomHeaderView.m │ │ ├── MBCListClassCell.m │ │ └── MBCRecomScrollCell.m ├── Main │ └── Controller │ │ ├── MBCTabController.h │ │ ├── MBCNavigationController.h │ │ ├── MBCNavigationController.m │ │ └── MBCTabController.m ├── My(我的) │ ├── MBCProfileController.h │ └── MBCProfileController.m ├── Base │ ├── MBCBaseCell.h │ └── MBCBaseCell.m ├── PlayMovie(直播界面) │ ├── Controller │ │ ├── MBCPlayViewCtr.h │ │ └── MBCPlayViewCtr.m │ └── View │ │ ├── MBCPlayView.h │ │ ├── MBCTransverseNav.h │ │ ├── MBCVertivalNav.h │ │ ├── MBCPlayView.m │ │ ├── MBCTransverseNav.m │ │ └── MBCVertivalNav.m ├── Other │ ├── main.m │ ├── AppDelegate.h │ └── AppDelegate.m └── Tools │ ├── UIBarButtonItem+Item.h │ ├── UIButton+Button.h │ ├── UIBarButtonItem+Item.m │ └── UIButton+Button.m ├── MBCLiveShow.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── README.md └── .gitignore /MBCLiveShow/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Classes/Lib/SDWebImage/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/Classes/Lib/SDWebImage/placeholder.png -------------------------------------------------------------------------------- /Classes/Lib/SDWebImage/placeholder@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/Classes/Lib/SDWebImage/placeholder@2x.png -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/MJRefresh.bundle/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/Classes/Lib/MJRefresh/MJRefresh.bundle/arrow@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/titleButton.imageset/nil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/titleButton.imageset/nil.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/Search.imageset/tabbar_discover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/Search.imageset/tabbar_discover@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/Search.imageset/tabbar_discover@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/Search.imageset/tabbar_discover@3x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_me.imageset/tabbar_me@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/tabbar/tabbar_me.imageset/tabbar_me@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_back.imageset/movie_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_back.imageset/movie_back@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_lock.imageset/movie_lock@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_lock.imageset/movie_lock@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_mini.imageset/movie_mini@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_mini.imageset/movie_mini@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_next.imageset/movie_next@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_next.imageset/movie_next@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_play.imageset/movie_play@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_play.imageset/movie_play@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_prev.imageset/movie_prev@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_prev.imageset/movie_prev@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_new.imageset/tabbar_new@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/tabbar/tabbar_new.imageset/tabbar_new@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_pause.imageset/movie_pause@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_pause.imageset/movie_pause@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_game.imageset/tabbar_game@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/tabbar/tabbar_game.imageset/tabbar_game@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_home.imageset/tabbar_home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/tabbar/tabbar_home.imageset/tabbar_home@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_room.imageset/tabbar_room@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/tabbar/tabbar_room.imageset/tabbar_room@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_back_s.imageset/movie_back_s@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_back_s.imageset/movie_back_s@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_setting.imageset/movie_setting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_setting.imageset/movie_setting@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_unlock.imageset/movie_unlock@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_unlock.imageset/movie_unlock@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_me_sel.imageset/tabbar_me_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/tabbar/tabbar_me_sel.imageset/tabbar_me_sel@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_playsmall.imageset/movie_playsmall@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_playsmall.imageset/movie_playsmall@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_game_sel.imageset/tabbar_game_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/tabbar/tabbar_game_sel.imageset/tabbar_game_sel@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_home_sel.imageset/tabbar_home_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/tabbar/tabbar_home_sel.imageset/tabbar_home_sel@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_room_sel.imageset/tabbar_room_sel@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/tabbar/tabbar_room_sel.imageset/tabbar_room_sel@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/Search_selected.imageset/tabbar_discover_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/Search_selected.imageset/tabbar_discover_selected@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/Search_selected.imageset/tabbar_discover_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/Search_selected.imageset/tabbar_discover_selected@3x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_fullscreen.imageset/movie_fullscreen@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_fullscreen.imageset/movie_fullscreen@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_pausesmall.imageset/movie_pausesmall@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_pausesmall.imageset/movie_pausesmall@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_subtitle_off.imageset/movie_subtitle_off@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_subtitle_off.imageset/movie_subtitle_off@2x.png -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_subtitle_on.imageset/movie_subtitle_on@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al1020119/CollectionViewProject/HEAD/MBCLiveShow/Assets.xcassets/avplay/movie_subtitle_on.imageset/movie_subtitle_on@2x.png -------------------------------------------------------------------------------- /MBCLiveShow.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Classes/Lib/CycleScrollView/NSTimer+Addition.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import 4 | 5 | @interface NSTimer (Addition) 6 | 7 | - (void)pauseTimer; 8 | - (void)resumeTimer; 9 | - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval; 10 | @end 11 | -------------------------------------------------------------------------------- /Classes/Column(栏目)/Model/MBCColumnModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCColumnModel.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCColumnModel.h" 10 | 11 | @implementation MBCColumnModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/DirectSeeding(直播)/Model/MBCMovieModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCMovieModel.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCMovieModel.h" 10 | 11 | @implementation MBCMovieModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/Model/MBCListClassModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCListClassModel.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCListClassModel.h" 10 | 11 | @implementation MBCListClassModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Main/Controller/MBCTabController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCTabController.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCTabController : UITabBarController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/My(我的)/MBCProfileController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCProfileController.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCProfileController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/Model/MBCRecomScrModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCRecomScrModel.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 轮播图模型 8 | 9 | #import "MBCRecomScrModel.h" 10 | 11 | @implementation MBCRecomScrModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Base/MBCBaseCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCBaseCell.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCBaseCell : UICollectionViewCell 12 | -(void)setCellModel:(id)obj; 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/Model/MBCRecomHeaderModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCRecomHeaderModel.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCRecomHeaderModel.h" 10 | 11 | @implementation MBCRecomHeaderModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Base/MBCBaseCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCBaseCell.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCBaseCell.h" 10 | 11 | @implementation MBCBaseCell 12 | 13 | -(void)setCellModel:(id)obj 14 | { 15 | 16 | } 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/Column(栏目)/Controller/MBCColumnController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCColumnController.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCColumnController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MBCLiveShow/MBCLiveShow.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | MBCLiveShow.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/MJRefreshFooterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshTableFooterView.h 3 | // MJRefresh 4 | // 5 | // Created by mj on 13-2-26. 6 | // Copyright (c) 2013年 itcast. All rights reserved. 7 | // 上拉加载更多 8 | 9 | #import "MJRefreshBaseView.h" 10 | 11 | @interface MJRefreshFooterView : MJRefreshBaseView 12 | + (instancetype)footer; 13 | @end -------------------------------------------------------------------------------- /Classes/Main/Controller/MBCNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCNavigationController.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCNavigationController : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/Controller/MBCReconmendController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCReconmendController.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCReconmendController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/DirectSeeding(直播)/Controller/MBCDirectSeedController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCDirectSeedController.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCDirectSeedController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/DirectSeeding(直播)/View/MBCMoviewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCMoviewCell.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCMoviewCell : UICollectionViewCell 12 | 13 | -(void)setCellModel:(id)obj; 14 | @end 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CollectionViewProject 2 | CollectionView综合案例(全名TV-App) 3 | 4 | 5 | 一个全名TV的高防App,基本使用CollectionView,所以是CollectionView综合经典案例 6 | 7 | Q Q:2211523682/790806573 8 | 9 | 微信:18370997821/13148454507 10 | 11 | 微博WB:http://weibo.com/u/3288975567?is_hot=1 12 | 13 | git博文:http://al1020119.github.io/ 14 | 15 | github:https://github.com/al1020119 -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/View/MBCListClassCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCListClassCell.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCListClassCell : UICollectionViewCell 12 | 13 | -(void)setCellModel:(id)obj; 14 | @end 15 | -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/View/MBCRecomScrollCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCRecomScrollCell.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCRecomScrollCell : UICollectionViewCell 12 | 13 | -(void)setCellModel:(id)obj; 14 | @end 15 | -------------------------------------------------------------------------------- /Classes/PlayMovie(直播界面)/Controller/MBCPlayViewCtr.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCPlayViewCtr.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCPlayViewCtr : UIViewController 12 | 13 | -(instancetype)initWithVideoId:(NSString *)uid; 14 | @end 15 | -------------------------------------------------------------------------------- /Classes/PlayMovie(直播界面)/View/MBCPlayView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCPlayView.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 播放器 8 | 9 | #import 10 | 11 | #import 12 | @interface MBCPlayView : UIView 13 | 14 | @property(nonatomic,strong)AVPlayer *player; 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/MJRefreshHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshHeaderView.h 3 | // MJRefresh 4 | // 5 | // Created by mj on 13-2-26. 6 | // Copyright (c) 2013年 itcast. All rights reserved. 7 | // 下拉刷新 8 | 9 | #import "MJRefreshBaseView.h" 10 | 11 | @interface MJRefreshHeaderView : MJRefreshBaseView 12 | 13 | @property (nonatomic, copy) NSString *dateKey; 14 | + (instancetype)header; 15 | 16 | @end -------------------------------------------------------------------------------- /Classes/Column(栏目)/Model/MBCColumnModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCColumnModel.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCColumnModel : NSObject 12 | @property (nonatomic,copy)NSString *name; 13 | @property (nonatomic,copy)NSString *image; 14 | @end 15 | -------------------------------------------------------------------------------- /MBCLiveShow/MBCLiveShow.xcdatamodeld/MBCLiveShow.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/Model/MBCRecomHeaderModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCRecomHeaderModel.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MBCRecomHeaderModel : NSObject 12 | @property (nonatomic,copy)NSString *name; 13 | @property (nonatomic,copy)NSString *slug; 14 | @end 15 | -------------------------------------------------------------------------------- /Classes/Other/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/Model/MBCRecomScrModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCRecomScrModel.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 轮播图模型 8 | 9 | #import 10 | 11 | @interface MBCRecomScrModel : NSObject 12 | //标题 13 | @property (nonatomic,copy)NSString *title; 14 | //图片 15 | @property (nonatomic,copy)NSString *thumb; 16 | @end 17 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/Model/MBCListClassModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCListClassModel.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 圆圈列表模型 8 | 9 | #import 10 | 11 | @interface MBCListClassModel : NSObject 12 | //标题 13 | @property (nonatomic,copy)NSString *title; 14 | //图片 15 | @property (nonatomic,copy)NSString *thumb; 16 | @end 17 | -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/titleButton.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "nil.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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_me.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_me@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_back@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_back_s.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_back_s@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_lock.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_lock@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_mini.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_mini@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_next.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_next@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_pause.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_pause@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_play.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_play@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_prev.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_prev@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_unlock.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_unlock@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_game.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_game@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_home@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_new.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_new@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_room.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_room@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_setting.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_setting@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_me_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_me_sel@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_fullscreen.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_fullscreen@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_pausesmall.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_pausesmall@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_playsmall.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_playsmall@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_subtitle_on.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_subtitle_on@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_game_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_game_sel@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_home_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_home_sel@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 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/tabbar/tabbar_room_sel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_room_sel@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 | } -------------------------------------------------------------------------------- /Classes/Tools/UIBarButtonItem+Item.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIBarButtonItem+Item.h 3 | // ThePeople 4 | // 5 | // Created by aoyolo on 16/4/12. 6 | // Copyright © 2016年 Ms.Gao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIBarButtonItem (Item) 12 | 13 | + (UIBarButtonItem *)barButtonItemWithImage:(NSString *)image highImage:(NSString *)highImage target:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/avplay/movie_subtitle_off.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "movie_subtitle_off@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 | } -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/PlayMovie(直播界面)/View/MBCTransverseNav.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCTransverseNav.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 横屏 8 | 9 | #import 10 | 11 | @protocol MBCTansveNavDelegate 12 | 13 | -(void)TransverseNavWillDidOnclick:(NSInteger)tag; 14 | 15 | @end 16 | @interface MBCTransverseNav : UIView 17 | @property (nonatomic,weak) iddelegate; 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/PlayMovie(直播界面)/View/MBCVertivalNav.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCVertivalNav.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 竖屏 8 | 9 | #import 10 | 11 | @protocol MBCVertivalNavDelegate 12 | 13 | -(void)didWillVerticalNavOnclick:(NSInteger)tag; 14 | 15 | @end 16 | @interface MBCVertivalNav : UIView 17 | 18 | @property (nonatomic,weak)id delegate; 19 | @end 20 | -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "LaunchImage@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "LaunchImage@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/Search.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_discover@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tabbar_discover@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Classes/Column(栏目)/View/MBCColumnCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCColumnCell.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MBCColumnModel; 12 | @interface MBCColumnCell : UICollectionViewCell 13 | @property (weak, nonatomic) IBOutlet UIImageView *image; 14 | @property (weak, nonatomic) IBOutlet UILabel *name; 15 | 16 | @property (nonatomic,strong)MBCColumnModel *column; 17 | @end 18 | -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/Search_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_discover_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "tabbar_discover_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/View/MBCRecomHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCRecomHeaderView 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 直播头部 8 | 9 | #import 10 | 11 | #import "MBCRecomHeaderModel.h" 12 | @interface MBCRecomHeaderView : UICollectionReusableView 13 | 14 | @property (weak, nonatomic) IBOutlet UIButton *goUp; 15 | 16 | @property (weak, nonatomic) IBOutlet UILabel *name; 17 | @property(nonatomic,strong)MBCRecomHeaderModel *recomHeaderModel; 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/My(我的)/MBCProfileController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCProfileController.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCProfileController.h" 10 | 11 | @interface MBCProfileController () 12 | 13 | @end 14 | 15 | @implementation MBCProfileController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | self.view.backgroundColor = [UIColor greenColor]; 21 | } 22 | 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/Tools/UIButton+Button.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Button.h 3 | // ThePeople 4 | // 5 | // Created by aoyolo on 16/4/14. 6 | // Copyright © 2016年 Ms.Gao. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIButton (Button) 12 | +(UIButton *)ButtonWithRect:(CGRect)rect title:(NSString *)title 13 | titleColor:(UIColor *)color Image:(NSString *)image HighlightedImage:(NSString *)highlightedImage clickAction:(SEL)clickAction viewController:(id)viewController contentEdgeInsets:(UIEdgeInsets)contentEdgeInsets tag:(NSInteger)tag; 14 | @end 15 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 14-5-28. 6 | // Copyright (c) 2014年 itcast. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (MJExtension) 12 | @property (assign, nonatomic) CGFloat mj_x; 13 | @property (assign, nonatomic) CGFloat mj_y; 14 | @property (assign, nonatomic) CGFloat mj_width; 15 | @property (assign, nonatomic) CGFloat mj_height; 16 | @property (assign, nonatomic) CGSize mj_size; 17 | @property (assign, nonatomic) CGPoint mj_origin; 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/View/MBCRecomHeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCRecomHeaderView.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 直播头部 8 | 9 | #import "MBCRecomHeaderView.h" 10 | 11 | @interface MBCRecomHeaderView () 12 | 13 | 14 | @end 15 | @implementation MBCRecomHeaderView 16 | 17 | -(void)setRecomHeaderModel:(MBCRecomHeaderModel *)recomHeaderModel 18 | { 19 | self.name.text = recomHeaderModel.name; 20 | } 21 | - (void)awakeFromNib { 22 | [super awakeFromNib]; 23 | // Initialization code 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/Column(栏目)/View/MBCColumnCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCColumnCell.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCColumnCell.h" 10 | #import "MBCColumnModel.h" 11 | #import "UIImageView+WebCache.h" 12 | @implementation MBCColumnCell 13 | 14 | - (void)awakeFromNib { 15 | [super awakeFromNib]; 16 | // Initialization code 17 | } 18 | 19 | -(void)setColumn:(MBCColumnModel *)column 20 | { 21 | [self.image sd_setImageWithURL:[NSURL URLWithString:column.image]]; 22 | 23 | self.name.text = column.name; 24 | 25 | } 26 | @end 27 | -------------------------------------------------------------------------------- /Classes/Lib/CycleScrollView/NSTimer+Addition.m: -------------------------------------------------------------------------------- 1 | 2 | #import "NSTimer+Addition.h" 3 | 4 | @implementation NSTimer (Addition) 5 | 6 | -(void)pauseTimer 7 | { 8 | if (![self isValid]) { 9 | return ; 10 | } 11 | [self setFireDate:[NSDate distantFuture]]; 12 | } 13 | 14 | 15 | -(void)resumeTimer 16 | { 17 | if (![self isValid]) { 18 | return ; 19 | } 20 | [self setFireDate:[NSDate date]]; 21 | } 22 | 23 | - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval 24 | { 25 | if (![self isValid]) { 26 | return ; 27 | } 28 | [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/DirectSeeding(直播)/Model/MBCMovieModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBCMovieModel.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 播放 8 | 9 | #import 10 | 11 | @interface MBCMovieModel : NSObject 12 | /**头像*/ 13 | @property (nonatomic,strong)NSString *avatar; 14 | /**图片*/ 15 | @property (nonatomic,strong)NSString *thumb; 16 | /**标题*/ 17 | @property (nonatomic,strong)NSString *title; 18 | /**昵称*/ 19 | @property (nonatomic,strong)NSString *nick; 20 | /***/ 21 | @property (nonatomic,strong)NSString *view; 22 | /**Uid*/ 23 | @property (nonatomic,strong)NSString *uid; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/PlayMovie(直播界面)/View/MBCPlayView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCPlayView.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCPlayView.h" 10 | 11 | @implementation MBCPlayView 12 | 13 | -(instancetype)initWithFrame:(CGRect)frame 14 | { 15 | if (self = [super initWithFrame:frame]) { 16 | 17 | } 18 | return self; 19 | } 20 | +(Class)layerClass 21 | { 22 | return [AVPlayerLayer class]; 23 | } 24 | //get 方法 25 | -(AVPlayer *)player 26 | { 27 | return [(AVPlayerLayer *)[self layer] player]; 28 | } 29 | 30 | //set方法 31 | -(void)setPlayer:(AVPlayer *)player 32 | { 33 | [(AVPlayerLayer *)[self layer] setPlayer:player]; 34 | } 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/Other/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | 16 | @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; 17 | @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; 18 | @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; 19 | 20 | - (void)saveContext; 21 | - (NSURL *)applicationDocumentsDirectory; 22 | 23 | 24 | @end 25 | 26 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+Extension.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 14-5-28. 6 | // Copyright (c) 2014年 itcast. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIScrollView (MJExtension) 12 | @property (assign, nonatomic) CGFloat mj_contentInsetTop; 13 | @property (assign, nonatomic) CGFloat mj_contentInsetBottom; 14 | @property (assign, nonatomic) CGFloat mj_contentInsetLeft; 15 | @property (assign, nonatomic) CGFloat mj_contentInsetRight; 16 | 17 | @property (assign, nonatomic) CGFloat mj_contentOffsetX; 18 | @property (assign, nonatomic) CGFloat mj_contentOffsetY; 19 | 20 | @property (assign, nonatomic) CGFloat mj_contentSizeWidth; 21 | @property (assign, nonatomic) CGFloat mj_contentSizeHeight; 22 | @end 23 | -------------------------------------------------------------------------------- /MBCLiveShow/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "size" : "60x60", 25 | "idiom" : "iphone", 26 | "filename" : "AppIcon60x60@2x.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "idiom" : "iphone", 31 | "size" : "60x60", 32 | "scale" : "3x" 33 | } 34 | ], 35 | "info" : { 36 | "version" : 1, 37 | "author" : "xcode" 38 | } 39 | } -------------------------------------------------------------------------------- /Classes/Tools/UIBarButtonItem+Item.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIBarButtonItem+Item.m 3 | // ThePeople 4 | // 5 | // Created by aoyolo on 16/4/12. 6 | // Copyright © 2016年 Ms.Gao. All rights reserved. 7 | // 8 | 9 | #import "UIBarButtonItem+Item.h" 10 | 11 | @implementation UIBarButtonItem (Item) 12 | + (UIBarButtonItem *)barButtonItemWithImage:(NSString *)image highImage:(NSString *)highImage target:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents 13 | { 14 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 15 | [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal]; 16 | [btn setBackgroundImage:[UIImage imageNamed:highImage] forState:UIControlStateHighlighted]; 17 | [btn sizeToFit]; 18 | [btn addTarget:target action:action forControlEvents:controlEvents]; 19 | return [[UIBarButtonItem alloc] initWithCustomView:btn]; 20 | } 21 | @end 22 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/MJRefreshConst.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshConst.m 3 | // MJRefresh 4 | // 5 | // Created by mj on 14-1-3. 6 | // Copyright (c) 2014年 itcast. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | const CGFloat MJRefreshViewHeight = 64.0; 12 | const CGFloat MJRefreshFastAnimationDuration = 0.25; 13 | const CGFloat MJRefreshSlowAnimationDuration = 0.4; 14 | 15 | NSString *const MJRefreshFooterPullToRefresh = @"上拉可以加载更多数据"; 16 | NSString *const MJRefreshFooterReleaseToRefresh = @"松开立即加载更多数据"; 17 | NSString *const MJRefreshFooterRefreshing = @"正在加载数据..."; 18 | 19 | NSString *const MJRefreshHeaderPullToRefresh = @"下拉可以刷新"; 20 | NSString *const MJRefreshHeaderReleaseToRefresh = @"松开立即刷新"; 21 | NSString *const MJRefreshHeaderRefreshing = @"正在刷新..."; 22 | NSString *const MJRefreshHeaderTimeKey = @"MJRefreshHeaderView"; 23 | 24 | NSString *const MJRefreshContentOffset = @"contentOffset"; 25 | NSString *const MJRefreshContentSize = @"contentSize"; -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 代码地址: https://github.com/CoderMJLee/MJRefresh 3 | * 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 4 | * 友情提示: 遇到一些小问题, 最好及时下载最新的代码试试 5 | */ 6 | 7 | #import "UIScrollView+MJRefresh.h" 8 | 9 | /** 10 | MJ友情提示: 11 | 1. 添加头部控件的方法 12 | [self.tableView addHeaderWithTarget:self action:@selector(headerRereshing)]; 13 | 或者 14 | [self.tableView addHeaderWithCallback:^{ }]; 15 | 16 | 2. 添加尾部控件的方法 17 | [self.tableView addFooterWithTarget:self action:@selector(footerRereshing)]; 18 | 或者 19 | [self.tableView addFooterWithCallback:^{ }]; 20 | 21 | 3. 可以在MJRefreshConst.h和MJRefreshConst.m文件中自定义显示的文字内容和文字颜色 22 | 23 | 4. 本框架兼容iOS6\iOS7,iPhone\iPad横竖屏 24 | 25 | 5.自动进入刷新状态 26 | 1> [self.tableView headerBeginRefreshing]; 27 | 2> [self.tableView footerBeginRefreshing]; 28 | 29 | 6.结束刷新 30 | 1> [self.tableView headerEndRefreshing]; 31 | 2> [self.tableView footerEndRefreshing]; 32 | */ -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–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 | -------------------------------------------------------------------------------- /Classes/Main/Controller/MBCNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCNavigationController.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCNavigationController.h" 10 | #import "UIBarButtonItem+Item.h" 11 | @interface MBCNavigationController () 12 | 13 | @end 14 | 15 | @implementation MBCNavigationController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | -(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated 28 | { 29 | 30 | viewController.navigationItem.rightBarButtonItem = [UIBarButtonItem barButtonItemWithImage:@"Search" highImage:@"Search_selected" target:self action:@selector(pop) forControlEvents:UIControlEventTouchUpInside]; 31 | 32 | 33 | [super pushViewController:viewController animated:animated]; 34 | } 35 | 36 | -(void)pop 37 | { 38 | [super popViewControllerAnimated:YES]; 39 | } 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/DirectSeeding(直播)/View/MBCMoviewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCMoviewCell.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/3. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCMoviewCell.h" 10 | #import "MBCMovieModel.h" 11 | #import "UIImageView+WebCache.h" 12 | @interface MBCMoviewCell () 13 | //图像 14 | @property (weak, nonatomic) IBOutlet UIImageView *thumb; 15 | //头像 16 | @property (weak, nonatomic) IBOutlet UIImageView *avatar; 17 | //昵称 18 | @property (weak, nonatomic) IBOutlet UILabel *nick; 19 | //标题 20 | @property (weak, nonatomic) IBOutlet UILabel *title; 21 | 22 | @end 23 | @implementation MBCMoviewCell 24 | 25 | - (void)awakeFromNib { 26 | // Initialization code 27 | } 28 | 29 | -(void)setCellModel:(MBCMovieModel *)obj 30 | { 31 | self.backgroundColor = [UIColor whiteColor]; 32 | 33 | self.title.text =obj.title; 34 | self.nick.text = obj.nick; 35 | self.thumb.layer.cornerRadius = 8; 36 | self.thumb.layer.masksToBounds = YES; 37 | self.avatar.layer.cornerRadius = self.avatar.frame.size.width/2; 38 | self.avatar.layer.masksToBounds = YES; 39 | 40 | [self.thumb sd_setImageWithURL:[NSURL URLWithString:obj.thumb]]; 41 | 42 | if ([obj.avatar isEqualToString:@""]) { 43 | self.avatar.image = [UIImage imageNamed:@"nil"]; 44 | }else 45 | { 46 | [self.avatar sd_setImageWithURL:[NSURL URLWithString:obj.avatar]]; 47 | } 48 | } 49 | @end 50 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/MJRefreshConst.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshConst.h 3 | // MJRefresh 4 | // 5 | // Created by mj on 14-1-3. 6 | // Copyright (c) 2014年 itcast. All rights reserved. 7 | // 8 | #import 9 | 10 | #ifdef DEBUG 11 | #define MJLog(...) NSLog(__VA_ARGS__) 12 | #else 13 | #define MJLog(...) 14 | #endif 15 | 16 | // objc_msgSend 17 | #define msgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__) 18 | #define msgTarget(target) (__bridge void *)(target) 19 | 20 | #define MJColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0] 21 | // 文字颜色 22 | #define MJRefreshLabelTextColor MJColor(150, 150, 150) 23 | 24 | // 图片路径 25 | #define MJRefreshSrcName(file) [@"MJRefresh.bundle" stringByAppendingPathComponent:file] 26 | 27 | UIKIT_EXTERN const CGFloat MJRefreshViewHeight; 28 | UIKIT_EXTERN const CGFloat MJRefreshFastAnimationDuration; 29 | UIKIT_EXTERN const CGFloat MJRefreshSlowAnimationDuration; 30 | 31 | UIKIT_EXTERN NSString *const MJRefreshFooterPullToRefresh; 32 | UIKIT_EXTERN NSString *const MJRefreshFooterReleaseToRefresh; 33 | UIKIT_EXTERN NSString *const MJRefreshFooterRefreshing; 34 | 35 | UIKIT_EXTERN NSString *const MJRefreshHeaderPullToRefresh; 36 | UIKIT_EXTERN NSString *const MJRefreshHeaderReleaseToRefresh; 37 | UIKIT_EXTERN NSString *const MJRefreshHeaderRefreshing; 38 | UIKIT_EXTERN NSString *const MJRefreshHeaderTimeKey; 39 | 40 | UIKIT_EXTERN NSString *const MJRefreshContentOffset; 41 | extern NSString *const MJRefreshContentSize; -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Classes/PlayMovie(直播界面)/View/MBCTransverseNav.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCTransverseNav.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCTransverseNav.h" 10 | #import "UIButton+Button.h" 11 | @implementation MBCTransverseNav 12 | { 13 | //返回按钮 14 | UIButton *_backBtn; 15 | 16 | //横屏状态时的按钮 17 | UIButton *_definitionBtn; 18 | } 19 | 20 | -(instancetype)initWithFrame:(CGRect)frame 21 | { 22 | if (self= [super initWithFrame:frame]) { 23 | 24 | _backBtn =[UIButton ButtonWithRect:CGRectMake(5, 5, 30, 30) title:nil titleColor:nil Image:@"movie_back_s" HighlightedImage:nil clickAction:@selector(ONWillClick:) viewController:self contentEdgeInsets:UIEdgeInsetsZero tag:201]; 25 | //创建按钮 添加按钮 26 | [self addSubview:_backBtn]; 27 | 28 | 29 | _definitionBtn = [UIButton ButtonWithRect:CGRectMake(self.frame.size.width-50, 5, 30, 30) title:nil titleColor:nil Image:@"movie_setting" HighlightedImage:nil clickAction:@selector(ONWillClick:) viewController:self contentEdgeInsets:UIEdgeInsetsZero tag:201]; 30 | [self addSubview:_definitionBtn]; 31 | 32 | } 33 | 34 | return self; 35 | } 36 | //点击返回按钮 触发代理 37 | -(void)ONWillClick:(UIButton *)btn 38 | { 39 | 40 | if ([self.delegate respondsToSelector:@selector(TransverseNavWillDidOnclick:)]) { 41 | [self.delegate TransverseNavWillDidOnclick:btn.tag]; 42 | } 43 | } 44 | @end 45 | -------------------------------------------------------------------------------- /Classes/Tools/UIButton+Button.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Button.m 3 | // ThePeople 4 | // 5 | // Created by aoyolo on 16/4/14. 6 | // Copyright © 2016年 Ms.Gao. All rights reserved. 7 | // 8 | 9 | #import "UIButton+Button.h" 10 | 11 | @implementation UIButton (Button) 12 | 13 | +(UIButton *)ButtonWithRect:(CGRect)rect title:(NSString *)title 14 | titleColor:(UIColor *)color Image:(NSString *)image HighlightedImage:(NSString *)highlightedImage clickAction:(SEL)clickAction viewController:(id)viewController contentEdgeInsets:(UIEdgeInsets)contentEdgeInsets tag:(NSInteger)tag 15 | { 16 | 17 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 18 | button.frame = rect; 19 | [button setTitle:title forState:UIControlStateNormal]; 20 | [button setImage:[UIImage imageNamed:image] forState:UIControlStateNormal]; 21 | [button setImage:[UIImage imageNamed:highlightedImage] forState:UIControlStateHighlighted]; 22 | [button setTitleColor:color forState:UIControlStateNormal]; 23 | button.contentEdgeInsets=contentEdgeInsets; 24 | button.titleLabel.font = [UIFont systemFontOfSize:12]; 25 | button.backgroundColor = [UIColor blackColor]; 26 | if (clickAction) { 27 | [button addTarget:viewController 28 | action:clickAction 29 | forControlEvents:UIControlEventTouchUpInside]; 30 | } 31 | 32 | button.layer.cornerRadius = button.frame.size.width/2; 33 | button.layer.masksToBounds = YES; 34 | button.tag = tag; 35 | return button; 36 | } 37 | @end 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /Classes/Lib/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. at the end of the string, before a 3 to 4 extension length (only if key len is 8 or more @2x. + 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 | 40 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 41 | image = scaledImage; 42 | } 43 | return image; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/UIView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 14-5-28. 6 | // Copyright (c) 2014年 itcast. All rights reserved. 7 | // 8 | 9 | #import "UIView+MJExtension.h" 10 | 11 | @implementation UIView (MJExtension) 12 | - (void)setMj_x:(CGFloat)mj_x 13 | { 14 | CGRect frame = self.frame; 15 | frame.origin.x = mj_x; 16 | self.frame = frame; 17 | } 18 | 19 | - (CGFloat)mj_x 20 | { 21 | return self.frame.origin.x; 22 | } 23 | 24 | - (void)setMj_y:(CGFloat)mj_y 25 | { 26 | CGRect frame = self.frame; 27 | frame.origin.y = mj_y; 28 | self.frame = frame; 29 | } 30 | 31 | - (CGFloat)mj_y 32 | { 33 | return self.frame.origin.y; 34 | } 35 | 36 | - (void)setMj_width:(CGFloat)mj_width 37 | { 38 | CGRect frame = self.frame; 39 | frame.size.width = mj_width; 40 | self.frame = frame; 41 | } 42 | 43 | - (CGFloat)mj_width 44 | { 45 | return self.frame.size.width; 46 | } 47 | 48 | - (void)setMj_height:(CGFloat)mj_height 49 | { 50 | CGRect frame = self.frame; 51 | frame.size.height = mj_height; 52 | self.frame = frame; 53 | } 54 | 55 | - (CGFloat)mj_height 56 | { 57 | return self.frame.size.height; 58 | } 59 | 60 | - (void)setMj_size:(CGSize)mj_size 61 | { 62 | CGRect frame = self.frame; 63 | frame.size = mj_size; 64 | self.frame = frame; 65 | } 66 | 67 | - (CGSize)mj_size 68 | { 69 | return self.frame.size; 70 | } 71 | 72 | - (void)setMj_origin:(CGPoint)mj_origin 73 | { 74 | CGRect frame = self.frame; 75 | frame.origin = mj_origin; 76 | self.frame = frame; 77 | } 78 | 79 | - (CGPoint)mj_origin 80 | { 81 | return self.frame.origin; 82 | } 83 | @end 84 | -------------------------------------------------------------------------------- /MBCLiveShow/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 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | NSAppTransportSecurity 45 | 46 | NSAllowsArbitraryLoads 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /MBCLiveShow/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 | -------------------------------------------------------------------------------- /Classes/PlayMovie(直播界面)/View/MBCVertivalNav.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCVertivalNav.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCVertivalNav.h" 10 | #import "UIButton+Button.h" 11 | @implementation MBCVertivalNav 12 | { 13 | //满屏 14 | UIButton *_fullScreenBtn; 15 | UIButton *_backBtn; 16 | BOOL _staraView; 17 | } 18 | 19 | -(instancetype)initWithFrame:(CGRect)frame 20 | { 21 | if (self = [super initWithFrame:frame]) { 22 | _backBtn = [UIButton ButtonWithRect:CGRectMake(5, 5, 30, 30) title:nil titleColor:nil Image:@"movie_back_s" HighlightedImage:nil clickAction:@selector(Onclick:) viewController:self contentEdgeInsets:UIEdgeInsetsZero tag:101]; 23 | [self addSubview:_backBtn]; 24 | 25 | _fullScreenBtn = [UIButton ButtonWithRect:CGRectMake(self.frame.size.width-35, self.frame.size.height-35, 30, 30) title:nil titleColor:nil Image:@"movie_fullscreen" HighlightedImage:nil clickAction:@selector(Onclick:) viewController:self contentEdgeInsets:UIEdgeInsetsZero tag:102]; 26 | 27 | [self addSubview:_fullScreenBtn]; 28 | _staraView = NO; 29 | } 30 | return self; 31 | } 32 | 33 | -(void)Onclick:(UIButton *)btn 34 | { 35 | if ([self.delegate respondsToSelector:@selector(didWillVerticalNavOnclick:)]) { 36 | [self.delegate didWillVerticalNavOnclick:btn.tag]; 37 | } 38 | } 39 | 40 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 41 | { 42 | if (_staraView==NO) { 43 | _backBtn.hidden = YES; 44 | _fullScreenBtn.hidden = YES; 45 | _staraView= YES; 46 | }else{ 47 | _backBtn.hidden = NO; 48 | _fullScreenBtn.hidden= NO; 49 | _staraView = NO; 50 | } 51 | } 52 | @end 53 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 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 | #if TARGET_OS_IOS 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #import "AFNetworkActivityIndicatorManager.h" 30 | 31 | #import "UIActivityIndicatorView+AFNetworking.h" 32 | #import "UIAlertView+AFNetworking.h" 33 | #import "UIButton+AFNetworking.h" 34 | #import "UIImageView+AFNetworking.h" 35 | #import "UIProgressView+AFNetworking.h" 36 | #import "UIRefreshControl+AFNetworking.h" 37 | #import "UIWebView+AFNetworking.h" 38 | #endif /* _UIKIT_AFNETWORKING_ */ 39 | #endif 40 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/View/MBCListClassCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCListClassCell.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 圆圈列表 8 | 9 | #import "MBCListClassCell.h" 10 | #import "MBCListClassModel.h" 11 | #import "UIImageView+WebCache.h" 12 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 13 | @implementation MBCListClassCell 14 | 15 | -(instancetype)initWithFrame:(CGRect)frame 16 | { 17 | if (self = [super initWithFrame:frame]) { 18 | 19 | } 20 | return self; 21 | } 22 | -(void)setCellModel:(NSArray *)obj 23 | { 24 | //创建 Scroll 25 | UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, self.frame.size.height)]; 26 | [self addSubview:scrollView]; 27 | scrollView.showsHorizontalScrollIndicator = NO; 28 | scrollView.bounces = NO; 29 | 30 | for (NSInteger i =0; i 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 | #define dispatch_main_sync_safe(block)\ 59 | if ([NSThread isMainThread]) {\ 60 | block();\ 61 | } else {\ 62 | dispatch_sync(dispatch_get_main_queue(), block);\ 63 | } 64 | 65 | #define dispatch_main_async_safe(block)\ 66 | if ([NSThread isMainThread]) {\ 67 | block();\ 68 | } else {\ 69 | dispatch_async(dispatch_get_main_queue(), block);\ 70 | } 71 | -------------------------------------------------------------------------------- /Classes/Lib/CycleScrollView/CycleScrollView.h: -------------------------------------------------------------------------------- 1 | //NSMutableArray *viewsArray = [@[] mutableCopy]; 2 | //for (int i = 0; i<_array.count; i++) { 3 | // UIImageView *imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, screenW,self.frame.size.height )]; 4 | // [imgView sd_setImageWithURL:[NSURL URLWithString:_array[i][@"theme_image"]]]; 5 | // [viewsArray addObject:imgView]; 6 | //} 7 | //self.mainScorllView = [[CycleScrollView alloc]initWithFrame:CGRectMake(0, 0, screenW, self.frame.size.height) animationDuration:2.0 Count:viewsArray.count]; 8 | //self.mainScorllView.fetchContentViewAtIndex = ^UIView *(NSInteger pageIndex){ 9 | // return viewsArray[pageIndex]; 10 | //}; 11 | // 12 | //self.mainScorllView.totalPagesCount = ^NSInteger(void){ 13 | // return viewsArray.count; 14 | //}; 15 | // 16 | //self.mainScorllView.TapActionBlock = ^(NSInteger pageIndex){ 17 | // 18 | // // RoomDetailController *rvc = [[RoomDetailController alloc]initWithVideoId:((AdModel *) [array objectAtIndex:pageIndex]).room.videoId]; 19 | // // [self.viewController.navigationController pushViewController:rvc animated:YES]; 20 | // 21 | // // NSLog(@"点击了第%ld个",pageIndex); 22 | //}; 23 | //[self addSubview:self.mainScorllView]; 24 | //} 25 | 26 | #import 27 | 28 | @interface CycleScrollView : UIView 29 | 30 | @property (nonatomic , readonly) UIScrollView *scrollView; 31 | /** 32 | * 初始化 33 | * 34 | * @param frame frame 35 | * @param animationDuration 自动滚动的间隔时长。如果<=0,不自动滚动。 36 | * 37 | * @return instance 38 | */ 39 | - (id)initWithFrame:(CGRect)frame animationDuration:(NSTimeInterval)animationDuration Count:(NSInteger)count; 40 | 41 | /** 42 | 数据源:获取总的page个数 43 | **/ 44 | @property (nonatomic , copy) NSInteger (^totalPagesCount)(void); 45 | /** 46 | 数据源:获取第pageIndex个位置的contentView 47 | **/ 48 | @property (nonatomic , copy) UIView *(^fetchContentViewAtIndex)(NSInteger pageIndex); 49 | /** 50 | 当点击的时候,执行的block 51 | **/ 52 | @property (nonatomic , copy) void (^TapActionBlock)(NSInteger pageIndex); 53 | 54 | @end -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 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 24 | #import 25 | 26 | #ifndef _AFNETWORKING_ 27 | #define _AFNETWORKING_ 28 | 29 | #import "AFURLRequestSerialization.h" 30 | #import "AFURLResponseSerialization.h" 31 | #import "AFSecurityPolicy.h" 32 | #if !TARGET_OS_WATCH 33 | #import "AFNetworkReachabilityManager.h" 34 | #import "AFURLConnectionOperation.h" 35 | #import "AFHTTPRequestOperation.h" 36 | #import "AFHTTPRequestOperationManager.h" 37 | #endif 38 | 39 | #if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \ 40 | ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) || \ 41 | TARGET_OS_WATCH ) 42 | #import "AFURLSessionManager.h" 43 | #import "AFHTTPSessionManager.h" 44 | #endif 45 | 46 | #endif /* _AFNETWORKING_ */ 47 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/MJRefreshBaseView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBaseView.h 3 | // MJRefresh 4 | // 5 | // Created by mj on 13-3-4. 6 | // Copyright (c) 2013年 itcast. All rights reserved. 7 | 8 | #import 9 | 10 | @class MJRefreshBaseView; 11 | 12 | #pragma mark - 控件的刷新状态 13 | typedef enum { 14 | MJRefreshStatePulling = 1, // 松开就可以进行刷新的状态 15 | MJRefreshStateNormal = 2, // 普通状态 16 | MJRefreshStateRefreshing = 3, // 正在刷新中的状态 17 | MJRefreshStateWillRefreshing = 4 18 | } MJRefreshState; 19 | 20 | #pragma mark - 控件的类型 21 | typedef enum { 22 | MJRefreshViewTypeHeader = -1, // 头部控件 23 | MJRefreshViewTypeFooter = 1 // 尾部控件 24 | } MJRefreshViewType; 25 | 26 | /** 27 | 类的声明 28 | */ 29 | @interface MJRefreshBaseView : UIView 30 | #pragma mark - 父控件 31 | @property (nonatomic, weak, readonly) UIScrollView *scrollView; 32 | @property (nonatomic, assign, readonly) UIEdgeInsets scrollViewOriginalInset; 33 | 34 | #pragma mark - 内部的控件 35 | @property (nonatomic, weak, readonly) UILabel *statusLabel; 36 | @property (nonatomic, weak, readonly) UIImageView *arrowImage; 37 | @property (nonatomic, weak, readonly) UIActivityIndicatorView *activityView; 38 | 39 | #pragma mark - 回调 40 | /** 41 | * 开始进入刷新状态的监听器 42 | */ 43 | @property (weak, nonatomic) id beginRefreshingTaget; 44 | /** 45 | * 开始进入刷新状态的监听方法 46 | */ 47 | @property (assign, nonatomic) SEL beginRefreshingAction; 48 | /** 49 | * 开始进入刷新状态就会调用 50 | */ 51 | @property (nonatomic, copy) void (^beginRefreshingCallback)(); 52 | 53 | #pragma mark - 刷新相关 54 | /** 55 | * 是否正在刷新 56 | */ 57 | @property (nonatomic, readonly, getter=isRefreshing) BOOL refreshing; 58 | /** 59 | * 开始刷新 60 | */ 61 | - (void)beginRefreshing; 62 | /** 63 | * 结束刷新 64 | */ 65 | - (void)endRefreshing; 66 | 67 | #pragma mark - 交给子类去实现 和 调用 68 | @property (assign, nonatomic) MJRefreshState state; 69 | /** 处于刷新结束的状态 */ 70 | @property (readonly, getter=isEndingRefresh) BOOL endingRefresh; 71 | 72 | /** 73 | * 文字 74 | */ 75 | @property (copy, nonatomic) NSString *pullToRefreshText; 76 | @property (copy, nonatomic) NSString *releaseToRefreshText; 77 | @property (copy, nonatomic) NSString *refreshingText; 78 | @end -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/Lib/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 | config.output.colorspace = MODE_rgbA; 28 | config.options.use_threads = 1; 29 | 30 | // Decode the WebP image data into a RGBA value array. 31 | if (WebPDecode(data.bytes, data.length, &config) != VP8_STATUS_OK) { 32 | return nil; 33 | } 34 | 35 | int width = config.input.width; 36 | int height = config.input.height; 37 | if (config.options.use_scaling) { 38 | width = config.options.scaled_width; 39 | height = config.options.scaled_height; 40 | } 41 | 42 | // Construct a UIImage from the decoded RGBA value array. 43 | CGDataProviderRef provider = 44 | CGDataProviderCreateWithData(NULL, config.output.u.RGBA.rgba, config.output.u.RGBA.size, FreeImageData); 45 | CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); 46 | CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast; 47 | CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault; 48 | CGImageRef imageRef = CGImageCreate(width, height, 8, 32, 4 * width, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent); 49 | 50 | CGColorSpaceRelease(colorSpaceRef); 51 | CGDataProviderRelease(provider); 52 | 53 | UIImage *image = [[UIImage alloc] initWithCGImage:imageRef]; 54 | CGImageRelease(imageRef); 55 | 56 | return image; 57 | } 58 | 59 | @end 60 | 61 | #if !COCOAPODS 62 | // Functions to resolve some undefined symbols when using WebP and force_load flag 63 | void WebPInitPremultiplyNEON(void) {} 64 | void WebPInitUpsamplersNEON(void) {} 65 | void VP8DspInitNEON(void) {} 66 | #endif 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /Classes/Recommend(推荐)/View/MBCRecomScrollCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCRecomScrollCell.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCRecomScrollCell.h" 10 | #import "MBCRecomScrModel.h" 11 | #import "UIImageView+WebCache.h" 12 | #import "CycleScrollView.h" 13 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 14 | 15 | @interface MBCRecomScrollCell () 16 | //轮播图的第三方框架 17 | @property (nonatomic,retain)CycleScrollView *mainScrollView; 18 | @end 19 | @implementation MBCRecomScrollCell 20 | -(instancetype)initWithFrame:(CGRect)frame 21 | { 22 | if (self= [super initWithFrame:frame]) { 23 | 24 | } 25 | return self; 26 | } 27 | -(void)setCellModel:(NSArray *)obj 28 | { 29 | if (obj) { 30 | NSMutableArray *viewsArray = [@[] mutableCopy]; 31 | 32 | for (int i = 0; i 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 | @interface SDWebImageDownloaderOperation : NSOperation 14 | 15 | /** 16 | * The request used by the operation's connection. 17 | */ 18 | @property (strong, nonatomic, readonly) NSURLRequest *request; 19 | 20 | /** 21 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. 22 | * 23 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. 24 | */ 25 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage; 26 | 27 | /** 28 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 29 | * 30 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 31 | */ 32 | @property (nonatomic, strong) NSURLCredential *credential; 33 | 34 | /** 35 | * The SDWebImageDownloaderOptions for the receiver. 36 | */ 37 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 38 | 39 | /** 40 | * Initializes a `SDWebImageDownloaderOperation` object 41 | * 42 | * @see SDWebImageDownloaderOperation 43 | * 44 | * @param request the URL request 45 | * @param options downloader options 46 | * @param progressBlock the block executed when a new chunk of data arrives. 47 | * @note the progress block is executed on a background queue 48 | * @param completedBlock the block executed when the download is done. 49 | * @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 50 | * @param cancelBlock the block executed if the download (operation) is cancelled 51 | * 52 | * @return the initialized instance 53 | */ 54 | - (id)initWithRequest:(NSURLRequest *)request 55 | options:(SDWebImageDownloaderOptions)options 56 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 57 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock 58 | cancelled:(SDWebImageNoParamsBlock)cancelBlock; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/UIScrollView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+Extension.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 14-5-28. 6 | // Copyright (c) 2014年 itcast. All rights reserved. 7 | // 8 | 9 | #import "UIScrollView+MJExtension.h" 10 | 11 | @implementation UIScrollView (MJExtension) 12 | - (void)setMj_contentInsetTop:(CGFloat)mj_contentInsetTop 13 | { 14 | UIEdgeInsets inset = self.contentInset; 15 | inset.top = mj_contentInsetTop; 16 | self.contentInset = inset; 17 | } 18 | 19 | - (CGFloat)mj_contentInsetTop 20 | { 21 | return self.contentInset.top; 22 | } 23 | 24 | - (void)setMj_contentInsetBottom:(CGFloat)mj_contentInsetBottom 25 | { 26 | UIEdgeInsets inset = self.contentInset; 27 | inset.bottom = mj_contentInsetBottom; 28 | self.contentInset = inset; 29 | } 30 | 31 | - (CGFloat)mj_contentInsetBottom 32 | { 33 | return self.contentInset.bottom; 34 | } 35 | 36 | - (void)setMj_contentInsetLeft:(CGFloat)mj_contentInsetLeft 37 | { 38 | UIEdgeInsets inset = self.contentInset; 39 | inset.left = mj_contentInsetLeft; 40 | self.contentInset = inset; 41 | } 42 | 43 | - (CGFloat)mj_contentInsetLeft 44 | { 45 | return self.contentInset.left; 46 | } 47 | 48 | - (void)setMj_contentInsetRight:(CGFloat)mj_contentInsetRight 49 | { 50 | UIEdgeInsets inset = self.contentInset; 51 | inset.right = mj_contentInsetRight; 52 | self.contentInset = inset; 53 | } 54 | 55 | - (CGFloat)mj_contentInsetRight 56 | { 57 | return self.contentInset.right; 58 | } 59 | 60 | - (void)setMj_contentOffsetX:(CGFloat)mj_contentOffsetX 61 | { 62 | CGPoint offset = self.contentOffset; 63 | offset.x = mj_contentOffsetX; 64 | self.contentOffset = offset; 65 | } 66 | 67 | - (CGFloat)mj_contentOffsetX 68 | { 69 | return self.contentOffset.x; 70 | } 71 | 72 | - (void)setMj_contentOffsetY:(CGFloat)mj_contentOffsetY 73 | { 74 | CGPoint offset = self.contentOffset; 75 | offset.y = mj_contentOffsetY; 76 | self.contentOffset = offset; 77 | } 78 | 79 | - (CGFloat)mj_contentOffsetY 80 | { 81 | return self.contentOffset.y; 82 | } 83 | 84 | - (void)setMj_contentSizeWidth:(CGFloat)mj_contentSizeWidth 85 | { 86 | CGSize size = self.contentSize; 87 | size.width = mj_contentSizeWidth; 88 | self.contentSize = size; 89 | } 90 | 91 | - (CGFloat)mj_contentSizeWidth 92 | { 93 | return self.contentSize.width; 94 | } 95 | 96 | - (void)setMj_contentSizeHeight:(CGFloat)mj_contentSizeHeight 97 | { 98 | CGSize size = self.contentSize; 99 | size.height = mj_contentSizeHeight; 100 | self.contentSize = size; 101 | } 102 | 103 | - (CGFloat)mj_contentSizeHeight 104 | { 105 | return self.contentSize.height; 106 | } 107 | @end 108 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | @class AFURLConnectionOperation; 31 | 32 | /** 33 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a request operation or session task. 34 | */ 35 | @interface UIActivityIndicatorView (AFNetworking) 36 | 37 | ///---------------------------------- 38 | /// @name Animating for Session Tasks 39 | ///---------------------------------- 40 | 41 | /** 42 | Binds the animating state to the state of the specified task. 43 | 44 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 45 | */ 46 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 47 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 48 | #endif 49 | 50 | ///--------------------------------------- 51 | /// @name Animating for Request Operations 52 | ///--------------------------------------- 53 | 54 | /** 55 | Binds the animating state to the execution state of the specified operation. 56 | 57 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 58 | */ 59 | - (void)setAnimatingWithStateOfOperation:(nullable AFURLConnectionOperation *)operation; 60 | 61 | @end 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2014 AFNetworking (http://afnetworking.com) 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 24 | 25 | #import 26 | 27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | @class AFURLConnectionOperation; 34 | 35 | /** 36 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a request operation or session task. 37 | */ 38 | @interface UIRefreshControl (AFNetworking) 39 | 40 | ///----------------------------------- 41 | /// @name Refreshing for Session Tasks 42 | ///----------------------------------- 43 | 44 | /** 45 | Binds the refreshing state to the state of the specified task. 46 | 47 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 51 | #endif 52 | 53 | ///---------------------------------------- 54 | /// @name Refreshing for Request Operations 55 | ///---------------------------------------- 56 | 57 | /** 58 | Binds the refreshing state to the execution state of the specified operation. 59 | 60 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 61 | */ 62 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation; 63 | 64 | @end 65 | 66 | NS_ASSUME_NONNULL_END 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/Lib/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+MJRefresh.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 14-5-28. 6 | // Copyright (c) 2014年 itcast. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIScrollView (MJRefresh) 12 | #pragma mark - 下拉刷新 13 | /** 14 | * 添加一个下拉刷新头部控件 15 | * 16 | * @param callback 回调 17 | */ 18 | - (void)addHeaderWithCallback:(void (^)())callback; 19 | 20 | /** 21 | * 添加一个下拉刷新头部控件 22 | * 23 | * @param callback 回调 24 | * @param dateKey 刷新时间保存的key值 25 | */ 26 | - (void)addHeaderWithCallback:(void (^)())callback dateKey:(NSString*)dateKey; 27 | 28 | /** 29 | * 添加一个下拉刷新头部控件 30 | * 31 | * @param target 目标 32 | * @param action 回调方法 33 | */ 34 | - (void)addHeaderWithTarget:(id)target action:(SEL)action; 35 | 36 | /** 37 | * 添加一个下拉刷新头部控件 38 | * 39 | * @param target 目标 40 | * @param action 回调方法 41 | * @param dateKey 刷新时间保存的key值 42 | */ 43 | - (void)addHeaderWithTarget:(id)target action:(SEL)action dateKey:(NSString*)dateKey; 44 | 45 | /** 46 | * 移除下拉刷新头部控件 47 | */ 48 | - (void)removeHeader; 49 | 50 | /** 51 | * 主动让下拉刷新头部控件进入刷新状态 52 | */ 53 | - (void)headerBeginRefreshing; 54 | 55 | /** 56 | * 让下拉刷新头部控件停止刷新状态 57 | */ 58 | - (void)headerEndRefreshing; 59 | 60 | /** 61 | * 下拉刷新头部控件的可见性 62 | */ 63 | @property (nonatomic, assign, getter = isHeaderHidden) BOOL headerHidden; 64 | 65 | /** 66 | * 是否正在下拉刷新 67 | */ 68 | @property (nonatomic, assign, readonly, getter = isHeaderRefreshing) BOOL headerRefreshing; 69 | 70 | #pragma mark - 上拉刷新 71 | /** 72 | * 添加一个上拉刷新尾部控件 73 | * 74 | * @param callback 回调 75 | */ 76 | - (void)addFooterWithCallback:(void (^)())callback; 77 | 78 | /** 79 | * 添加一个上拉刷新尾部控件 80 | * 81 | * @param target 目标 82 | * @param action 回调方法 83 | */ 84 | - (void)addFooterWithTarget:(id)target action:(SEL)action; 85 | 86 | /** 87 | * 移除上拉刷新尾部控件 88 | */ 89 | - (void)removeFooter; 90 | 91 | /** 92 | * 主动让上拉刷新尾部控件进入刷新状态 93 | */ 94 | - (void)footerBeginRefreshing; 95 | 96 | /** 97 | * 让上拉刷新尾部控件停止刷新状态 98 | */ 99 | - (void)footerEndRefreshing; 100 | 101 | /** 102 | * 上拉刷新头部控件的可见性 103 | */ 104 | @property (nonatomic, assign, getter = isFooterHidden) BOOL footerHidden; 105 | 106 | /** 107 | * 是否正在上拉刷新 108 | */ 109 | @property (nonatomic, assign, readonly, getter = isFooterRefreshing) BOOL footerRefreshing; 110 | 111 | /** 112 | * 设置尾部控件的文字 113 | */ 114 | @property (copy, nonatomic) NSString *footerPullToRefreshText; // 默认:@"上拉可以加载更多数据" 115 | @property (copy, nonatomic) NSString *footerReleaseToRefreshText; // 默认:@"松开立即加载更多数据" 116 | @property (copy, nonatomic) NSString *footerRefreshingText; // 默认:@"MJ哥正在帮你加载数据..." 117 | 118 | /** 119 | * 设置头部控件的文字 120 | */ 121 | @property (copy, nonatomic) NSString *headerPullToRefreshText; // 默认:@"下拉可以刷新" 122 | @property (copy, nonatomic) NSString *headerReleaseToRefreshText; // 默认:@"松开立即刷新" 123 | @property (copy, nonatomic) NSString *headerRefreshingText; // 默认:@"MJ哥正在帮你刷新..." 124 | @end 125 | -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFURLConnectionOperation; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task or request operation. 36 | */ 37 | @interface UIProgressView (AFNetworking) 38 | 39 | ///------------------------------------ 40 | /// @name Setting Session Task Progress 41 | ///------------------------------------ 42 | 43 | /** 44 | Binds the progress to the upload progress of the specified session task. 45 | 46 | @param task The session task. 47 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 51 | animated:(BOOL)animated; 52 | #endif 53 | 54 | /** 55 | Binds the progress to the download progress of the specified session task. 56 | 57 | @param task The session task. 58 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 59 | */ 60 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 61 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 62 | animated:(BOOL)animated; 63 | #endif 64 | 65 | ///------------------------------------ 66 | /// @name Setting Session Task Progress 67 | ///------------------------------------ 68 | 69 | /** 70 | Binds the progress to the upload progress of the specified request operation. 71 | 72 | @param operation The request operation. 73 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 74 | */ 75 | - (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation 76 | animated:(BOOL)animated; 77 | 78 | /** 79 | Binds the progress to the download progress of the specified request operation. 80 | 81 | @param operation The request operation. 82 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 83 | */ 84 | - (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation 85 | animated:(BOOL)animated; 86 | 87 | @end 88 | 89 | NS_ASSUME_NONNULL_END 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /Classes/Lib/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 | @property (weak, nonatomic) id delegate; 62 | 63 | /** 64 | * Return the global image prefetcher instance. 65 | */ 66 | + (SDWebImagePrefetcher *)sharedImagePrefetcher; 67 | 68 | /** 69 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 70 | * currently one image is downloaded at a time, 71 | * and skips images for failed downloads and proceed to the next image in the list 72 | * 73 | * @param urls list of URLs to prefetch 74 | */ 75 | - (void)prefetchURLs:(NSArray *)urls; 76 | 77 | /** 78 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 79 | * currently one image is downloaded at a time, 80 | * and skips images for failed downloads and proceed to the next image in the list 81 | * 82 | * @param urls list of URLs to prefetch 83 | * @param progressBlock block to be called when progress updates; 84 | * first parameter is the number of completed (successful or not) requests, 85 | * second parameter is the total number of images originally requested to be prefetched 86 | * @param completionBlock block to be called when prefetching is completed 87 | * first param is the number of completed (successful or not) requests, 88 | * second parameter is the number of skipped requests 89 | */ 90 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; 91 | 92 | /** 93 | * Remove and cancel queued list 94 | */ 95 | - (void)cancelPrefetching; 96 | 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /Classes/Column(栏目)/View/MBCColumnCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | /** 33 | `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. 34 | 35 | You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: 36 | 37 | [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; 38 | 39 | By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. 40 | 41 | See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: 42 | http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 43 | */ 44 | NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") 45 | @interface AFNetworkActivityIndicatorManager : NSObject 46 | 47 | /** 48 | A Boolean value indicating whether the manager is enabled. 49 | 50 | If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. 51 | */ 52 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 53 | 54 | /** 55 | A Boolean value indicating whether the network activity indicator is currently displayed in the status bar. 56 | */ 57 | @property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible; 58 | 59 | /** 60 | Returns the shared network activity indicator manager object for the system. 61 | 62 | @return The systemwide network activity indicator manager. 63 | */ 64 | + (instancetype)sharedManager; 65 | 66 | /** 67 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. 68 | */ 69 | - (void)incrementActivityCount; 70 | 71 | /** 72 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. 73 | */ 74 | - (void)decrementActivityCount; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | // AFHTTPRequestOperation.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import "AFURLConnectionOperation.h" 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | /** 28 | `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. 29 | */ 30 | @interface AFHTTPRequestOperation : AFURLConnectionOperation 31 | 32 | ///------------------------------------------------ 33 | /// @name Getting HTTP URL Connection Information 34 | ///------------------------------------------------ 35 | 36 | /** 37 | The last HTTP response received by the operation's connection. 38 | */ 39 | @property (readonly, nonatomic, strong, nullable) NSHTTPURLResponse *response; 40 | 41 | /** 42 | Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an AFHTTPResponse serializer, which uses the raw data as its response object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed. 43 | 44 | @warning `responseSerializer` must not be `nil`. Setting a response serializer will clear out any cached value 45 | */ 46 | @property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; 47 | 48 | /** 49 | An object constructed by the `responseSerializer` from the response and response data. Returns `nil` unless the operation `isFinished`, has a `response`, and has `responseData` with non-zero content length. If an error occurs during serialization, `nil` will be returned, and the `error` property will be populated with the serialization error. 50 | */ 51 | @property (readonly, nonatomic, strong, nullable) id responseObject; 52 | 53 | ///----------------------------------------------------------- 54 | /// @name Setting Completion Block Success / Failure Callbacks 55 | ///----------------------------------------------------------- 56 | 57 | /** 58 | Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed. 59 | 60 | This method should be overridden in subclasses in order to specify the response object passed into the success block. 61 | 62 | @param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request. 63 | @param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request. 64 | */ 65 | - (void)setCompletionBlockWithSuccess:(nullable void (^)(AFHTTPRequestOperation *operation, id responseObject))success 66 | failure:(nullable void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; 67 | 68 | @end 69 | 70 | NS_ASSUME_NONNULL_END 71 | -------------------------------------------------------------------------------- /Classes/Column(栏目)/Controller/MBCColumnController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCColumnController.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCColumnController.h" 10 | #import "MJRefresh.h" 11 | #import "AFNetworking.h" 12 | 13 | #import "MBCColumnCell.h" 14 | #import "MBCColumnModel.h" 15 | //栏目url 16 | #define ColumnUrl @"http://www.quanmin.tv/json/categories/list.json?0330152804" 17 | 18 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 19 | @interface MBCColumnController () 20 | @property (nonatomic,strong)UICollectionView *collectionView; 21 | @property (nonatomic,strong)UICollectionViewFlowLayout *flowLayout; 22 | @property (nonatomic,strong)NSMutableArray *dataArr; 23 | @end 24 | 25 | @implementation MBCColumnController 26 | 27 | -(NSMutableArray *)dataArr 28 | { 29 | if (_dataArr==nil) { 30 | _dataArr = [[NSMutableArray alloc]init]; 31 | } 32 | return _dataArr; 33 | } 34 | - (void)viewDidLoad { 35 | [super viewDidLoad]; 36 | 37 | //创建UIControllerView 38 | [self createCollection]; 39 | 40 | //注册cell 41 | [self registerCell]; 42 | 43 | //解析网络数据 44 | [self httpRequest]; 45 | //添加下拉刷新控件 46 | [self.collectionView addHeaderWithTarget:self action:@selector(httpRequest)]; 47 | //自动下拉刷新 48 | [self.collectionView headerBeginRefreshing]; 49 | } 50 | 51 | #pragma mark 创建UIControllerView 52 | -(void)createCollection 53 | { 54 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc]init]; 55 | UICollectionView *collcetionView = [[UICollectionView alloc]initWithFrame:self.view.bounds collectionViewLayout:flowLayout]; 56 | 57 | self.flowLayout = flowLayout; 58 | self.collectionView = collcetionView; 59 | self.collectionView.delegate = self; 60 | self.collectionView.dataSource = self; 61 | [self.view addSubview:self.collectionView]; 62 | self.collectionView.backgroundColor = [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1]; 63 | self.collectionView.showsVerticalScrollIndicator = NO; 64 | } 65 | 66 | #pragma make -注册cell 67 | -(void)registerCell 68 | { 69 | [self.collectionView registerNib:[UINib nibWithNibName:@"MBCColumnCell" bundle:nil] forCellWithReuseIdentifier:@"MBCColumnCell"]; 70 | } 71 | 72 | #pragma mark -解析网络数据 73 | -(void)httpRequest 74 | { 75 | AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; 76 | 77 | [manager GET:ColumnUrl parameters:nil success:^(AFHTTPRequestOperation * _Nonnull operation, id _Nonnull responseObject) { 78 | 79 | if (self.dataArr.count) { 80 | [self.dataArr removeAllObjects]; 81 | } 82 | self.dataArr = [NSMutableArray array]; 83 | 84 | for (NSDictionary *dict in responseObject) { 85 | MBCColumnModel *model = [[MBCColumnModel alloc]init]; 86 | model.image = dict[@"image"]; 87 | model.name = dict[@"name"]; 88 | [self.dataArr addObject:model]; 89 | } 90 | [self.collectionView reloadData]; 91 | [self.collectionView headerEndRefreshing]; 92 | } failure:^(AFHTTPRequestOperation * _Nonnull operation, NSError * _Nonnull error) { 93 | NSLog(@"%@",error); 94 | }]; 95 | } 96 | 97 | #pragma mark 98 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView 99 | { 100 | return 1; 101 | } 102 | 103 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 104 | { 105 | return self.dataArr.count; 106 | } 107 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath 108 | { 109 | return CGSizeMake((ScreenWidth-20)/3, (ScreenWidth-20)/9*4+30); 110 | } 111 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 112 | { 113 | static NSString *cellID = @"MBCColumnCell"; 114 | MBCColumnCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellID forIndexPath:indexPath]; 115 | 116 | MBCColumnModel *model = self.dataArr[indexPath.row]; 117 | cell.column = model; 118 | return cell; 119 | 120 | } 121 | -(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section 122 | { 123 | return UIEdgeInsetsMake(5, 5, 5, 5); 124 | } 125 | 126 | -(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section 127 | { 128 | return 5;//间隔 为5 129 | } 130 | -(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section 131 | { 132 | return 5; 133 | } 134 | 135 | @end 136 | -------------------------------------------------------------------------------- /Classes/Lib/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 UIImageView *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 | -------------------------------------------------------------------------------- /Classes/Lib/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 MKAnnotationView *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 | -------------------------------------------------------------------------------- /Classes/Lib/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 forth 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 forth 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 forth 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 | -------------------------------------------------------------------------------- /Classes/Lib/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 | -------------------------------------------------------------------------------- /Classes/Lib/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) 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 | self.maxConcurrentDownloads = 3; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)setMaxConcurrentDownloads:(NSUInteger)maxConcurrentDownloads { 49 | self.manager.imageDownloader.maxConcurrentDownloads = maxConcurrentDownloads; 50 | } 51 | 52 | - (NSUInteger)maxConcurrentDownloads { 53 | return self.manager.imageDownloader.maxConcurrentDownloads; 54 | } 55 | 56 | - (void)startPrefetchingAtIndex:(NSUInteger)index { 57 | if (index >= self.prefetchURLs.count) return; 58 | self.requestedCount++; 59 | [self.manager downloadImageWithURL:self.prefetchURLs[index] options:self.options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 60 | if (!finished) return; 61 | self.finishedCount++; 62 | 63 | if (image) { 64 | if (self.progressBlock) { 65 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]); 66 | } 67 | NSLog(@"Prefetched %@ out of %@", @(self.finishedCount), @(self.prefetchURLs.count)); 68 | } 69 | else { 70 | if (self.progressBlock) { 71 | self.progressBlock(self.finishedCount,[self.prefetchURLs count]); 72 | } 73 | NSLog(@"Prefetched %@ out of %@ (Failed)", @(self.finishedCount), @(self.prefetchURLs.count)); 74 | 75 | // Add last failed 76 | self.skippedCount++; 77 | } 78 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didPrefetchURL:finishedCount:totalCount:)]) { 79 | [self.delegate imagePrefetcher:self 80 | didPrefetchURL:self.prefetchURLs[index] 81 | finishedCount:self.finishedCount 82 | totalCount:self.prefetchURLs.count 83 | ]; 84 | } 85 | 86 | if (self.prefetchURLs.count > self.requestedCount) { 87 | dispatch_async(dispatch_get_main_queue(), ^{ 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 | } 98 | }]; 99 | } 100 | 101 | - (void)reportStatus { 102 | NSUInteger total = [self.prefetchURLs count]; 103 | NSLog(@"Finished prefetching (%@ successful, %@ skipped, timeElasped %.2f)", @(total - self.skippedCount), @(self.skippedCount), CFAbsoluteTimeGetCurrent() - self.startedTime); 104 | if ([self.delegate respondsToSelector:@selector(imagePrefetcher:didFinishWithTotalCount:skippedCount:)]) { 105 | [self.delegate imagePrefetcher:self 106 | didFinishWithTotalCount:(total - self.skippedCount) 107 | skippedCount:self.skippedCount 108 | ]; 109 | } 110 | } 111 | 112 | - (void)prefetchURLs:(NSArray *)urls { 113 | [self prefetchURLs:urls progress:nil completed:nil]; 114 | } 115 | 116 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock { 117 | [self cancelPrefetching]; // Prevent duplicate prefetch request 118 | self.startedTime = CFAbsoluteTimeGetCurrent(); 119 | self.prefetchURLs = urls; 120 | self.completionBlock = completionBlock; 121 | self.progressBlock = progressBlock; 122 | 123 | // Starts prefetching from the very first image on the list with the max allowed concurrency 124 | NSUInteger listCount = self.prefetchURLs.count; 125 | for (NSUInteger i = 0; i < self.maxConcurrentDownloads && self.requestedCount < listCount; i++) { 126 | [self startPrefetchingAtIndex:i]; 127 | } 128 | } 129 | 130 | - (void)cancelPrefetching { 131 | self.prefetchURLs = nil; 132 | self.skippedCount = 0; 133 | self.requestedCount = 0; 134 | self.finishedCount = 0; 135 | [self.manager cancelAll]; 136 | } 137 | 138 | @end 139 | -------------------------------------------------------------------------------- /Classes/Other/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // QQ交流群: 475105305 8 | 9 | #import "AppDelegate.h" 10 | #import "MBCTabController.h" 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | 20 | self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; 21 | [self.window makeKeyAndVisible]; 22 | MBCTabController *tabBar = [[MBCTabController alloc]init]; 23 | self.window.rootViewController = tabBar; 24 | return YES; 25 | } 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application { 28 | 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application { 32 | 33 | } 34 | 35 | - (void)applicationWillEnterForeground:(UIApplication *)application { 36 | 37 | } 38 | 39 | - (void)applicationDidBecomeActive:(UIApplication *)application { 40 | 41 | } 42 | 43 | - (void)applicationWillTerminate:(UIApplication *)application { 44 | 45 | [self saveContext]; 46 | } 47 | 48 | #pragma mark - Core Data stack 49 | 50 | @synthesize managedObjectContext = _managedObjectContext; 51 | @synthesize managedObjectModel = _managedObjectModel; 52 | @synthesize persistentStoreCoordinator = _persistentStoreCoordinator; 53 | 54 | - (NSURL *)applicationDocumentsDirectory { 55 | // The directory the application uses to store the Core Data store file. This code uses a directory named "-20.MBCLiveShow" in the application's documents directory. 56 | return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; 57 | } 58 | 59 | - (NSManagedObjectModel *)managedObjectModel { 60 | // The managed object model for the application. It is a fatal error for the application not to be able to find and load its model. 61 | if (_managedObjectModel != nil) { 62 | return _managedObjectModel; 63 | } 64 | NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MBCLiveShow" withExtension:@"momd"]; 65 | _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; 66 | return _managedObjectModel; 67 | } 68 | 69 | - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { 70 | // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. 71 | if (_persistentStoreCoordinator != nil) { 72 | return _persistentStoreCoordinator; 73 | } 74 | 75 | // Create the coordinator and store 76 | 77 | _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; 78 | NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MBCLiveShow.sqlite"]; 79 | NSError *error = nil; 80 | NSString *failureReason = @"There was an error creating or loading the application's saved data."; 81 | if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { 82 | // Report any error we got. 83 | NSMutableDictionary *dict = [NSMutableDictionary dictionary]; 84 | dict[NSLocalizedDescriptionKey] = @"Failed to initialize the application's saved data"; 85 | dict[NSLocalizedFailureReasonErrorKey] = failureReason; 86 | dict[NSUnderlyingErrorKey] = error; 87 | error = [NSError errorWithDomain:@"YOUR_ERROR_DOMAIN" code:9999 userInfo:dict]; 88 | // Replace this with code to handle the error appropriately. 89 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 90 | NSLog(@"Unresolved error %@, %@", error, [error userInfo]); 91 | abort(); 92 | } 93 | 94 | return _persistentStoreCoordinator; 95 | } 96 | 97 | 98 | - (NSManagedObjectContext *)managedObjectContext { 99 | // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) 100 | if (_managedObjectContext != nil) { 101 | return _managedObjectContext; 102 | } 103 | 104 | NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; 105 | if (!coordinator) { 106 | return nil; 107 | } 108 | _managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; 109 | [_managedObjectContext setPersistentStoreCoordinator:coordinator]; 110 | return _managedObjectContext; 111 | } 112 | 113 | #pragma mark - Core Data Saving support 114 | 115 | - (void)saveContext { 116 | NSManagedObjectContext *managedObjectContext = self.managedObjectContext; 117 | if (managedObjectContext != nil) { 118 | NSError *error = nil; 119 | if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) { 120 | // Replace this implementation with code to handle the error appropriately. 121 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 122 | NSLog(@"Unresolved error %@, %@", error, [error userInfo]); 123 | abort(); 124 | } 125 | } 126 | } 127 | 128 | @end 129 | -------------------------------------------------------------------------------- /Classes/PlayMovie(直播界面)/Controller/MBCPlayViewCtr.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCPlayViewCtr.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/8/4. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCPlayViewCtr.h" 10 | #import 11 | #import "MBCPlayView.h" 12 | //横竖屏 13 | #import "MBCTransverseNav.h" 14 | #import "MBCVertivalNav.h" 15 | 16 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 17 | #define ScreenHeight [UIScreen mainScreen].bounds.size.height 18 | 19 | @interface MBCPlayViewCtr () 20 | { 21 | //直播需要传的uid 22 | NSString *_uid; 23 | //旋转动画 24 | CATransform3D myTransform; 25 | //横屏 26 | MBCTransverseNav *_transverseNav; 27 | //竖屏 28 | MBCVertivalNav *_verticalNav; 29 | 30 | } 31 | @property (nonatomic,strong)AVPlayer *player; 32 | //播放器 33 | @property (nonatomic,strong)MBCPlayView *playerView; 34 | // playerItem是管理资源的对象 35 | @property (nonatomic,strong)AVPlayerItem *playerItem; 36 | @end 37 | 38 | @implementation MBCPlayViewCtr 39 | 40 | -(instancetype)initWithVideoId:(NSString *)uid 41 | { 42 | self= [super init]; 43 | if (!self) return nil; 44 | 45 | _uid = uid; 46 | 47 | return self; 48 | } 49 | 50 | - (void)viewDidLoad { 51 | [super viewDidLoad]; 52 | 53 | self.view.backgroundColor = [UIColor whiteColor]; 54 | self.navigationController.navigationBarHidden = YES; 55 | 56 | //创建播放器 57 | [self createBasicConfig]; 58 | //竖屏 59 | [self createVerticalNav]; 60 | //横屏 61 | [self createTransverseNaV]; 62 | 63 | //播放视频 64 | [self playVideo]; 65 | } 66 | 67 | 68 | #pragma mark -横屏nav 69 | -(void)createTransverseNaV 70 | { 71 | //初始化横屏 72 | _transverseNav = [[MBCTransverseNav alloc]initWithFrame:CGRectMake(0, 0, ScreenHeight, ScreenWidth)]; 73 | //设置代理 74 | _transverseNav.delegate = self; 75 | [self.view addSubview:_transverseNav]; 76 | //旋转的角度 77 | CATransform3D transform = CATransform3DMakeRotation(M_PI/2, 0, 0, 1.0); 78 | _transverseNav.layer.transform = transform; 79 | _transverseNav.center = self.view.center; 80 | 81 | _transverseNav.hidden = YES; 82 | } 83 | 84 | #pragma mark -GGTransverseNaVDelegate 85 | -(void)TransverseNavWillDidOnclick:(NSInteger)tag 86 | { 87 | if (tag==201) { //退出全屏 88 | _playerView.frame = CGRectMake(0, 20, ScreenWidth*9/16, ScreenWidth); 89 | _transverseNav.hidden = YES; 90 | 91 | [UIView animateWithDuration:0.3 animations:^{ 92 | _playerView.layer.transform = myTransform; 93 | _verticalNav.alpha= 0; 94 | _playerView.center = CGPointMake(ScreenWidth/2, 20+ScreenWidth*9/32); 95 | } completion:^(BOOL finished) { 96 | _playerView.center = self.view.center; 97 | _verticalNav.alpha = 1; 98 | _verticalNav.hidden = NO; 99 | _playerView.center = CGPointMake(ScreenWidth/2, 20+ScreenWidth*9/32); 100 | [[UIApplication sharedApplication] setStatusBarHidden:NO]; 101 | }]; 102 | } 103 | } 104 | 105 | #pragma mark -竖屏nav 106 | -(void)createVerticalNav 107 | { 108 | _verticalNav = [[MBCVertivalNav alloc]initWithFrame:CGRectMake(0, 20, ScreenWidth, ScreenWidth*9/16)]; 109 | _verticalNav.delegate = self; 110 | [self.view addSubview:_verticalNav]; 111 | 112 | } 113 | 114 | #pragma mark -GGVerticalNavDelegate 115 | -(void)didWillVerticalNavOnclick:(NSInteger)tag 116 | { 117 | if (tag==101) {//返回 118 | [self.navigationController popToRootViewControllerAnimated:YES]; 119 | self.navigationController.navigationBarHidden = NO; 120 | }else if (tag==102)//进入全屏 121 | { 122 | [[UIApplication sharedApplication]setStatusBarHidden:YES]; 123 | //让宽度变成屏幕的高度 高度变成屏幕的宽度 124 | _playerView.frame = CGRectMake(0, 0, ScreenHeight, ScreenWidth); 125 | _verticalNav.hidden = YES; 126 | 127 | [UIView animateWithDuration:0.3 animations:^{ 128 | CATransform3D transform = CATransform3DMakeRotation(M_PI/2, 0, 0, 1.0); 129 | _playerView.layer.transform = transform; 130 | _playerView.center = self.view.center; 131 | _transverseNav.alpha = 0; 132 | } completion:^(BOOL finished) { 133 | _playerView.center = self.view.center; 134 | _transverseNav.alpha = 1; 135 | _transverseNav.hidden = NO; 136 | }]; 137 | } 138 | } 139 | #pragma mark -添加播放器 140 | -(void)createBasicConfig 141 | { 142 | //初始化控制器 143 | _playerView = [[MBCPlayView alloc]initWithFrame:CGRectMake(0, 20, ScreenWidth, ScreenWidth*9/16)]; 144 | //给旋转动画赋值 145 | myTransform = _playerView.layer.transform; 146 | 147 | [self.view addSubview:_playerView]; 148 | } 149 | 150 | #pragma mark -调入播放网址 151 | -(void)playVideo 152 | { 153 | //根据不同的vid播放不同的视频 154 | NSMutableString *filePath = [[NSMutableString alloc]initWithString:[NSString stringWithFormat:@"http://hls.quanmin.tv/live/%@/playlist.m3u8",_uid]]; 155 | 156 | //中文编码 157 | NSString *str =[filePath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 158 | //URL地址 159 | NSURL *videoUrl = [NSURL URLWithString:str]; 160 | 161 | self.playerItem =[AVPlayerItem playerItemWithURL:videoUrl]; 162 | self.player = [AVPlayer playerWithPlayerItem:self.playerItem]; 163 | self.playerView.player = _player; 164 | [self.playerView.player play]; 165 | 166 | } 167 | 168 | -(void)dealloc 169 | { 170 | NSLog(@"释放"); 171 | } 172 | 173 | - (void)didReceiveMemoryWarning { 174 | [super didReceiveMemoryWarning]; 175 | // Dispose of any resources that can be recreated. 176 | 177 | } 178 | @end 179 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | // AFSecurityPolicy.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import 24 | 25 | typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { 26 | AFSSLPinningModeNone, 27 | AFSSLPinningModePublicKey, 28 | AFSSLPinningModeCertificate, 29 | }; 30 | 31 | /** 32 | `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. 33 | 34 | Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. 35 | */ 36 | 37 | NS_ASSUME_NONNULL_BEGIN 38 | 39 | @interface AFSecurityPolicy : NSObject 40 | 41 | /** 42 | The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. 43 | */ 44 | @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; 45 | 46 | /** 47 | The certificates used to evaluate server trust according to the SSL pinning mode. By default, this property is set to any (`.cer`) certificates included in the app bundle. Note that if you create an array with duplicate certificates, the duplicate certificates will be removed. Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. 48 | */ 49 | @property (nonatomic, strong, nullable) NSArray *pinnedCertificates; 50 | 51 | /** 52 | Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. 53 | */ 54 | @property (nonatomic, assign) BOOL allowInvalidCertificates; 55 | 56 | /** 57 | Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. 58 | */ 59 | @property (nonatomic, assign) BOOL validatesDomainName; 60 | 61 | ///----------------------------------------- 62 | /// @name Getting Specific Security Policies 63 | ///----------------------------------------- 64 | 65 | /** 66 | Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys. 67 | 68 | @return The default security policy. 69 | */ 70 | + (instancetype)defaultPolicy; 71 | 72 | ///--------------------- 73 | /// @name Initialization 74 | ///--------------------- 75 | 76 | /** 77 | Creates and returns a security policy with the specified pinning mode. 78 | 79 | @param pinningMode The SSL pinning mode. 80 | 81 | @return A new security policy. 82 | */ 83 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; 84 | 85 | ///------------------------------ 86 | /// @name Evaluating Server Trust 87 | ///------------------------------ 88 | 89 | /** 90 | Whether or not the specified server trust should be accepted, based on the security policy. 91 | 92 | This method should be used when responding to an authentication challenge from a server. 93 | 94 | @param serverTrust The X.509 certificate trust of the server. 95 | 96 | @return Whether or not to trust the server. 97 | 98 | @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`. 99 | */ 100 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE; 101 | 102 | /** 103 | Whether or not the specified server trust should be accepted, based on the security policy. 104 | 105 | This method should be used when responding to an authentication challenge from a server. 106 | 107 | @param serverTrust The X.509 certificate trust of the server. 108 | @param domain The domain of serverTrust. If `nil`, the domain will not be validated. 109 | 110 | @return Whether or not to trust the server. 111 | */ 112 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust 113 | forDomain:(nullable NSString *)domain; 114 | 115 | @end 116 | 117 | NS_ASSUME_NONNULL_END 118 | 119 | ///---------------- 120 | /// @name Constants 121 | ///---------------- 122 | 123 | /** 124 | ## SSL Pinning Modes 125 | 126 | The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. 127 | 128 | enum { 129 | AFSSLPinningModeNone, 130 | AFSSLPinningModePublicKey, 131 | AFSSLPinningModeCertificate, 132 | } 133 | 134 | `AFSSLPinningModeNone` 135 | Do not used pinned certificates to validate servers. 136 | 137 | `AFSSLPinningModePublicKey` 138 | Validate host certificates against public keys of pinned certificates. 139 | 140 | `AFSSLPinningModeCertificate` 141 | Validate host certificates against pinned certificates. 142 | */ 143 | -------------------------------------------------------------------------------- /Classes/DirectSeeding(直播)/Controller/MBCDirectSeedController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MBCDirectSeedController.m 3 | // iCocosCollection 4 | // 5 | // Created by iCocos on 16/7/31. 6 | // Copyright © 2016年 iCocos-Collection All rights reserved. 7 | // 8 | 9 | #import "MBCDirectSeedController.h" 10 | #import "MBCPlayViewCtr.h" 11 | #import "AFNetworking.h" 12 | #import "MJRefresh.h" 13 | #import "MBCMoviewCell.h" 14 | 15 | #import "MBCMovieModel.h" 16 | //直播url 17 | #define DirectSeedingUrl @"http://www.quanmin.tv/json/play/list.json?0330152923" 18 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 19 | @interface MBCDirectSeedController () 20 | @property (nonatomic,strong)UICollectionView *collcetionView; 21 | @property (nonatomic,strong)UICollectionViewFlowLayout *flowLayout; 22 | //所有的数据 23 | @property (nonatomic,strong)NSMutableArray *dataArr; 24 | @end 25 | 26 | @implementation MBCDirectSeedController 27 | 28 | -(NSMutableArray *)dataArr 29 | { 30 | if (_dataArr==nil) { 31 | _dataArr = [[NSMutableArray alloc]init]; 32 | } 33 | return _dataArr; 34 | } 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | // Do any additional setup after loading the view. 38 | 39 | //创建collctionView 40 | [self creactCollectionView]; 41 | //注册cell 42 | [self registerCell]; 43 | //解析网络数据 44 | [self httpReuest]; 45 | 46 | //添加下拉刷新控件 47 | [self.collcetionView addHeaderWithTarget:self action:@selector(httpReuest)]; 48 | //自动下拉刷新 49 | [self.collcetionView headerBeginRefreshing]; 50 | 51 | } 52 | 53 | #pragma mark 创建UIControllerView 54 | -(void)creactCollectionView 55 | { 56 | UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc]init]; 57 | UICollectionView *collctionView = [[UICollectionView alloc]initWithFrame:self.view.bounds collectionViewLayout:flowLayout]; 58 | self.flowLayout = flowLayout; 59 | self.collcetionView = collctionView; 60 | self.collcetionView.delegate = self; 61 | self.collcetionView.dataSource = self; 62 | [self.view addSubview:self.collcetionView]; 63 | self.collcetionView.backgroundColor = [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1]; 64 | self.collcetionView.showsVerticalScrollIndicator = NO; 65 | 66 | } 67 | 68 | #pragma make -注册cell 69 | -(void)registerCell 70 | { 71 | [self.collcetionView registerNib:[UINib nibWithNibName:@"MBCMoviewCell" bundle:nil] forCellWithReuseIdentifier:@"Cell"]; 72 | } 73 | 74 | #pragma mark -解析网络数据 75 | -(void)httpReuest 76 | { 77 | AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; 78 | [manager GET:DirectSeedingUrl parameters:nil success:^(AFHTTPRequestOperation * _Nonnull operation, id _Nonnull responseObject) { 79 | if (self.dataArr.count) { //请求有值 80 | [self.dataArr removeAllObjects]; //清空数组 81 | } 82 | for (NSDictionary *dict in responseObject[@"data"]) { 83 | //让下拉刷新头部控件停止刷新状态 84 | [self.collcetionView headerEndRefreshing]; 85 | MBCMovieModel *liveM = [[MBCMovieModel alloc]init]; 86 | liveM.avatar = dict[@"avatar"]; 87 | liveM.thumb = dict[@"thumb"]; 88 | liveM.title =dict[@"title"]; 89 | liveM.nick = dict[@"nick"]; 90 | liveM.view = dict[@"view"]; 91 | liveM.uid = dict[@"uid"]; 92 | [self.dataArr addObject:liveM]; 93 | } 94 | //刷新collctionView 95 | [self.collcetionView reloadData]; 96 | } failure:^(AFHTTPRequestOperation * _Nonnull operation, NSError * _Nonnull error) { 97 | NSLog(@"%@",error); 98 | }]; 99 | } 100 | #pragma mark 101 | -(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView 102 | { 103 | return 1; //1组 104 | } 105 | -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 106 | { 107 | return self.dataArr.count; 108 | } 109 | 110 | -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath 111 | { 112 | return CGSizeMake((ScreenWidth-15)/2, (ScreenWidth-15)/2-10); 113 | } 114 | -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 115 | { 116 | static NSString *CellID = @"Cell"; 117 | MBCMoviewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellID forIndexPath:indexPath]; 118 | // [cell setCellModel:self.dataArr[indexPath.row]]; 119 | MBCMovieModel *model = self.dataArr[indexPath.row]; 120 | [cell setCellModel:model]; 121 | return cell; 122 | } 123 | -(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section 124 | { 125 | return UIEdgeInsetsMake(5, 5, 5, 5); 126 | 127 | } 128 | //间距 129 | -(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section 130 | { 131 | return 5; 132 | } 133 | //线条 134 | -(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section 135 | { 136 | return 5; 137 | } 138 | #pragma mark 139 | -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath 140 | { 141 | MBCMovieModel *model = self.dataArr[indexPath.row]; 142 | MBCPlayViewCtr *playCtl = [[MBCPlayViewCtr alloc]initWithVideoId:model.uid]; 143 | playCtl.hidesBottomBarWhenPushed = YES; 144 | [self.navigationController pushViewController:playCtl animated:NO]; 145 | 146 | } 147 | @end 148 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIAlertView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFURLConnectionOperation; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIAlertView` class. The methods in this category provide support for automatically showing an alert if a session task or request operation finishes with an error. Alert title and message are filled from the corresponding `localizedDescription` & `localizedRecoverySuggestion` or `localizedFailureReason` of the error. 36 | */ 37 | @interface UIAlertView (AFNetworking) 38 | 39 | ///------------------------------------- 40 | /// @name Showing Alert for Session Task 41 | ///------------------------------------- 42 | 43 | /** 44 | Shows an alert view with the error of the specified session task, if any. 45 | 46 | @param task The session task. 47 | @param delegate The alert view delegate. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 51 | delegate:(nullable id)delegate NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); 52 | #endif 53 | 54 | /** 55 | Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles. 56 | 57 | @param task The session task. 58 | @param delegate The alert view delegate. 59 | @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. 60 | @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. 61 | */ 62 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 63 | + (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task 64 | delegate:(nullable id)delegate 65 | cancelButtonTitle:(nullable NSString *)cancelButtonTitle 66 | otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); 67 | #endif 68 | 69 | ///------------------------------------------ 70 | /// @name Showing Alert for Request Operation 71 | ///------------------------------------------ 72 | 73 | /** 74 | Shows an alert view with the error of the specified request operation, if any. 75 | 76 | @param operation The request operation. 77 | @param delegate The alert view delegate. 78 | */ 79 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 80 | delegate:(nullable id)delegate NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); 81 | 82 | /** 83 | Shows an alert view with the error of the specified request operation, if any, with a custom cancel button title and other button titles. 84 | 85 | @param operation The request operation. 86 | @param delegate The alert view delegate. 87 | @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title. 88 | @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`. 89 | */ 90 | + (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation 91 | delegate:(nullable id)delegate 92 | cancelButtonTitle:(nullable NSString *)cancelButtonTitle 93 | otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extensions."); 94 | 95 | @end 96 | 97 | NS_ASSUME_NONNULL_END 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /Classes/Lib/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 forth 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 forth 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 forth 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 | -------------------------------------------------------------------------------- /Classes/Lib/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFHTTPRequestSerializer, AFHTTPResponseSerializer; 33 | @protocol AFURLRequestSerialization, AFURLResponseSerialization; 34 | 35 | /** 36 | This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. 37 | 38 | @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. 39 | */ 40 | @interface UIWebView (AFNetworking) 41 | 42 | /** 43 | The request serializer used to serialize requests made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPRequestSerializer`. 44 | */ 45 | @property (nonatomic, strong) AFHTTPRequestSerializer * requestSerializer; 46 | 47 | /** 48 | The response serializer used to serialize responses made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPResponseSerializer`. 49 | */ 50 | @property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; 51 | 52 | /** 53 | Asynchronously loads the specified request. 54 | 55 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 56 | @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread. 57 | @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. 58 | @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 59 | */ 60 | - (void)loadRequest:(NSURLRequest *)request 61 | progress:(nullable void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 62 | success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 63 | failure:(nullable void (^)(NSError *error))failure; 64 | 65 | /** 66 | Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. 67 | 68 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 69 | @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. 70 | @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. 71 | @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread. 72 | @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. 73 | @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 74 | */ 75 | - (void)loadRequest:(NSURLRequest *)request 76 | MIMEType:(nullable NSString *)MIMEType 77 | textEncodingName:(nullable NSString *)textEncodingName 78 | progress:(nullable void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress 79 | success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 80 | failure:(nullable void (^)(NSError *error))failure; 81 | 82 | @end 83 | 84 | NS_ASSUME_NONNULL_END 85 | 86 | #endif 87 | --------------------------------------------------------------------------------