├── README.md ├── .DS_Store ├── DouYuZB ├── .DS_Store ├── DouYuZB │ ├── .DS_Store │ ├── Classs │ │ ├── .DS_Store │ │ ├── Home │ │ │ ├── .DS_Store │ │ │ ├── Controller │ │ │ │ ├── .DS_Store │ │ │ │ ├── FunnyViewController.swift │ │ │ │ ├── AmuseViewController.swift │ │ │ │ ├── Home.storyboard │ │ │ │ ├── HomeViewController.swift │ │ │ │ └── GameViewController.swift │ │ │ ├── Model │ │ │ │ ├── GameModel.swift │ │ │ │ └── CycleModel.swift │ │ │ ├── ViewModel │ │ │ │ ├── FunnyViewModel.swift │ │ │ │ ├── GameViewModel.swift │ │ │ │ ├── AmuseViewModel.swift │ │ │ │ └── RecommendViewModel.swift │ │ │ └── View │ │ │ │ ├── CollectionViewGameCell.swift │ │ │ │ ├── CollectionHeaderView.swift │ │ │ │ ├── CollectionViewCycleCell.swift │ │ │ │ ├── AmuseMenuViewCell.swift │ │ │ │ ├── RecommendGameView.swift │ │ │ │ ├── AmuseMenuView.swift │ │ │ │ ├── RecommendGameView.xib │ │ │ │ ├── AmuseMenuViewCell.xib │ │ │ │ ├── RecommendCycleView.xib │ │ │ │ ├── AmuseMenuView.xib │ │ │ │ ├── RecommendCycleView.swift │ │ │ │ ├── CollectionViewCycleCell.xib │ │ │ │ ├── CollectionViewGameCell.xib │ │ │ │ └── CollectionHeaderView.xib │ │ ├── Main │ │ │ ├── .DS_Store │ │ │ ├── Controller │ │ │ │ ├── .DS_Store │ │ │ │ ├── MainViewController.swift │ │ │ │ ├── BaseViewController.swift │ │ │ │ ├── CustomNavigationController.swift │ │ │ │ └── BaseAnchorViewController.swift │ │ │ ├── View │ │ │ │ ├── CollectionViewBaseCell.swift │ │ │ │ ├── CollectionViewPrettyCell.swift │ │ │ │ └── CollectionViewNormalCell.swift │ │ │ ├── Model │ │ │ │ ├── BaseGameModel.swift │ │ │ │ ├── AnchorModel.swift │ │ │ │ └── AnchorGroup.swift │ │ │ └── ViewModel │ │ │ │ └── BaseViewModel.swift │ │ ├── Room │ │ │ ├── .DS_Store │ │ │ └── Controller │ │ │ │ ├── RoomShowViewController.swift │ │ │ │ └── RoomNormalViewController.swift │ │ ├── Tools │ │ │ ├── .DS_Store │ │ │ ├── Common.swift │ │ │ ├── Extension │ │ │ │ ├── NSDate-Extension.swift │ │ │ │ ├── UIColor-Extension.swift │ │ │ │ └── UIBarButtonItem-Extension.swift │ │ │ └── NetworkTools.swift │ │ ├── Follow │ │ │ └── Follow.storyboard │ │ └── Live │ │ │ └── Live.storyboard │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── Home │ │ │ ├── Contents.json │ │ │ ├── CollectionView │ │ │ │ ├── Contents.json │ │ │ │ ├── Image_online.imageset │ │ │ │ │ ├── Image_online.png │ │ │ │ │ ├── Image_online@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── Img_default.imageset │ │ │ │ │ ├── Img_default@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── ico_location.imageset │ │ │ │ │ ├── ico_location@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── home_header_hot.imageset │ │ │ │ │ ├── home_header_hot@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── home_header_phone.imageset │ │ │ │ │ ├── home_header_phone@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── home_header_normal.imageset │ │ │ │ │ ├── home_header_normal@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── home_live_cate_normal.imageset │ │ │ │ │ ├── home_live_cate_normal@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── live_cell_default_phone.imageset │ │ │ │ │ ├── live_cell_default_phone@2x.png │ │ │ │ │ └── Contents.json │ │ │ ├── NavigationBar │ │ │ │ ├── Contents.json │ │ │ │ ├── logo.imageset │ │ │ │ │ ├── logo@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── Image_scan.imageset │ │ │ │ │ ├── Image_scan@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── btn_search.imageset │ │ │ │ │ ├── btn_search@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── Image_scan_click.imageset │ │ │ │ │ ├── Image_scan_click@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── image_my_history.imageset │ │ │ │ │ ├── image_my_history@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── btn_search_clicked.imageset │ │ │ │ │ ├── btn_search_clicked@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── Image_my_history_click.imageset │ │ │ │ │ ├── Image_my_history_click@2x.png │ │ │ │ │ └── Contents.json │ │ │ ├── 推荐常用更多.imageset │ │ │ │ ├── 推荐常用更多@2x.png │ │ │ │ └── Contents.json │ │ │ ├── Img_orange.imageset │ │ │ │ ├── Img_orange.png │ │ │ │ ├── Img_orange@2x.png │ │ │ │ └── Contents.json │ │ │ ├── img_loading_1.imageset │ │ │ │ ├── img_loading_1@2x.png │ │ │ │ └── Contents.json │ │ │ └── img_loading_2.imageset │ │ │ │ ├── img_loading_2@2x.png │ │ │ │ └── Contents.json │ │ ├── tabbar │ │ │ ├── Contents.json │ │ │ ├── btn_home_normal.imageset │ │ │ │ ├── btn_home_normal@2x.png │ │ │ │ └── Contents.json │ │ │ ├── btn_live_normal.imageset │ │ │ │ ├── btn_live_normal@2x.png │ │ │ │ └── Contents.json │ │ │ ├── btn_user_normal.imageset │ │ │ │ ├── btn_user_normal@2x.png │ │ │ │ └── Contents.json │ │ │ ├── btn_column_normal.imageset │ │ │ │ ├── btn_column_normal@2x.png │ │ │ │ └── Contents.json │ │ │ ├── btn_home_selected.imageset │ │ │ │ ├── btn_home_selected@2x.png │ │ │ │ └── Contents.json │ │ │ ├── btn_live_selected.imageset │ │ │ │ ├── btn_live_selected@2x.png │ │ │ │ └── Contents.json │ │ │ ├── btn_user_selected.imageset │ │ │ │ ├── btn_user_selected@2x.png │ │ │ │ └── Contents.json │ │ │ └── btn_column_selected.imageset │ │ │ │ ├── btn_column_selected@2x.png │ │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── AppIcon57x57.png │ │ │ ├── AppIcon29x29@2x.png │ │ │ ├── AppIcon40x40@2x.png │ │ │ ├── AppIcon57x57@2x.png │ │ │ ├── AppIcon60x60@2x.png │ │ │ ├── AppIcon60x60@3x.png │ │ │ └── Contents.json │ │ └── Brand Assets.launchimage │ │ │ ├── LaunchImage-568h@2x.png │ │ │ ├── LaunchImage-700@2x.png │ │ │ ├── LaunchImage-800-667h@2x.png │ │ │ ├── LaunchImage-800-Portrait-736h@3x.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Info.plist │ └── Base.lproj │ │ ├── Main.storyboard │ │ ├── LaunchScreen.storyboard │ │ └── Profile.storyboard ├── Pods │ ├── Target Support Files │ │ ├── Alamofire │ │ │ ├── Alamofire-prefix.pch │ │ │ ├── Alamofire.modulemap │ │ │ ├── Alamofire-dummy.m │ │ │ ├── Alamofire-umbrella.h │ │ │ ├── Alamofire.xcconfig │ │ │ └── Info.plist │ │ ├── Pods-DouYuZB │ │ │ ├── Pods-DouYuZB.modulemap │ │ │ ├── Pods-DouYuZB-dummy.m │ │ │ ├── Pods-DouYuZB-umbrella.h │ │ │ ├── Pods-DouYuZB.debug.xcconfig │ │ │ ├── Pods-DouYuZB.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-DouYuZB-acknowledgements.markdown │ │ │ ├── Pods-DouYuZB-acknowledgements.plist │ │ │ ├── Pods-DouYuZB-frameworks.sh │ │ │ └── Pods-DouYuZB-resources.sh │ │ ├── Pods-DouYuZBTests │ │ │ ├── Pods-DouYuZBTests.modulemap │ │ │ ├── Pods-DouYuZBTests-dummy.m │ │ │ ├── Pods-DouYuZBTests-acknowledgements.markdown │ │ │ ├── Pods-DouYuZBTests-umbrella.h │ │ │ ├── Pods-DouYuZBTests.debug.xcconfig │ │ │ ├── Pods-DouYuZBTests.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-DouYuZBTests-acknowledgements.plist │ │ │ ├── Pods-DouYuZBTests-frameworks.sh │ │ │ └── Pods-DouYuZBTests-resources.sh │ │ └── Pods-DouYuZBUITests │ │ │ ├── Pods-DouYuZBUITests.modulemap │ │ │ ├── Pods-DouYuZBUITests-dummy.m │ │ │ ├── Pods-DouYuZBUITests-acknowledgements.markdown │ │ │ ├── Pods-DouYuZBUITests-umbrella.h │ │ │ ├── Pods-DouYuZBUITests.debug.xcconfig │ │ │ ├── Pods-DouYuZBUITests.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-DouYuZBUITests-acknowledgements.plist │ │ │ ├── Pods-DouYuZBUITests-frameworks.sh │ │ │ └── Pods-DouYuZBUITests-resources.sh │ ├── Manifest.lock │ └── Alamofire │ │ ├── LICENSE │ │ └── Source │ │ ├── DispatchQueue+Alamofire.swift │ │ ├── Notifications.swift │ │ └── Result.swift ├── DouYuZB.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── DouYuZB.xcworkspace │ └── contents.xcworkspacedata ├── Podfile.lock ├── Podfile ├── DouYuZBTests │ ├── Info.plist │ └── DouYuZBTests.swift └── DouYuZBUITests │ ├── Info.plist │ └── DouYuZBUITests.swift ├── LICENSE └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | # DouYuZB 2 | 根据coderwhy老师视频,模仿斗鱼TV,学习直播技术 3 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Classs/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Classs/Home/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Classs/Main/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Room/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Classs/Room/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Tools/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Classs/Tools/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/Controller/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Classs/Home/Controller/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/Controller/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Classs/Main/Controller/.DS_Store -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon57x57.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/推荐常用更多.imageset/推荐常用更多@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/推荐常用更多.imageset/推荐常用更多@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon57x57@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@3x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/Img_orange.imageset/Img_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/Img_orange.imageset/Img_orange.png -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Alamofire/Alamofire.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/Img_orange.imageset/Img_orange@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/Img_orange.imageset/Img_orange@2x.png -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Alamofire/Alamofire-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Alamofire : NSObject 3 | @end 4 | @implementation PodsDummy_Alamofire 5 | @end 6 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/logo.imageset/logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/logo.imageset/logo@2x.png -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/Pods-DouYuZB.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_DouYuZB { 2 | umbrella header "Pods-DouYuZB-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Brand Assets.launchimage/LaunchImage-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Brand Assets.launchimage/LaunchImage-568h@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Brand Assets.launchimage/LaunchImage-700@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Brand Assets.launchimage/LaunchImage-700@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/img_loading_1.imageset/img_loading_1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/img_loading_1.imageset/img_loading_1@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/img_loading_2.imageset/img_loading_2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/img_loading_2.imageset/img_loading_2@2x.png -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/Pods-DouYuZB-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_DouYuZB : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_DouYuZB 5 | @end 6 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Brand Assets.launchimage/LaunchImage-800-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Brand Assets.launchimage/LaunchImage-800-667h@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Image_scan.imageset/Image_scan@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Image_scan.imageset/Image_scan@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/btn_search.imageset/btn_search@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/btn_search.imageset/btn_search@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_home_normal.imageset/btn_home_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_home_normal.imageset/btn_home_normal@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_live_normal.imageset/btn_live_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_live_normal.imageset/btn_live_normal@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_user_normal.imageset/btn_user_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_user_normal.imageset/btn_user_normal@2x.png -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/Pods-DouYuZBTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_DouYuZBTests { 2 | umbrella header "Pods-DouYuZBTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/Image_online.imageset/Image_online.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/Image_online.imageset/Image_online.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_column_normal.imageset/btn_column_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_column_normal.imageset/btn_column_normal@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_home_selected.imageset/btn_home_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_home_selected.imageset/btn_home_selected@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_live_selected.imageset/btn_live_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_live_selected.imageset/btn_live_selected@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_user_selected.imageset/btn_user_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_user_selected.imageset/btn_user_selected@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Brand Assets.launchimage/LaunchImage-800-Portrait-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Brand Assets.launchimage/LaunchImage-800-Portrait-736h@3x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/Image_online.imageset/Image_online@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/Image_online.imageset/Image_online@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/Img_default.imageset/Img_default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/Img_default.imageset/Img_default@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/ico_location.imageset/ico_location@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/ico_location.imageset/ico_location@2x.png -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/Pods-DouYuZBTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_DouYuZBTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_DouYuZBTests 5 | @end 6 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/Pods-DouYuZBUITests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_DouYuZBUITests { 2 | umbrella header "Pods-DouYuZBUITests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_column_selected.imageset/btn_column_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_column_selected.imageset/btn_column_selected@2x.png -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/Pods-DouYuZBTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/Pods-DouYuZBUITests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_DouYuZBUITests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_DouYuZBUITests 5 | @end 6 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/Pods-DouYuZBUITests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_header_hot.imageset/home_header_hot@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_header_hot.imageset/home_header_hot@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Image_scan_click.imageset/Image_scan_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Image_scan_click.imageset/Image_scan_click@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/image_my_history.imageset/image_my_history@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/image_my_history.imageset/image_my_history@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_header_phone.imageset/home_header_phone@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_header_phone.imageset/home_header_phone@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_header_normal.imageset/home_header_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_header_normal.imageset/home_header_normal@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/btn_search_clicked.imageset/btn_search_clicked@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/btn_search_clicked.imageset/btn_search_clicked@2x.png -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double AlamofireVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/Pods-DouYuZB-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double Pods_DouYuZBVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char Pods_DouYuZBVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_live_cate_normal.imageset/home_live_cate_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_live_cate_normal.imageset/home_live_cate_normal@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Image_my_history_click.imageset/Image_my_history_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Image_my_history_click.imageset/Image_my_history_click@2x.png -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/live_cell_default_phone.imageset/live_cell_default_phone@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vsqweHCL/DouYuZB/HEAD/DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/live_cell_default_phone.imageset/live_cell_default_phone@2x.png -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/Pods-DouYuZBTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double Pods_DouYuZBTestsVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char Pods_DouYuZBTestsVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/Model/GameModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameModel.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/20. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class GameModel: BaseGameModel { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/Pods-DouYuZBUITests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double Pods_DouYuZBUITestsVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char Pods_DouYuZBUITestsVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/View/CollectionViewBaseCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewBaseCell.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/18. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CollectionViewBaseCell: UICollectionViewCell { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /DouYuZB/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.2.0) 3 | - Kingfisher (3.1.4) 4 | 5 | DEPENDENCIES: 6 | - Alamofire (~> 4.2.0) 7 | - Kingfisher (~> 3.1.1) 8 | 9 | SPEC CHECKSUMS: 10 | Alamofire: aa2e09d871c9160ac53c90e83c68064a94e3dfbe 11 | Kingfisher: 6c67e3e57f2d81a9cfdfa25052cd86f33ceac9bb 12 | 13 | PODFILE CHECKSUM: dc5c18b6b9d1ae32003f07c5872177c0ca089825 14 | 15 | COCOAPODS: 1.1.1 16 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (4.2.0) 3 | - Kingfisher (3.1.4) 4 | 5 | DEPENDENCIES: 6 | - Alamofire (~> 4.2.0) 7 | - Kingfisher (~> 3.1.1) 8 | 9 | SPEC CHECKSUMS: 10 | Alamofire: aa2e09d871c9160ac53c90e83c68064a94e3dfbe 11 | Kingfisher: 6c67e3e57f2d81a9cfdfa25052cd86f33ceac9bb 12 | 13 | PODFILE CHECKSUM: dc5c18b6b9d1ae32003f07c5872177c0ca089825 14 | 15 | COCOAPODS: 1.1.1 16 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Tools/Common.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Common.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 16/11/3. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | let kStatusBarH: CGFloat = 20 12 | let kNavigationBarH: CGFloat = 44 13 | let kTabBarH: CGFloat = 49 14 | 15 | let kScreenW = UIScreen.main.bounds.width 16 | let kScreenH = UIScreen.main.bounds.height 17 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/推荐常用更多.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "推荐常用更多@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "logo@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Room/Controller/RoomShowViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RoomShowViewController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/25. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class RoomShowViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | view.backgroundColor = UIColor.red 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/img_loading_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "img_loading_1@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/img_loading_2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "img_loading_2@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_home_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_home_normal@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_live_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_live_normal@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_user_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_user_normal@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/Img_default.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Img_default@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Image_scan.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Image_scan@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/btn_search.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_search@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_column_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_column_normal@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_home_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_home_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_live_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_live_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_user_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_user_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/ico_location.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ico_location@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/tabbar/btn_column_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_column_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_header_hot.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_header_hot@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Image_scan_click.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Image_scan_click@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/image_my_history.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "image_my_history@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_header_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_header_normal@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_header_phone.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_header_phone@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/btn_search_clicked.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_search_clicked@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Tools/Extension/NSDate-Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSDate-Extension.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/17. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension NSDate { 12 | class func getCurrentTime() -> String { 13 | let nowDate = NSDate() 14 | let interval = Int(nowDate.timeIntervalSince1970) 15 | 16 | return "\(interval)" 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/home_live_cate_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_live_cate_normal@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/live_cell_default_phone.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "live_cell_default_phone@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/Img_orange.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Img_orange.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Img_orange@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/NavigationBar/Image_my_history_click.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Image_my_history_click@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 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Home/CollectionView/Image_online.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Image_online.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Image_online@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /DouYuZB/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '9.0' 3 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 4 | use_frameworks! 5 | 6 | target 'DouYuZB' do 7 | pod 'Alamofire', '~> 4.2.0' 8 | pod ‘Kingfisher’, ‘~> 3.1.1’ 9 | 10 | # Pods for DouYuZB 11 | 12 | target 'DouYuZBTests' do 13 | inherit! :search_paths 14 | # Pods for testing 15 | end 16 | 17 | target 'DouYuZBUITests' do 18 | inherit! :search_paths 19 | # Pods for testing 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Alamofire/Alamofire.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Alamofire 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/ViewModel/FunnyViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FunnyViewModel.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/25. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class FunnyViewModel : BaseViewModel { 12 | 13 | } 14 | extension FunnyViewModel { 15 | func loadFunnyData(finishedCallBack : @escaping () -> ()) { 16 | loadAnchorData(isGroupData: false, URLString: "http://capi.douyucdn.cn/api/v1/getColumnRoom/3", parameters: ["limit" : 30, "offset" : 0], finishedCallback: finishedCallBack) 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 16/11/3. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | 19 | UITabBar.appearance().tintColor = UIColor.orange 20 | 21 | return true 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/Model/BaseGameModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseGameModel.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/20. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class BaseGameModel: NSObject { 12 | 13 | // MARK:- 定义属性 14 | var tag_name : String = "" 15 | var icon_url : String = "" 16 | 17 | // MARK:- 自定义构造函数 18 | init(dict : [String : Any]) { 19 | super.init() 20 | 21 | setValuesForKeys(dict) 22 | } 23 | 24 | override func setValue(_ value: Any?, forUndefinedKey key: String) { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/Pods-DouYuZBTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher/Kingfisher.framework/Headers" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/Pods-DouYuZBTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher/Kingfisher.framework/Headers" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/CollectionViewGameCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewGameCell.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/18. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CollectionViewGameCell: UICollectionViewCell { 12 | 13 | @IBOutlet weak var iconImageView: UIImageView! 14 | @IBOutlet weak var nameLabel: UILabel! 15 | 16 | var group : BaseGameModel? { 17 | didSet { 18 | nameLabel.text = group?.tag_name 19 | 20 | let iconURL = URL(string: group?.icon_url ?? "") 21 | iconImageView.kf.setImage(with: iconURL, placeholder: UIImage(named: "推荐常用更多")) 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/Pods-DouYuZBUITests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher/Kingfisher.framework/Headers" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/Pods-DouYuZBUITests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher/Kingfisher.framework/Headers" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Tools/Extension/UIColor-Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor-Extension.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 16/11/3. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIColor { 12 | // 遍历构造函数 最后调用的是self 13 | convenience init(r: CGFloat, g: CGFloat, b: CGFloat) { 14 | self.init(red: r / 255.0, green: g / 255.0, blue: b / 255.9, alpha: 1.0) 15 | } 16 | 17 | class func randomColor() -> UIColor { 18 | return UIColor(r: CGFloat(arc4random_uniform(256)), g: CGFloat(arc4random_uniform(256)), b: CGFloat(arc4random_uniform(256))) 19 | // return UIColor(red: CGFloat(arc4random_uniform(256)), green: CGFloat(arc4random_uniform(256)), blue: CGFloat(arc4random_uniform(256)), alpha: 1.0) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/Controller/MainViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 16/11/3. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class MainViewController: UITabBarController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | addChildVc("Home") 17 | addChildVc("Live") 18 | addChildVc("Follow") 19 | addChildVc("Profile") 20 | } 21 | 22 | fileprivate func addChildVc(_ storyName: String) { 23 | // 1.通过storyboard获取控制器 24 | let childVc = UIStoryboard(name: storyName, bundle: nil).instantiateInitialViewController()! 25 | 26 | // 2.将childVc作为子控制器 27 | addChildViewController(childVc) 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZBTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZBUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/Model/AnchorModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnchorModel.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/18. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class AnchorModel: NSObject { 12 | /// 房间ID 13 | var room_id : Int = 0 14 | /// 房间图片对应的URLString 15 | var vertical_src : String = "" 16 | /// 0:电脑直播 1:手机直播 17 | var isVertical : Int = 0 18 | /// 房间名称 19 | var room_name : String = "" 20 | /// 主播昵称 21 | var nickname : String = "" 22 | /// 观看人数 23 | var online : Int = 0 24 | 25 | /// 所在城市 26 | var anchor_city : String = "" 27 | 28 | 29 | init(dict : [String : NSObject]) { 30 | super.init() 31 | 32 | setValuesForKeys(dict) 33 | } 34 | override func setValue(_ value: Any?, forUndefinedKey key: String) { 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/Pods-DouYuZB.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher/Kingfisher.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "Kingfisher" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/Pods-DouYuZB.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Kingfisher/Kingfisher.framework/Headers" 7 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "Kingfisher" 8 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 9 | PODS_BUILD_DIR = $BUILD_DIR 10 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/Model/CycleModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CycleModel.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/18. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CycleModel: NSObject { 12 | // 标题 13 | var title : String = "" 14 | // 图片 15 | var tv_pic_url : String = "" 16 | // 主播信息对应的字典 17 | var room : [String : NSObject]?{ 18 | didSet { 19 | guard let room = room else { 20 | return 21 | } 22 | anchor = AnchorModel(dict: room) 23 | } 24 | } 25 | // 主播信息对应的模型对象 26 | var anchor : AnchorModel? 27 | 28 | 29 | // MARK:- 自定义构造函数 30 | init(dict : [String : NSObject]) { 31 | super.init() 32 | setValuesForKeys(dict) 33 | } 34 | override func setValue(_ value: Any?, forUndefinedKey key: String) { 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Alamofire/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 | FMWK 17 | CFBundleShortVersionString 18 | 4.2.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/Pods-DouYuZBTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/Pods-DouYuZBUITests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Tools/NetworkTools.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NetworkTools.swift 3 | // Alamofire测试版本 4 | // 5 | // Created by HCL黄 on 2016/12/6. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Alamofire 11 | 12 | enum MethodType { 13 | case GET 14 | case POST 15 | } 16 | 17 | // 删除继承,更加轻量级 18 | class NetworkTools { 19 | class func requestData(type: MethodType, urlString: String, parameters: [String: Any], finishedCallback: @escaping (_ result : AnyObject) -> ()) { 20 | // 1. 获取类型 21 | let method = type == .GET ? HTTPMethod.get : HTTPMethod.post 22 | 23 | Alamofire.request(urlString, method: method, parameters: parameters).responseJSON { (response) in 24 | guard let result = response.result.value else { 25 | print(response.result.error!) 26 | return 27 | } 28 | 29 | // 回调结果 30 | finishedCallback(result as AnyObject) 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/CollectionHeaderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionHeaderView.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 16/11/16. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CollectionHeaderView: UICollectionReusableView { 12 | 13 | // MARK:- 控件属性 14 | @IBOutlet weak var iconImageView: UIImageView! 15 | @IBOutlet weak var titleLabel: UILabel! 16 | @IBOutlet weak var moreBtn: UIButton! 17 | 18 | // MARK:- 定义模型属性 19 | var group : AnchorGroup? { 20 | didSet { 21 | titleLabel.text = group?.tag_name 22 | iconImageView.image = UIImage(named: group?.icon_name ?? "home_header_normal") 23 | } 24 | } 25 | 26 | } 27 | 28 | // MARK:- 从xib中快速创建的类方法 29 | extension CollectionHeaderView 30 | { 31 | class func collectionHeaderView() -> CollectionHeaderView { 32 | return Bundle.main.loadNibNamed("CollectionHeaderView", owner: nil, options: nil)?.first as! CollectionHeaderView 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/ViewModel/GameViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameViewModel.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/20. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class GameViewModel { 12 | lazy var games : [GameModel] = [GameModel]() 13 | } 14 | 15 | extension GameViewModel { 16 | func loadAllGameData(finishedCallBack : @escaping () -> ()) { 17 | NetworkTools.requestData(type: .GET, urlString: "http://capi.douyucdn.cn/api/v1/getColumnDetail", parameters: ["shortName" : "game"]) {(result) in 18 | 19 | // 1.获取到数据 20 | guard let resultDict = result as? [String : Any] else {return} 21 | guard let dataArray = resultDict["data"] as? [[String : Any]] else {return} 22 | 23 | // 2.字典转模型 24 | for dict in dataArray { 25 | self.games.append(GameModel(dict: dict)) 26 | } 27 | 28 | // 3.回调 29 | finishedCallBack() 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/CollectionViewCycleCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewCycleCell.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/18. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CollectionViewCycleCell: UICollectionViewCell { 12 | 13 | // MARK:- 控件属性 14 | @IBOutlet weak var iconImageView: UIImageView! 15 | @IBOutlet weak var titleLabel: UILabel! 16 | 17 | // MARK:- 定义模型数据 18 | var cycleModel : CycleModel? { 19 | didSet { 20 | titleLabel.text = cycleModel?.title 21 | 22 | // 传空字符串有能闪退 23 | // if let iconURL = URL(string: cycleModel?.tv_pic_url ?? "") { 24 | // iconImageView.kf.setImage(with: iconURL) 25 | // } 26 | // else { 27 | // iconImageView.image = UIImage(named: "Img_default") 28 | // } 29 | 30 | let iconURL = URL(string: cycleModel?.tv_pic_url ?? "") 31 | iconImageView.kf.setImage(with: iconURL, placeholder: UIImage(named: "Img_default")) 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZBTests/DouYuZBTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DouYuZBTests.swift 3 | // DouYuZBTests 4 | // 5 | // Created by HCL黄 on 16/11/3. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import DouYuZB 11 | 12 | class DouYuZBTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 vsqweHCL 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Room/Controller/RoomNormalViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RoomNormalViewController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/25. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class RoomNormalViewController: UIViewController, UIGestureRecognizerDelegate { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | view.backgroundColor = UIColor.orange 17 | } 18 | 19 | override func viewWillAppear(_ animated: Bool) { 20 | super.viewWillAppear(animated) 21 | 22 | // 隐藏导航栏 23 | navigationController?.setNavigationBarHidden(true, animated: true) 24 | // 25 | // // 依然保持手势 26 | // navigationController?.interactivePopGestureRecognizer?.delegate = self 27 | // navigationController?.interactivePopGestureRecognizer?.isEnabled = true 28 | } 29 | 30 | override func viewWillDisappear(_ animated: Bool) { 31 | super.viewWillDisappear(animated) 32 | 33 | navigationController?.setNavigationBarHidden(false, animated: true) 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/Model/AnchorGroup.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnchorGroup.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/17. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class AnchorGroup: BaseGameModel { 12 | /// 该组中对应的房间信息 13 | var room_list : [[String : NSObject]]? { 14 | didSet { // 第二种方法 15 | guard let room_list = room_list else {return} 16 | for dict in room_list { 17 | anchors.append(AnchorModel(dict: dict)) 18 | } 19 | } 20 | } 21 | 22 | /// 组显示的图标 23 | var icon_name : String = "home_header_normal" 24 | 25 | 26 | /// 定义主播的模型对象数组 27 | lazy var anchors : [AnchorModel] = [AnchorModel]() 28 | 29 | 30 | /* 31 | 第一种方法 32 | override func setValue(_ value: Any?, forKey key: String) { 33 | if key == "room_list" { 34 | if let dataArray = value as? [[String : NSObject]] { 35 | for dict in dataArray { 36 | anchors.append(AnchorModel(dict: dict)) 37 | } 38 | } 39 | } 40 | } 41 | */ 42 | } 43 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/Controller/FunnyViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FunnyViewController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/25. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let kTopMargin : CGFloat = 8 12 | 13 | class FunnyViewController: BaseAnchorViewController { 14 | fileprivate lazy var funnyVM : FunnyViewModel = FunnyViewModel() 15 | 16 | 17 | } 18 | extension FunnyViewController { 19 | override func loadData(){ 20 | // 1.给父类中ViewModel进行赋值 21 | baseVM = funnyVM 22 | 23 | // 2. 请求数据 24 | funnyVM.loadFunnyData { 25 | self.collectionView.reloadData() 26 | 27 | self.loadDataFinshed() 28 | } 29 | } 30 | } 31 | 32 | // MARK:- 设置UI 33 | extension FunnyViewController 34 | { 35 | override func setupUI() { 36 | super.setupUI() 37 | 38 | // 处理header 39 | let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout 40 | layout.headerReferenceSize = CGSize.zero 41 | collectionView.contentInset = UIEdgeInsetsMake(kTopMargin, 0, 0, 0) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 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 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Assets.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "LaunchImage-800-Portrait-736h@3x.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "667h", 16 | "filename" : "LaunchImage-800-667h@2x.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "portrait", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "orientation" : "portrait", 23 | "idiom" : "iphone", 24 | "filename" : "LaunchImage-700@2x.png", 25 | "extent" : "full-screen", 26 | "minimum-system-version" : "7.0", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "extent" : "full-screen", 31 | "idiom" : "iphone", 32 | "subtype" : "retina4", 33 | "filename" : "LaunchImage-568h@2x.png", 34 | "minimum-system-version" : "7.0", 35 | "orientation" : "portrait", 36 | "scale" : "2x" 37 | } 38 | ], 39 | "info" : { 40 | "version" : 1, 41 | "author" : "xcode" 42 | } 43 | } -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/ViewModel/AmuseViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AmuseViewModel.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/22. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class AmuseViewModel : BaseViewModel { 12 | 13 | } 14 | 15 | extension AmuseViewModel { 16 | func loadAmuseData(finishedCallBack : @escaping () -> ()) { 17 | loadAnchorData(isGroupData: true, URLString: "http://capi.douyucdn.cn/api/v1/getHotRoom/2", parameters: ["shortName" : "game"], finishedCallback: finishedCallBack) 18 | // NetworkTools.requestData(type: .GET, urlString: "http://capi.douyucdn.cn/api/v1/getHotRoom/2", parameters: ["shortName" : "game"]) {(result) in 19 | // 20 | // // 1.获取到数据 21 | // guard let resultDict = result as? [String : Any] else {return} 22 | // guard let dataArray = resultDict["data"] as? [[String : Any]] else {return} 23 | // 24 | // // 2.字典转模型 25 | // for dict in dataArray { 26 | // self.anchorGroups.append(AnchorGroup(dict: dict)) 27 | // } 28 | // 29 | // // 3.回调 30 | // finishedCallBack() 31 | // } 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZBUITests/DouYuZBUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DouYuZBUITests.swift 3 | // DouYuZBUITests 4 | // 5 | // Created by HCL黄 on 16/11/3. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class DouYuZBUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Tools/Extension/UIBarButtonItem-Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIBarButtonItem-Extension.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 16/11/3. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIBarButtonItem { 12 | class func createItem(_ imageName: String, highImageName: String, size: CGSize) ->UIBarButtonItem { 13 | 14 | let btn = UIButton() 15 | btn.setImage(UIImage(named: imageName), for: UIControlState()) 16 | btn.setImage(UIImage(named: highImageName), for: .highlighted) 17 | btn.frame = CGRect(origin: CGPoint.zero, size: size) 18 | let item = UIBarButtonItem(customView: btn) 19 | 20 | return item 21 | } 22 | 23 | // 便利构造函数:1> convenience开头 2>在构造函数中必须明确调用一个设计的构造函数(self) 24 | // swift语法,可以传默认参数,在下面要做判断 25 | convenience init(imageName: String, highImageName: String = "", size: CGSize = CGSize.zero) { 26 | let btn = UIButton() 27 | btn.setImage(UIImage(named: imageName), for: UIControlState()) 28 | if highImageName != "" { 29 | btn.setImage(UIImage(named: highImageName), for: .highlighted) 30 | } 31 | 32 | if size == CGSize.zero { 33 | btn.sizeToFit() 34 | } 35 | else { 36 | btn.frame = CGRect(origin: CGPoint.zero, size: size) 37 | } 38 | 39 | self.init(customView: btn) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/View/CollectionViewPrettyCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewPrettyCell.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 16/11/17. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Kingfisher 11 | 12 | class CollectionViewPrettyCell: UICollectionViewCell { 13 | // MARK:- 定义模型属性 14 | var anchor : AnchorModel?{ 15 | didSet { 16 | // 校验模型是否有值 17 | guard let anchor = anchor else { 18 | return 19 | } 20 | 21 | // 显示在线人数 22 | var onlineStr : String = "" 23 | if anchor.online >= 10000 { 24 | onlineStr = "\(Int(anchor.online / 10000))万在线" 25 | } 26 | else { 27 | onlineStr = "\(anchor.online)万在线" 28 | } 29 | onlineLabel.text = onlineStr 30 | 31 | // 显示昵称 32 | nameLabel.text = anchor.nickname 33 | // 所在城市 34 | cityBtn.setTitle(anchor.anchor_city, for: UIControlState.normal) 35 | // 设置封面图片 36 | guard let iconUrl = URL(string: anchor.vertical_src) else {return} 37 | iconImageView.kf.setImage(with: iconUrl, placeholder: UIImage(named: "")) 38 | } 39 | } 40 | 41 | @IBOutlet weak var iconImageView: UIImageView! 42 | @IBOutlet weak var onlineLabel: UILabel! 43 | @IBOutlet weak var cityBtn: UIButton! 44 | @IBOutlet weak var nameLabel: UILabel! 45 | 46 | } 47 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/View/CollectionViewNormalCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CollectionViewNormalCell.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 16/11/17. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CollectionViewNormalCell: UICollectionViewCell { 12 | 13 | // MARK:- 定义模型属性 14 | var anchor : AnchorModel?{ 15 | didSet { 16 | // 校验模型是否有值 17 | guard let anchor = anchor else { 18 | return 19 | } 20 | 21 | // 显示在线人数 22 | var onlineStr : String = "" 23 | if anchor.online >= 10000 { 24 | onlineStr = "\(Int(anchor.online / 10000))万在线" 25 | } 26 | else { 27 | onlineStr = "\(anchor.online)万在线" 28 | } 29 | onlineBtn.setTitle(onlineStr, for: UIControlState.normal) 30 | 31 | // 显示昵称 32 | nickNameLabel.text = anchor.nickname 33 | 34 | // 设置封面图片 35 | guard let iconUrl = URL(string: anchor.vertical_src) else {return} 36 | iconImageView.kf.setImage(with: iconUrl, placeholder: UIImage(named: "")) 37 | 38 | // 房间名 39 | roomNameLabel.text = anchor.room_name 40 | } 41 | } 42 | 43 | @IBOutlet weak var iconImageView: UIImageView! 44 | @IBOutlet weak var nickNameLabel: UILabel! 45 | @IBOutlet weak var onlineBtn: UIButton! 46 | @IBOutlet weak var roomNameLabel: UILabel! 47 | } 48 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/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 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | NSAppTransportSecurity 43 | 44 | NSAllowsArbitraryLoads 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/Controller/BaseViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/25. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class BaseViewController: UIViewController { 12 | 13 | var contentView : UIView? 14 | 15 | // MARK:- 懒加载属性 16 | fileprivate lazy var animImageView : UIImageView = { [unowned self] in 17 | let imageView = UIImageView(image: UIImage(named: "img_loading_1")) 18 | imageView.center = self.view.center 19 | imageView.animationImages = [UIImage(named: "img_loading_1")!, UIImage(named: "img_loading_2")!] 20 | imageView.animationDuration = 0.5 21 | imageView.animationRepeatCount = LONG_MAX 22 | imageView.autoresizingMask = [.flexibleTopMargin, .flexibleBottomMargin] 23 | return imageView 24 | }() 25 | 26 | // MARK:- 系统回调 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | 30 | setupUI() 31 | } 32 | 33 | } 34 | 35 | extension BaseViewController { 36 | func setupUI() { 37 | 38 | // 1.先隐藏内容的view 39 | contentView?.isHidden = true 40 | 41 | // 2.添加执行动画的UIImageView 42 | view.addSubview(animImageView) 43 | animImageView.startAnimating() 44 | 45 | view.backgroundColor = UIColor(r: 250, g: 250, b: 250) 46 | } 47 | 48 | func loadDataFinshed() { 49 | animImageView.stopAnimating() 50 | 51 | animImageView.isHidden = true 52 | 53 | contentView?.isHidden = false 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /.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 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/Controller/AmuseViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AmuseViewController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/21. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let kMenuViewH : CGFloat = 200 12 | 13 | class AmuseViewController: BaseAnchorViewController { 14 | fileprivate lazy var amuseVM : AmuseViewModel = AmuseViewModel() 15 | fileprivate lazy var menuView : AmuseMenuView = { 16 | let menuView = AmuseMenuView.amuseMenuView() 17 | menuView.frame = CGRect(x: 0, y: -kMenuViewH, width: kScreenW, height: kMenuViewH) 18 | 19 | return menuView; 20 | }() 21 | 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | 27 | 28 | } 29 | } 30 | 31 | // MARK:- 设置UI界面 32 | extension AmuseViewController { 33 | override func setupUI() { 34 | super.setupUI() 35 | 36 | // 将菜单的view添加到collectionView中 37 | collectionView.addSubview(menuView) 38 | collectionView.contentInset = UIEdgeInsetsMake(kMenuViewH, 0, 0, 0) 39 | } 40 | } 41 | 42 | 43 | // MARK:- 请求数据 44 | extension AmuseViewController 45 | { 46 | override func loadData(){ 47 | // 1.给父类中ViewModel进行赋值 48 | baseVM = amuseVM 49 | 50 | // 2. 请求数据 51 | amuseVM.loadAmuseData { 52 | self.collectionView.reloadData() 53 | 54 | var tempGroups = self.amuseVM.anchorGroups 55 | tempGroups.removeFirst() 56 | self.menuView.groups = tempGroups 57 | 58 | self.loadDataFinshed() 59 | } 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/ViewModel/BaseViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewModel.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/22. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class BaseViewModel { 12 | var anchorGroups : [AnchorGroup] = [AnchorGroup]() 13 | } 14 | 15 | extension BaseViewModel { 16 | func loadAnchorData(isGroupData : Bool, URLString: String, parameters : [String : Any]? = nil, finishedCallback : @escaping () -> ()) { 17 | NetworkTools.requestData(type: .GET, urlString: URLString, parameters: parameters!) {(result) in 18 | 19 | // 1.获取到数据 20 | guard let resultDict = result as? [String : Any] else {return} 21 | guard let dataArray = resultDict["data"] as? [[String : Any]] else {return} 22 | 23 | // 2. 判断是否是分组数据 24 | if isGroupData { 25 | // 2.1 字典转模型 26 | for dict in dataArray { 27 | self.anchorGroups.append(AnchorGroup(dict: dict)) 28 | } 29 | } 30 | else { 31 | // 2.1 创建组 32 | let group = AnchorGroup(dict: ["" : ""]) 33 | 34 | // 2.2 遍历dataArray的所有字典 35 | for dict in dataArray { 36 | group.anchors.append(AnchorModel(dict: dict as! [String : NSObject])) 37 | } 38 | 39 | // 2.3 将group添加到anchorGroups 40 | self.anchorGroups.append(group) 41 | } 42 | 43 | 44 | 45 | // 3.回调 46 | finishedCallback() 47 | } 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Base.lproj/Main.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 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/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 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/AmuseMenuViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AmuseMenuViewCell.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/25. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let kGameCellID = "kGameCellID" 12 | 13 | class AmuseMenuViewCell: UICollectionViewCell { 14 | // MARK:- 数组模型 15 | var groups : [AnchorGroup]? { 16 | didSet { 17 | collectionView.reloadData() 18 | } 19 | } 20 | 21 | 22 | @IBOutlet weak var collectionView: UICollectionView! 23 | 24 | override func awakeFromNib() { 25 | super.awakeFromNib() 26 | 27 | collectionView.dataSource = self 28 | 29 | collectionView.register(UINib(nibName: "CollectionViewGameCell", bundle: nil), forCellWithReuseIdentifier: kGameCellID) 30 | } 31 | 32 | override func layoutSubviews() { 33 | super.layoutSubviews() 34 | 35 | let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout 36 | let itemW = collectionView.bounds.width / 4 37 | let itemH = collectionView.bounds.height / 2 38 | 39 | layout.itemSize = CGSize(width: itemW, height: itemH) 40 | } 41 | } 42 | 43 | extension AmuseMenuViewCell : UICollectionViewDataSource 44 | { 45 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 46 | return groups?.count ?? 0 47 | } 48 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 49 | 50 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kGameCellID, for: indexPath) as! CollectionViewGameCell 51 | cell.clipsToBounds = true 52 | // 给cell设置数据 53 | cell.group = groups![indexPath.item] 54 | 55 | return cell 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/Controller/CustomNavigationController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomNavigationController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/25. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CustomNavigationController: UINavigationController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | // 1.获取系统的pop手势 17 | guard let systemGes = interactivePopGestureRecognizer else {return} 18 | // 2.获取手势添加到的view中 19 | guard let gesView = systemGes.view else { return } 20 | // 3.获取target/action 21 | // 3.1利用运行时机制查看所有的属性名称 22 | // var count : UInt32 = 0 23 | // let ivars = class_copyIvarList(UIGestureRecognizer.self, &count)! 24 | // for i in 0.. Void) { 35 | asyncAfter(deadline: .now() + delay, execute: closure) 36 | } 37 | 38 | func syncResult(_ closure: () -> T) -> T { 39 | var result: T! 40 | sync { result = closure() } 41 | return result 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/RecommendGameView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RecommendGameView.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/18. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let kGameCellID = "kGameCellID" 12 | private let kEdgeInsetMargin : CGFloat = 10.0 13 | 14 | class RecommendGameView: UIView { 15 | // MARK:- 定义数据属性 16 | var groups : [BaseGameModel]? { 17 | didSet { 18 | 19 | collectionView.reloadData() 20 | } 21 | } 22 | 23 | // MARK:- 控件属性 24 | @IBOutlet weak var collectionView: UICollectionView! 25 | 26 | override func awakeFromNib() { 27 | super.awakeFromNib() 28 | 29 | // 设置该控件不随着父控件的拉伸而拉伸 30 | autoresizingMask = UIViewAutoresizing(rawValue: 0) 31 | 32 | collectionView.dataSource = self 33 | // 34 | collectionView.register(UINib(nibName: "CollectionViewGameCell", bundle: nil), forCellWithReuseIdentifier: kGameCellID) 35 | 36 | // 添加内边距 37 | collectionView.contentInset = UIEdgeInsetsMake(0, kEdgeInsetMargin, 0, kEdgeInsetMargin) 38 | } 39 | } 40 | // MARK:- 遵守UICollectionView的数据源协议 41 | extension RecommendGameView : UICollectionViewDataSource 42 | { 43 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 44 | return groups?.count ?? 0 45 | } 46 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 47 | 48 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kGameCellID, for: indexPath) as! CollectionViewGameCell 49 | let group = groups![indexPath.item] 50 | cell.group = group 51 | // cell.backgroundColor = indexPath.item % 2 == 0 ? UIColor.red : UIColor.orange 52 | return cell 53 | 54 | } 55 | 56 | } 57 | 58 | extension RecommendGameView { 59 | class func recommendGameView() -> RecommendGameView { 60 | return Bundle.main.loadNibNamed("RecommendGameView", owner: nil, options: nil)?.first as! RecommendGameView 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/Pods-DouYuZB-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Alamofire 5 | 6 | Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## Kingfisher 28 | 29 | The MIT License (MIT) 30 | 31 | Copyright (c) 2015 Wei Wang 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 | SOFTWARE. 50 | 51 | 52 | Generated by CocoaPods - https://cocoapods.org 53 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Alamofire/Source/Notifications.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Notifications.swift 3 | // 4 | // Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | extension Notification.Name { 28 | /// Used as a namespace for all `URLSessionTask` related notifications. 29 | public struct Task { 30 | /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. 31 | public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") 32 | 33 | /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. 34 | public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") 35 | 36 | /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. 37 | public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") 38 | 39 | /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. 40 | public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") 41 | } 42 | } 43 | 44 | // MARK: - 45 | 46 | extension Notification { 47 | /// Used as a namespace for all `Notification` user info dictionary keys. 48 | public struct Key { 49 | /// User info dictionary key representing the `URLSessionTask` associated with the notification. 50 | public static let Task = "org.alamofire.notification.key.task" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/AmuseMenuView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AmuseMenuView.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/25. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let kMenuCellID = "kMenuCellID" 12 | 13 | class AmuseMenuView: UIView { 14 | 15 | // MARK:- 定义属性 16 | var groups : [AnchorGroup]? { 17 | didSet { 18 | collectionView.reloadData() 19 | } 20 | } 21 | 22 | @IBOutlet weak var collectionView: UICollectionView! 23 | @IBOutlet weak var pageControl: UIPageControl! 24 | 25 | override func awakeFromNib() { 26 | collectionView.dataSource = self 27 | collectionView.delegate = self 28 | 29 | // collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: kMenuCellID) 30 | collectionView.register(UINib(nibName: "AmuseMenuViewCell", bundle: nil), forCellWithReuseIdentifier: kMenuCellID) 31 | } 32 | 33 | override func layoutSubviews() { 34 | super.layoutSubviews() 35 | 36 | let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout 37 | layout.itemSize = collectionView.bounds.size 38 | } 39 | } 40 | 41 | extension AmuseMenuView : UICollectionViewDataSource 42 | { 43 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 44 | if groups == nil { return 0 } 45 | 46 | let pageNum = (groups!.count - 1) / 8 + 1 47 | pageControl.numberOfPages = pageNum 48 | 49 | return pageNum 50 | } 51 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 52 | 53 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kMenuCellID, for: indexPath) as! AmuseMenuViewCell 54 | 55 | setupCellDataWith(cell: cell, indexPath: indexPath) 56 | 57 | return cell 58 | 59 | } 60 | 61 | // 给cell设置数据 62 | private func setupCellDataWith(cell : AmuseMenuViewCell, indexPath : IndexPath) { 63 | // 0页:0 - 7 64 | // 1页:8 - 15 65 | // 2页:16 - 23 66 | // 1. 取出起始位置和终点位置 67 | let startIndex = indexPath.item * 8 68 | var endIndex = (indexPath.item + 1) * 8 - 1 69 | 70 | // 2. 判断越界问题 71 | if endIndex > groups!.count - 1 { 72 | endIndex = groups!.count - 1 73 | } 74 | 75 | // 3.取出数据,并且赋值给cell 76 | var temArray = [AnchorGroup]() 77 | for i in startIndex ... endIndex { 78 | temArray.append(self.groups![i]) 79 | } 80 | cell.groups = temArray 81 | // cell.groups = Array(groups![startIndex...endIndex]) 82 | } 83 | } 84 | extension AmuseMenuView : UICollectionViewDelegate { 85 | func scrollViewDidScroll(_ scrollView: UIScrollView) { 86 | pageControl.currentPage = Int(collectionView.contentOffset.x / scrollView.bounds.width) 87 | } 88 | } 89 | 90 | extension AmuseMenuView { 91 | class func amuseMenuView() -> AmuseMenuView { 92 | return Bundle.main.loadNibNamed("AmuseMenuView", owner: nil, options: nil)?.first as! AmuseMenuView 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/RecommendGameView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Base.lproj/Profile.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Follow/Follow.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/AmuseMenuViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Live/Live.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/Controller/Home.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/Pods-DouYuZBTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/Pods-DouYuZBUITests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/Pods-DouYuZB-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | Alamofire 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | The MIT License (MIT) 47 | 48 | Copyright (c) 2015 Wei Wang 49 | 50 | Permission is hereby granted, free of charge, to any person obtaining a copy 51 | of this software and associated documentation files (the "Software"), to deal 52 | in the Software without restriction, including without limitation the rights 53 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 54 | copies of the Software, and to permit persons to whom the Software is 55 | furnished to do so, subject to the following conditions: 56 | 57 | The above copyright notice and this permission notice shall be included in all 58 | copies or substantial portions of the Software. 59 | 60 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 61 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 62 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 63 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 64 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 65 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 66 | SOFTWARE. 67 | 68 | 69 | License 70 | MIT 71 | Title 72 | Kingfisher 73 | Type 74 | PSGroupSpecifier 75 | 76 | 77 | FooterText 78 | Generated by CocoaPods - https://cocoapods.org 79 | Title 80 | 81 | Type 82 | PSGroupSpecifier 83 | 84 | 85 | StringsTable 86 | Acknowledgements 87 | Title 88 | Acknowledgements 89 | 90 | 91 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Alamofire/Source/Result.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Result.swift 3 | // 4 | // Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// Used to represent whether a request was successful or encountered an error. 28 | /// 29 | /// - success: The request and all post processing operations were successful resulting in the serialization of the 30 | /// provided associated value. 31 | /// 32 | /// - failure: The request encountered an error resulting in a failure. The associated values are the original data 33 | /// provided by the server as well as the error that caused the failure. 34 | public enum Result { 35 | case success(Value) 36 | case failure(Error) 37 | 38 | /// Returns `true` if the result is a success, `false` otherwise. 39 | public var isSuccess: Bool { 40 | switch self { 41 | case .success: 42 | return true 43 | case .failure: 44 | return false 45 | } 46 | } 47 | 48 | /// Returns `true` if the result is a failure, `false` otherwise. 49 | public var isFailure: Bool { 50 | return !isSuccess 51 | } 52 | 53 | /// Returns the associated value if the result is a success, `nil` otherwise. 54 | public var value: Value? { 55 | switch self { 56 | case .success(let value): 57 | return value 58 | case .failure: 59 | return nil 60 | } 61 | } 62 | 63 | /// Returns the associated error value if the result is a failure, `nil` otherwise. 64 | public var error: Error? { 65 | switch self { 66 | case .success: 67 | return nil 68 | case .failure(let error): 69 | return error 70 | } 71 | } 72 | } 73 | 74 | // MARK: - CustomStringConvertible 75 | 76 | extension Result: CustomStringConvertible { 77 | /// The textual representation used when written to an output stream, which includes whether the result was a 78 | /// success or failure. 79 | public var description: String { 80 | switch self { 81 | case .success: 82 | return "SUCCESS" 83 | case .failure: 84 | return "FAILURE" 85 | } 86 | } 87 | } 88 | 89 | // MARK: - CustomDebugStringConvertible 90 | 91 | extension Result: CustomDebugStringConvertible { 92 | /// The debug textual representation used when written to an output stream, which includes whether the result was a 93 | /// success or failure in addition to the value or error. 94 | public var debugDescription: String { 95 | switch self { 96 | case .success(let value): 97 | return "SUCCESS: \(value)" 98 | case .failure(let error): 99 | return "FAILURE: \(error)" 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/Pods-DouYuZB-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" 88 | install_framework "$BUILT_PRODUCTS_DIR/Kingfisher/Kingfisher.framework" 89 | fi 90 | if [[ "$CONFIGURATION" == "Release" ]]; then 91 | install_framework "$BUILT_PRODUCTS_DIR/Alamofire/Alamofire.framework" 92 | install_framework "$BUILT_PRODUCTS_DIR/Kingfisher/Kingfisher.framework" 93 | fi 94 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/RecommendCycleView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/Controller/HomeViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 16/11/3. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let kTitleViewH: CGFloat = 40 12 | 13 | class HomeViewController: UIViewController { 14 | 15 | // MARK:- 懒加载PageTitleView 16 | fileprivate lazy var pageTitleView: PageTitleView = {[weak self] in 17 | let titleFrame = CGRect(x: 0, y: kStatusBarH + kNavigationBarH, width: kScreenW, height: kTitleViewH) 18 | let titles = ["推荐", "游戏", "娱乐", "趣玩"] 19 | 20 | let titleView = PageTitleView(frame: titleFrame, titles: titles) 21 | titleView.delegate = self 22 | 23 | return titleView 24 | }() 25 | 26 | // MARK:- 懒加载PageContentView 27 | fileprivate lazy var pageContentView: PageContentView = {[weak self] in 28 | 29 | // 1.确定内容的frame 30 | let contentH = kScreenH - kStatusBarH - kNavigationBarH - kTabBarH 31 | let contentFrame = CGRect(x: 0, y: kStatusBarH + kNavigationBarH + kTitleViewH, width: kScreenW, height: contentH) 32 | 33 | // 2.确定所有的子控制器 34 | var childVcs = [UIViewController]() 35 | childVcs.append(RecommendViewController()) 36 | childVcs.append(GameViewController()) 37 | childVcs.append(AmuseViewController()) 38 | childVcs.append(FunnyViewController()) 39 | 40 | // for _ in 0..<1 { 41 | // let vc = UIViewController() 42 | // vc.view.backgroundColor = UIColor(r: CGFloat(arc4random_uniform(255)), g: CGFloat(arc4random_uniform(255)), b: CGFloat(arc4random_uniform(255))) 43 | // childVcs.append(vc) 44 | // } 45 | 46 | let contentView = PageContentView(frame: contentFrame, childVcs: childVcs, parentViewController: self) 47 | contentView.delegate = self 48 | 49 | return contentView 50 | 51 | }() 52 | 53 | // MARK:- 系统回调函数 54 | override func viewDidLoad() { 55 | super.viewDidLoad() 56 | 57 | // 设置UI界面 58 | setupUI() 59 | 60 | } 61 | } 62 | 63 | extension HomeViewController { 64 | 65 | fileprivate func setupUI() { 66 | // 0.不需要调整UIScrollView的内边距 67 | automaticallyAdjustsScrollViewInsets = false 68 | 69 | // 1.设置导航栏 70 | setupNavigationBar() 71 | 72 | // 2.添加TitleView 73 | view.addSubview(pageTitleView) 74 | 75 | // 3.添加ContentView 76 | view.addSubview(pageContentView) 77 | pageContentView.backgroundColor = UIColor.purple 78 | } 79 | 80 | fileprivate func setupNavigationBar() { 81 | // 1.设置左侧的Item 82 | let btn = UIButton() 83 | btn.setImage(UIImage(named: "logo"), for: UIControlState()) 84 | btn.sizeToFit() 85 | navigationItem.leftBarButtonItem = UIBarButtonItem(customView: btn) 86 | 87 | // 2.设置右侧的Item 88 | let size = CGSize(width: 40, height: 40) 89 | let historyItem = UIBarButtonItem.createItem("image_my_history", highImageName: "Image_my_history_click", size: size) 90 | 91 | let searchItem = UIBarButtonItem.createItem("btn_search", highImageName: "btn_search_clicked", size: size) 92 | 93 | // let qrcodeItem = UIBarButtonItem.createItem("Image_scan", highImageName: "Image_scan_click", size: size) 94 | // 构造函数 95 | let qrcodeItem = UIBarButtonItem(imageName: "Image_scan", highImageName: "Image_scan_click", size: size) 96 | 97 | navigationItem.rightBarButtonItems = [historyItem, searchItem,qrcodeItem] 98 | 99 | } 100 | } 101 | 102 | // MARK:- 遵守PageTitleViewDelegate,为了给pageContentView传递值 103 | extension HomeViewController: PageTitleViewDelegate { 104 | func pageTitleView(_ titleView: PageTitleView, selectIndex index: Int) { 105 | pageContentView.setCurrentIndex(index) 106 | } 107 | } 108 | 109 | 110 | // MARK:- 遵守PageContentViewDelegate,为了给pageTitleView传递值 111 | extension HomeViewController: PageContentViewDelegate { 112 | func pageContentView(_ contentView: PageContentView, progress: CGFloat, sourceIndex: Int, targetIndex: Int) { 113 | pageTitleView.setTitleWithProgess(progress, sourceIndex: sourceIndex, targetIndex: targetIndex) 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/AmuseMenuView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/RecommendCycleView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RecommendCycleView.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/18. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let kCycleCellID = "kCycleCellID" 12 | 13 | class RecommendCycleView: UIView { 14 | var cycleTimer : Timer? 15 | 16 | // MARK:- 懒加载装着CycleModel模型的数组 17 | var cycleModels : [CycleModel]? { 18 | didSet { 19 | // 1. 刷新collectionView 20 | collectionView.reloadData() 21 | 22 | // 2. 设置pageControl的个数 23 | pageControl.numberOfPages = cycleModels?.count ?? 0 24 | 25 | // 3. 默认滚动到中间某个位置 26 | let indexPath = NSIndexPath(item: (cycleModels?.count ?? 0) * 20, section: 0) 27 | collectionView.scrollToItem(at: indexPath as IndexPath, at: .left, animated: false) 28 | 29 | // 4. 添加定时器 30 | removeCycleTimer() 31 | addCycleTimer() 32 | } 33 | } 34 | 35 | // MARK:- 控件属性 36 | @IBOutlet weak var collectionView: UICollectionView! 37 | @IBOutlet weak var pageControl: UIPageControl! 38 | 39 | override func awakeFromNib() { 40 | super.awakeFromNib() 41 | 42 | // 设置该控件不随着父控件的拉伸而拉伸 43 | autoresizingMask = UIViewAutoresizing(rawValue: 0) 44 | 45 | collectionView.dataSource = self 46 | collectionView.delegate = self 47 | // 注册cell 48 | 49 | collectionView.register(UINib(nibName: "CollectionViewCycleCell", bundle: nil), forCellWithReuseIdentifier: kCycleCellID) 50 | // collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: kCycleCellID) 51 | 52 | } 53 | override func layoutSubviews() { 54 | super.layoutSubviews() 55 | 56 | // 设置collectionView的layout 57 | let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout 58 | layout.itemSize = collectionView.bounds.size 59 | layout.minimumLineSpacing = 0 60 | layout.minimumInteritemSpacing = 0 61 | layout.scrollDirection = .horizontal 62 | collectionView.isPagingEnabled = true 63 | collectionView.showsHorizontalScrollIndicator = false 64 | } 65 | } 66 | 67 | extension RecommendCycleView { 68 | class func recommendCycleView() -> RecommendCycleView { 69 | return Bundle.main.loadNibNamed("RecommendCycleView", owner: nil, options: nil)?.first as! RecommendCycleView 70 | } 71 | } 72 | // MARK:- 遵守UICollectionView的数据源协议 73 | extension RecommendCycleView : UICollectionViewDataSource 74 | { 75 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 76 | return (self.cycleModels?.count ?? 0) * 200 77 | } 78 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 79 | 80 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCycleCellID, for: indexPath) as! CollectionViewCycleCell 81 | let cycleModel = cycleModels![indexPath.item % cycleModels!.count] 82 | cell.cycleModel = cycleModel 83 | cell.backgroundColor = indexPath.item % 2 == 0 ? UIColor.red : UIColor.orange 84 | return cell 85 | 86 | } 87 | 88 | } 89 | 90 | // MARK:- 遵守UICollectionView的数据源协议 91 | extension RecommendCycleView : UICollectionViewDelegate 92 | { 93 | func scrollViewDidScroll(_ scrollView: UIScrollView) { 94 | // 1. 获取滚动的偏移量 95 | let offsetX = scrollView.contentOffset.x + scrollView.bounds.width * 0.5 96 | 97 | // 2. 计算pageController的currentIndex 98 | pageControl.currentPage = Int(offsetX / scrollView.bounds.width) % (cycleModels?.count ?? 1) 99 | } 100 | func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { 101 | removeCycleTimer() 102 | } 103 | func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { 104 | addCycleTimer() 105 | } 106 | } 107 | 108 | // MARK:- 对定时器的操作方法 109 | extension RecommendCycleView { 110 | fileprivate func addCycleTimer() { 111 | cycleTimer = Timer(timeInterval: 3.0, target: self, selector: #selector(self.scrollTotNext), userInfo: nil, repeats: true) 112 | RunLoop.main.add(cycleTimer!, forMode: RunLoopMode.commonModes) 113 | } 114 | fileprivate func removeCycleTimer() { 115 | cycleTimer?.invalidate() 116 | cycleTimer = nil 117 | } 118 | @objc private func scrollTotNext() { 119 | let currentOffsetX = collectionView.contentOffset.x 120 | let offsetX = currentOffsetX + collectionView.bounds.width 121 | 122 | // 滚动到该位置 123 | collectionView.setContentOffset(CGPoint(x: offsetX, y: 0), animated: true) 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/CollectionViewCycleCell.xib: -------------------------------------------------------------------------------- 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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZB/Pods-DouYuZB-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | install_resource() 27 | { 28 | if [[ "$1" = /* ]] ; then 29 | RESOURCE_PATH="$1" 30 | else 31 | RESOURCE_PATH="${PODS_ROOT}/$1" 32 | fi 33 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 34 | cat << EOM 35 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 36 | EOM 37 | exit 1 38 | fi 39 | case $RESOURCE_PATH in 40 | *.storyboard) 41 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 42 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 43 | ;; 44 | *.xib) 45 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 46 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 47 | ;; 48 | *.framework) 49 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 50 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 51 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 52 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 53 | ;; 54 | *.xcdatamodel) 55 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 56 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 57 | ;; 58 | *.xcdatamodeld) 59 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 60 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 61 | ;; 62 | *.xcmappingmodel) 63 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 64 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 65 | ;; 66 | *.xcassets) 67 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 68 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 69 | ;; 70 | *) 71 | echo "$RESOURCE_PATH" 72 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 73 | ;; 74 | esac 75 | } 76 | 77 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 78 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 79 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 80 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 82 | fi 83 | rm -f "$RESOURCES_TO_COPY" 84 | 85 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 86 | then 87 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 88 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 89 | while read line; do 90 | if [[ $line != "${PODS_ROOT}*" ]]; then 91 | XCASSET_FILES+=("$line") 92 | fi 93 | done <<<"$OTHER_XCASSETS" 94 | 95 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | fi 97 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBTests/Pods-DouYuZBTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | install_resource() 27 | { 28 | if [[ "$1" = /* ]] ; then 29 | RESOURCE_PATH="$1" 30 | else 31 | RESOURCE_PATH="${PODS_ROOT}/$1" 32 | fi 33 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 34 | cat << EOM 35 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 36 | EOM 37 | exit 1 38 | fi 39 | case $RESOURCE_PATH in 40 | *.storyboard) 41 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 42 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 43 | ;; 44 | *.xib) 45 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 46 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 47 | ;; 48 | *.framework) 49 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 50 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 51 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 52 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 53 | ;; 54 | *.xcdatamodel) 55 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 56 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 57 | ;; 58 | *.xcdatamodeld) 59 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 60 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 61 | ;; 62 | *.xcmappingmodel) 63 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 64 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 65 | ;; 66 | *.xcassets) 67 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 68 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 69 | ;; 70 | *) 71 | echo "$RESOURCE_PATH" 72 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 73 | ;; 74 | esac 75 | } 76 | 77 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 78 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 79 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 80 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 82 | fi 83 | rm -f "$RESOURCES_TO_COPY" 84 | 85 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 86 | then 87 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 88 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 89 | while read line; do 90 | if [[ $line != "${PODS_ROOT}*" ]]; then 91 | XCASSET_FILES+=("$line") 92 | fi 93 | done <<<"$OTHER_XCASSETS" 94 | 95 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | fi 97 | -------------------------------------------------------------------------------- /DouYuZB/Pods/Target Support Files/Pods-DouYuZBUITests/Pods-DouYuZBUITests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | install_resource() 27 | { 28 | if [[ "$1" = /* ]] ; then 29 | RESOURCE_PATH="$1" 30 | else 31 | RESOURCE_PATH="${PODS_ROOT}/$1" 32 | fi 33 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 34 | cat << EOM 35 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 36 | EOM 37 | exit 1 38 | fi 39 | case $RESOURCE_PATH in 40 | *.storyboard) 41 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 42 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 43 | ;; 44 | *.xib) 45 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 46 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 47 | ;; 48 | *.framework) 49 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 50 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 51 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 52 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 53 | ;; 54 | *.xcdatamodel) 55 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 56 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 57 | ;; 58 | *.xcdatamodeld) 59 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 60 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 61 | ;; 62 | *.xcmappingmodel) 63 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 64 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 65 | ;; 66 | *.xcassets) 67 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 68 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 69 | ;; 70 | *) 71 | echo "$RESOURCE_PATH" 72 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 73 | ;; 74 | esac 75 | } 76 | 77 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 78 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 79 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 80 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 82 | fi 83 | rm -f "$RESOURCES_TO_COPY" 84 | 85 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 86 | then 87 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 88 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 89 | while read line; do 90 | if [[ $line != "${PODS_ROOT}*" ]]; then 91 | XCASSET_FILES+=("$line") 92 | fi 93 | done <<<"$OTHER_XCASSETS" 94 | 95 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | fi 97 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/ViewModel/RecommendViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RecommendViewModel.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/6. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class RecommendViewModel : BaseViewModel { 12 | // MARK:- 懒加载属性 13 | // lazy var anrchorGroups : [AnchorGroup] = [AnchorGroup]() 14 | fileprivate lazy var bigDataGroup : AnchorGroup = AnchorGroup(dict: ["" : "" as NSObject]) 15 | fileprivate lazy var prettyDataGroup : AnchorGroup = AnchorGroup(dict: ["" : "" as NSObject]) 16 | 17 | // MARK:- 保存轮播图数组 18 | lazy var cycleModels : [CycleModel] = [CycleModel]() 19 | } 20 | 21 | // MARK:- 发送网络请求 22 | extension RecommendViewModel { 23 | func requestData(finshCallBack : @escaping ()->()) { 24 | 25 | // 创建线程group 26 | let dis_group = DispatchGroup() 27 | 28 | // 1.请求第一部分推荐数据 29 | dis_group.enter() // 进入线程组 30 | NetworkTools.requestData(type: .GET, urlString: "http://capi.douyucdn.cn/api/v1/getbigDataRoom", parameters: ["time":NSDate.getCurrentTime()]) { (result) in 31 | 32 | // 1 将result转成字典类型 33 | guard let resultDic = result as? [String : NSObject] else {return} 34 | 35 | // 2 根据data该key,获取数组 36 | guard let dataArray = resultDic["data"] as? [[String : NSObject]] else {return} 37 | 38 | // 3 遍历数组,获取字典,并且将字典转成模型对象 39 | 40 | // 3.2 设置组的属性 41 | self.bigDataGroup.tag_name = "热门" 42 | self.bigDataGroup.icon_name = "home_header_hot" 43 | // 3.3 获取主播数据 44 | for dict in dataArray { 45 | let anchor = AnchorModel(dict: dict) 46 | self.bigDataGroup.anchors.append(anchor) 47 | } 48 | 49 | 50 | dis_group.leave() // 离开线程group 51 | 52 | } 53 | 54 | // 2.请求第二部分颜值数据 55 | dis_group.enter() // 进入线程组 56 | NetworkTools.requestData(type: .GET, urlString: "http://capi.douyucdn.cn/api/v1/getVerticalRoom", parameters: ["limit" : "4","offset":"0","time":NSDate.getCurrentTime()]) { (result) in 57 | 58 | // 1 将result转成字典类型 59 | guard let resultDic = result as? [String : NSObject] else {return} 60 | 61 | // 2 根据data该key,获取数组 62 | guard let dataArray = resultDic["data"] as? [[String : NSObject]] else {return} 63 | 64 | // 3 遍历数组,获取字典,并且将字典转成模型对象 65 | 66 | // 3.2 设置组的属性 67 | self.prettyDataGroup.tag_name = "颜值" 68 | self.prettyDataGroup.icon_name = "home_header_phone" 69 | // 3.3 获取主播数据 70 | for dict in dataArray { 71 | let anchor = AnchorModel(dict: dict) 72 | self.prettyDataGroup.anchors.append(anchor) 73 | } 74 | 75 | 76 | dis_group.leave() // 离开线程group 77 | 78 | } 79 | // 3.请求2-12部分游戏数据 80 | dis_group.enter() // 进入线程组 81 | loadAnchorData(isGroupData: true, URLString: "http://capi.douyucdn.cn/api/v1/getHotCate", parameters: ["limit" : "4","offset":"0","time":NSDate.getCurrentTime()]) { 82 | dis_group.leave() // 离开线程group 83 | } 84 | // NetworkTools.requestData(type: .GET, urlString: "http://capi.douyucdn.cn/api/v1/getHotCate", parameters: ["limit" : "4","offset":"0","time":NSDate.getCurrentTime()]) { (result) in 85 | // 86 | // // 1 将result转成字典类型 87 | // guard let resultDic = result as? [String : NSObject] else {return} 88 | // 89 | // // 2 根据data该key,获取数组 90 | // guard let dataArray = resultDic["data"] as? [[String : NSObject]] else {return} 91 | // 92 | // // 3 遍历数组,获取字典,并且将字典转成模型对象 93 | // for dict in dataArray { 94 | // let group = AnchorGroup(dict: dict) 95 | // self.anchorGroups.append(group) 96 | // } 97 | // dis_group.leave() // 离开线程group 98 | 99 | // for group in self.anrchorGroups { 100 | // for anchor in group.anchors { 101 | // print(anchor.nickname) 102 | // } 103 | // } 104 | // } 105 | 106 | // 所有的数据请求到之后进行排序 107 | dis_group.notify(queue: DispatchQueue.main, execute: { 108 | self.anchorGroups.insert(self.prettyDataGroup, at: 0) 109 | self.anchorGroups.insert(self.bigDataGroup, at: 0) 110 | 111 | finshCallBack() 112 | }) 113 | } 114 | 115 | 116 | /// 请求无线轮播的数据 117 | func requestCycleData(finshCallBack : @escaping ()->()) { 118 | NetworkTools.requestData(type: .GET, urlString: "http://capi.douyucdn.cn/api/v1/slide/6", parameters: ["version":"2.300"]) { (result) in 119 | 120 | // 1 将result转成字典类型 121 | guard let resultDic = result as? [String : NSObject] else {return} 122 | 123 | // 2 根据data该key,获取数组 124 | guard let dataArray = resultDic["data"] as? [[String : NSObject]] else {return} 125 | 126 | // 3 字典转模型 127 | for dict in dataArray { 128 | self.cycleModels.append(CycleModel(dict: dict)) 129 | } 130 | 131 | finshCallBack() 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/CollectionViewGameCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Main/Controller/BaseAnchorViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseAnchorViewController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/22. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | private let kItemMargin: CGFloat = 10 13 | private let kItemW = (kScreenW - 3 * kItemMargin) / 2 14 | 15 | private let kNormalItemH = kItemW * 3 / 4 16 | private let kPrettyItemH = kItemW * 4 / 3 17 | private let kHeaderViewH: CGFloat = 50 18 | 19 | private let kNormalCellID = "kNormalCellID" 20 | private let kPrettyCellID = "kPrettyCellID" 21 | private let kHeaderViewID = "kHeaderViewID" 22 | 23 | class BaseAnchorViewController: BaseViewController { 24 | 25 | // MARK:- 定义属性 26 | var baseVM : BaseViewModel! 27 | lazy var collectionView : UICollectionView = {[unowned self] in 28 | // 1.创建布局 29 | let layout = UICollectionViewFlowLayout() 30 | layout.itemSize = CGSize(width: kItemW, height: kNormalItemH) 31 | layout.minimumLineSpacing = 0 32 | layout.minimumInteritemSpacing = kItemMargin 33 | layout.headerReferenceSize = CGSize(width: kScreenW, height: kHeaderViewH) 34 | // 解决最小间距全部挤到中间 35 | layout.sectionInset = UIEdgeInsetsMake(0, kItemMargin, 0, kItemMargin) 36 | 37 | // 2.创建UICollectionView 38 | let collectionView = UICollectionView(frame: self.view.bounds, collectionViewLayout: layout) 39 | collectionView.backgroundColor = UIColor.white 40 | collectionView.dataSource = self 41 | // collectionView.delegate = self 42 | collectionView.autoresizingMask = [.flexibleHeight, .flexibleWidth] 43 | 44 | // 注册 45 | // collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: kNormalCellID) 46 | collectionView.register(UINib(nibName: "CollectionViewNormalCell", bundle: nil), forCellWithReuseIdentifier: kNormalCellID) 47 | collectionView.register(UINib(nibName: "CollectionViewPrettyCell", bundle: nil), forCellWithReuseIdentifier: kPrettyCellID) 48 | // collectionView.register(UICollectionReusableView.self, forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: kHeaderViewID) 49 | collectionView.register(UINib(nibName: "CollectionHeaderView", bundle: nil), forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: kHeaderViewID) 50 | 51 | 52 | return collectionView 53 | }() 54 | 55 | 56 | // MARK:- 系统回调 57 | override func viewDidLoad() { 58 | super.viewDidLoad() 59 | 60 | setupUI() 61 | loadData() 62 | 63 | } 64 | 65 | 66 | } 67 | // MARK:- 请求数据 68 | extension BaseAnchorViewController 69 | { 70 | func loadData(){ 71 | } 72 | } 73 | 74 | // MARK:- 设置UI界面内容 75 | extension BaseAnchorViewController 76 | { 77 | override func setupUI() { 78 | // 1.给父类中的内容View的引用进行复制 79 | contentView = collectionView 80 | 81 | // 2.将UICollectionView添加到控制器view 82 | view.addSubview(collectionView) 83 | 84 | 85 | // 如果先调用super的话,内容view是空的 86 | super.setupUI() 87 | 88 | } 89 | } 90 | 91 | // MARK:- 遵守UICollectionView的数据源协议 92 | extension BaseAnchorViewController: UICollectionViewDataSource 93 | { 94 | func numberOfSections(in collectionView: UICollectionView) -> Int { 95 | if baseVM == nil { return 1 } 96 | return baseVM.anchorGroups.count 97 | } 98 | 99 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 100 | if baseVM == nil { return 20 } 101 | return baseVM.anchorGroups[section].anchors.count 102 | } 103 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 104 | 105 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kNormalCellID, for: indexPath) as! CollectionViewNormalCell 106 | // cell.backgroundColor = UIColor.randomColor() 107 | if baseVM == nil { 108 | return cell 109 | } 110 | cell.anchor = baseVM.anchorGroups[indexPath.section].anchors[indexPath.item] 111 | return cell 112 | 113 | 114 | } 115 | func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { 116 | let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: kHeaderViewID, for: indexPath) as! CollectionHeaderView 117 | if baseVM == nil { 118 | return headerView 119 | } 120 | headerView.group = baseVM.anchorGroups[indexPath.section] 121 | return headerView 122 | } 123 | 124 | } 125 | 126 | // MARK:- 遵守UICollectionView的代理协议协议 127 | extension BaseAnchorViewController: UICollectionViewDelegate 128 | { 129 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 130 | print(indexPath.item) 131 | } 132 | } 133 | 134 | // MARK:- 遵守UICollectionView的代理协议 135 | //extension BaseAnchorViewController: UICollectionViewDelegateFlowLayout 136 | //{ 137 | // func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize 138 | // { 139 | // if indexPath.section == 1 { 140 | // return CGSize(width: kItemW, height: kPrettyItemH) 141 | // } 142 | // return CGSize(width: kItemW, height: kNormalItemH) 143 | // } 144 | //} 145 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/Controller/GameViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameViewController.swift 3 | // DouYuZB 4 | // 5 | // Created by HCL黄 on 2016/12/18. 6 | // Copyright © 2016年 HCL黄. All rights reserved. 7 | // 这里处理了相同属性的属性用BaseModel来继承,传给CollectionViewGameCell的模型时也好处理 8 | 9 | import UIKit 10 | 11 | private let kEdgeMargin : CGFloat = 10.0 12 | private let kItemW : CGFloat = (kScreenW - 2 * kEdgeMargin) / 3 13 | private let kItemH : CGFloat = kItemW * 6 / 5 14 | private let kHeaderViewH : CGFloat = 50 15 | 16 | private let kGameViewH : CGFloat = 90 17 | 18 | private let kGameCellID = "kGameCellID" 19 | private let kHeaderViewID = "kHeaderViewID" 20 | 21 | class GameViewController: BaseViewController { 22 | fileprivate lazy var gameView : RecommendGameView = { 23 | let gameView = RecommendGameView.recommendGameView() 24 | gameView.frame = CGRect(x: 0, y: -kGameViewH, width: kScreenW, height: kGameViewH) 25 | return gameView 26 | }() 27 | fileprivate lazy var topHeaderView : CollectionHeaderView = { 28 | let headerView = CollectionHeaderView.collectionHeaderView() 29 | headerView.frame = CGRect(x: 0, y: -kHeaderViewH-kGameViewH, width: kScreenW, height: kHeaderViewH) 30 | // 设置属性 31 | headerView.titleLabel.text = "常见" 32 | headerView.iconImageView.image = UIImage(named: "Img_orange") 33 | headerView.moreBtn.isHidden = true 34 | 35 | return headerView 36 | }() 37 | fileprivate lazy var gameVM : GameViewModel = GameViewModel() 38 | // MARK:- 懒加载属性 39 | fileprivate lazy var collectionView : UICollectionView = {[weak self] in 40 | // 创建布局 41 | let layout = UICollectionViewFlowLayout() 42 | layout.itemSize = CGSize(width: kItemW, height: kItemH) 43 | layout.minimumLineSpacing = 0 44 | layout.minimumInteritemSpacing = 0 45 | layout.sectionInset = UIEdgeInsetsMake(0, kEdgeMargin, 0, kEdgeMargin) 46 | // 头部的大小设置 47 | layout.headerReferenceSize = CGSize(width: kScreenW, height: kHeaderViewH) 48 | 49 | let collectionView = UICollectionView(frame: (self?.view.bounds)!, collectionViewLayout: layout) 50 | collectionView.backgroundColor = UIColor.white 51 | collectionView.register(UINib(nibName: "CollectionViewGameCell", bundle: nil), forCellWithReuseIdentifier: kGameCellID) 52 | collectionView.dataSource = self 53 | collectionView.autoresizingMask = [.flexibleWidth, .flexibleHeight] 54 | 55 | // 注册头视图 56 | collectionView.register(UINib(nibName: "CollectionHeaderView", bundle: nil), forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: kHeaderViewID) 57 | 58 | return collectionView 59 | }() 60 | 61 | 62 | // MARK:- 系统方法 63 | override func viewDidLoad() { 64 | super.viewDidLoad() 65 | 66 | view.backgroundColor = UIColor.white 67 | 68 | setupUI() 69 | 70 | loadData() 71 | 72 | } 73 | } 74 | 75 | // MARK:- 请求数据 76 | extension GameViewController { 77 | fileprivate func loadData() { 78 | gameVM.loadAllGameData { 79 | // 1.展示全部游戏 80 | self.collectionView.reloadData() 81 | 82 | // 2.展示常用游戏 83 | // var temArray = [BaseGameModel]() 84 | // for i in 0..<10 { 85 | // temArray.append(self.gameVM.games[i]) 86 | // } 87 | // self.gameView.groups = temArray 88 | /********************获取数组对于范围的数据*************************/ 89 | self.gameView.groups = Array(self.gameVM.games[0..<10]) 90 | 91 | self.loadDataFinshed() 92 | } 93 | } 94 | } 95 | 96 | // MARK:- 设置UI 97 | extension GameViewController { 98 | override func setupUI() { 99 | 100 | // 1.给父类中的内容View的引用进行复制 101 | contentView = collectionView 102 | 103 | view.addSubview(collectionView) 104 | 105 | // 添加顶部的headerView 106 | collectionView.addSubview(topHeaderView) 107 | 108 | // 添加常用游戏的view 109 | collectionView.addSubview(gameView) 110 | 111 | // 设置collectionView的内边距 112 | collectionView.contentInset = UIEdgeInsetsMake(kHeaderViewH+kGameViewH, 0, 0, 0) 113 | 114 | super.setupUI() 115 | } 116 | } 117 | 118 | // MARK:- 遵守UICollectionViewDataSource协议 119 | extension GameViewController : UICollectionViewDataSource 120 | { 121 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 122 | return gameVM.games.count 123 | } 124 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 125 | 126 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kGameCellID, for: indexPath) as! CollectionViewGameCell 127 | 128 | cell.group = gameVM.games[indexPath.item] 129 | return cell 130 | 131 | } 132 | func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { 133 | // 1.取出headerView 134 | let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: kHeaderViewID, for: indexPath) as! CollectionHeaderView 135 | 136 | // 设置属性 137 | headerView.titleLabel.text = "全部" 138 | headerView.iconImageView.image = UIImage(named: "Img_orange") 139 | headerView.moreBtn.isHidden = true 140 | 141 | return headerView 142 | } 143 | } 144 | 145 | // MARK:- 遵守UICollectionView的代理协议协议 146 | extension GameViewController: UICollectionViewDelegate 147 | { 148 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 149 | print(indexPath.item) 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /DouYuZB/DouYuZB/Classs/Home/View/CollectionHeaderView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 39 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | --------------------------------------------------------------------------------