├── .DS_Store ├── README.md └── ioshuanwu ├── .DS_Store ├── ioshuanwu.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ ├── huanyin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── wangpengshuai.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── huanyin.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── ioshuanwu.xcscheme │ │ └── xcschememanagement.plist │ └── wangpengshuai.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── ioshuanwu ├── .DS_Store ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── FMGAVPlayer │ │ ├── Contents.json │ │ ├── MaximumTrackImage.imageset │ │ ├── Contents.json │ │ └── MaximumTrackImage@2x.png │ │ ├── MinimumTrackImage.imageset │ │ ├── Contents.json │ │ └── MinimumTrackImage@2x.png │ │ ├── bg_media_default.imageset │ │ ├── Contents.json │ │ ├── bg_media_default@2x-1.png │ │ └── bg_media_default@2x.png │ │ ├── fast_back.imageset │ │ ├── Contents.json │ │ └── fast_back.png │ │ ├── fast_forward.imageset │ │ ├── Contents.json │ │ └── fast_forward.png │ │ ├── full_minimize_btn.imageset │ │ ├── Contents.json │ │ ├── full_minimize_btn@2x.png │ │ └── full_minimize_btn@3x.png │ │ ├── full_minimize_btn_hl.imageset │ │ ├── Contents.json │ │ ├── full_minimize_btn_hl@2x.png │ │ └── full_minimize_btn_hl@3x.png │ │ ├── full_pause_btn.imageset │ │ ├── Contents.json │ │ ├── full_pause_btn@2x.png │ │ └── full_pause_btn@3x.png │ │ ├── full_pause_btn_hl.imageset │ │ ├── Contents.json │ │ ├── full_pause_btn_hl@2x.png │ │ └── full_pause_btn_hl@3x.png │ │ ├── full_play_btn.imageset │ │ ├── Contents.json │ │ ├── full_play_btn@2x.png │ │ └── full_play_btn@3x.png │ │ ├── full_play_btn_hl.imageset │ │ ├── Contents.json │ │ ├── full_play_btn_hl@2x.png │ │ └── full_play_btn_hl@3x.png │ │ ├── mini_launchFullScreen_btn.imageset │ │ ├── Contents.json │ │ ├── mini_launchFullScreen_btn@2x.png │ │ └── mini_launchFullScreen_btn@3x.png │ │ ├── mini_launchFullScreen_btn_hl.imageset │ │ ├── Contents.json │ │ ├── mini_launchFullScreen_btn_hl@2x.png │ │ └── mini_launchFullScreen_btn_hl@3x.png │ │ └── thumbImage.imageset │ │ ├── Contents.json │ │ └── thumbImage@2x.png ├── Base.lproj │ └── LaunchScreen.storyboard ├── Info.plist ├── Source │ ├── .DS_Store │ ├── AppDelegate │ │ ├── AppDelegate.h │ │ └── AppDelegate.m │ ├── BaseClass │ │ ├── RootTableViewController.h │ │ └── RootTableViewController.m │ ├── CodeClass │ │ ├── HeadView.h │ │ ├── HeadView.m │ │ ├── HeardButton.h │ │ ├── HeardButton.m │ │ ├── HeardTableViewController.h │ │ ├── HeardTableViewController.m │ │ ├── RootTableViewCell.h │ │ ├── RootTableViewCell.m │ │ ├── Video.h │ │ ├── Video.m │ │ ├── VideoSid.h │ │ ├── VideoSid.m │ │ ├── VideoViewController.h │ │ └── VideoViewController.m │ ├── EnNetWork │ │ ├── GetVideoDataTools.h │ │ └── GetVideoDataTools.m │ ├── Macro │ │ ├── APPHeader.h │ │ ├── IMPHeader.h │ │ ├── KEYHeader.h │ │ ├── URLHeader.h │ │ └── iosHuanWuPrefixHeader.h │ ├── Resources │ │ ├── logo.gif │ │ ├── logo.png │ │ ├── play.png │ │ ├── playcount.png │ │ └── time.png │ └── TheThird │ │ ├── .DS_Store │ │ ├── CFDanmaku.h │ │ ├── CFDanmaku.m │ │ ├── CFDanmakuInfo.h │ │ ├── CFDanmakuInfo.m │ │ ├── CFDanmakuView.h │ │ ├── CFDanmakuView.m │ │ ├── FMGAVPlayer │ │ ├── FMGAVPlayer.bundle │ │ │ ├── MaximumTrackImage@2x.png │ │ │ ├── MinimumTrackImage@2x.png │ │ │ ├── bg_media_default@2x.jpg │ │ │ ├── fast_back.png │ │ │ ├── fast_forward.png │ │ │ ├── full_minimize_btn@2x.png │ │ │ ├── full_minimize_btn@3x.png │ │ │ ├── full_minimize_btn_hl@2x.png │ │ │ ├── full_minimize_btn_hl@3x.png │ │ │ ├── full_pause_btn@2x.png │ │ │ ├── full_pause_btn@3x.png │ │ │ ├── full_pause_btn_hl@2x.png │ │ │ ├── full_pause_btn_hl@3x.png │ │ │ ├── full_play_btn@2x.png │ │ │ ├── full_play_btn@3x.png │ │ │ ├── full_play_btn_hl@2x.png │ │ │ ├── full_play_btn_hl@3x.png │ │ │ ├── logo.gif │ │ │ ├── mini_launchFullScreen_btn@2x.png │ │ │ ├── mini_launchFullScreen_btn@3x.png │ │ │ ├── mini_launchFullScreen_btn_hl@2x.png │ │ │ ├── mini_launchFullScreen_btn_hl@3x.png │ │ │ └── thumbImage@2x.png │ │ ├── FMGVideoPlayView.h │ │ ├── FMGVideoPlayView.m │ │ ├── FMGVideoPlayView.xib │ │ ├── FullView.h │ │ ├── FullView.m │ │ ├── FullViewController.h │ │ └── FullViewController.m │ │ ├── MJRefresh │ │ ├── Base │ │ │ ├── MJRefreshAutoFooter.h │ │ │ ├── MJRefreshAutoFooter.m │ │ │ ├── MJRefreshBackFooter.h │ │ │ ├── MJRefreshBackFooter.m │ │ │ ├── MJRefreshComponent.h │ │ │ ├── MJRefreshComponent.m │ │ │ ├── MJRefreshFooter.h │ │ │ ├── MJRefreshFooter.m │ │ │ ├── MJRefreshHeader.h │ │ │ └── MJRefreshHeader.m │ │ ├── Custom │ │ │ ├── Footer │ │ │ │ ├── Auto │ │ │ │ │ ├── MJRefreshAutoGifFooter.h │ │ │ │ │ ├── MJRefreshAutoGifFooter.m │ │ │ │ │ ├── MJRefreshAutoNormalFooter.h │ │ │ │ │ ├── MJRefreshAutoNormalFooter.m │ │ │ │ │ ├── MJRefreshAutoStateFooter.h │ │ │ │ │ └── MJRefreshAutoStateFooter.m │ │ │ │ └── Back │ │ │ │ │ ├── MJRefreshBackGifFooter.h │ │ │ │ │ ├── MJRefreshBackGifFooter.m │ │ │ │ │ ├── MJRefreshBackNormalFooter.h │ │ │ │ │ ├── MJRefreshBackNormalFooter.m │ │ │ │ │ ├── MJRefreshBackStateFooter.h │ │ │ │ │ └── MJRefreshBackStateFooter.m │ │ │ └── Header │ │ │ │ ├── MJRefreshGifHeader.h │ │ │ │ ├── MJRefreshGifHeader.m │ │ │ │ ├── MJRefreshNormalHeader.h │ │ │ │ ├── MJRefreshNormalHeader.m │ │ │ │ ├── MJRefreshStateHeader.h │ │ │ │ └── MJRefreshStateHeader.m │ │ ├── MJRefresh.bundle │ │ │ └── arrow@2x.png │ │ ├── MJRefresh.h │ │ ├── MJRefreshConst.h │ │ ├── MJRefreshConst.m │ │ ├── UIScrollView+MJExtension.h │ │ ├── UIScrollView+MJExtension.m │ │ ├── UIScrollView+MJRefresh.h │ │ ├── UIScrollView+MJRefresh.m │ │ ├── UIView+MJExtension.h │ │ └── UIView+MJExtension.m │ │ ├── SDWebImage │ │ ├── .svn │ │ │ ├── entries │ │ │ ├── format │ │ │ ├── pristine │ │ │ │ ├── 20 │ │ │ │ │ └── 2074587bedadcefbff98e8590a2d42b7448a7326.svn-base │ │ │ │ ├── 25 │ │ │ │ │ └── 25969c88968e7c352a185561688f04247b4ff7a1.svn-base │ │ │ │ ├── 38 │ │ │ │ │ └── 38db0c0ffd80e3fe0c42efac74cff476985721dd.svn-base │ │ │ │ ├── 48 │ │ │ │ │ └── 48d247e43ececb4bf2b55c0e593096e5cf0ef170.svn-base │ │ │ │ ├── 63 │ │ │ │ │ └── 63e29cd1bda4b1316fa055102956f90a8e214796.svn-base │ │ │ │ ├── 67 │ │ │ │ │ ├── 67a518a5b2a75f5616f3fa164c3398d0e30bd6ad.svn-base │ │ │ │ │ └── 67ad6e35b051a092f1a139cc5e58b2d800d22004.svn-base │ │ │ │ ├── 71 │ │ │ │ │ └── 71db3c2bcc91b242865adab1bd5b4f0e62bffe0c.svn-base │ │ │ │ ├── 03 │ │ │ │ │ └── 037b7d1e426452192153dc84b4c6c516b04d0e02.svn-base │ │ │ │ ├── 09 │ │ │ │ │ └── 09bdfe405060f722eb541fbdb6285d064373865f.svn-base │ │ │ │ ├── 2e │ │ │ │ │ └── 2ed3c37607527c8fee3d5a3078b47af165ae8247.svn-base │ │ │ │ ├── 4b │ │ │ │ │ └── 4b9bce3d9d059aff1684fb42f1fa7688cf54e13b.svn-base │ │ │ │ ├── 4f │ │ │ │ │ └── 4f1d98331b13d165c01eff313fbd127b30071f3a.svn-base │ │ │ │ ├── 6b │ │ │ │ │ └── 6b3378061f6886e54b3dfb5ff5610903f0005e85.svn-base │ │ │ │ ├── 7c │ │ │ │ │ └── 7c5002551466f2c235843f96a8cd0cf47231cf2f.svn-base │ │ │ │ ├── a7 │ │ │ │ │ └── a78d714b2e435e97793ab3a819bc19eee897bdcf.svn-base │ │ │ │ ├── ae │ │ │ │ │ └── aecce2f11adaaf46574776439ea4c61bc98a9494.svn-base │ │ │ │ ├── bb │ │ │ │ │ └── bb8f27145c876e285aecac88a791747cb5c89fd4.svn-base │ │ │ │ ├── bd │ │ │ │ │ └── bdf510558c208a7f68839fb4dcb86bc3a28bf076.svn-base │ │ │ │ ├── d7 │ │ │ │ │ └── d70db16978149e237998f8c8062573697030e330.svn-base │ │ │ │ ├── da │ │ │ │ │ └── da65f4fa0be8c1e68aa1aa3a46b76791a6030fae.svn-base │ │ │ │ ├── db │ │ │ │ │ └── db5ba3a9c55e7166b9db54e9e3d5155c5cc690b0.svn-base │ │ │ │ ├── e0 │ │ │ │ │ └── e08c7c1e5862b0017c169269ccda4bf201088923.svn-base │ │ │ │ ├── e3 │ │ │ │ │ └── e34b1cdcfc01cddcc52f78f8ba5ab3102dfc90c0.svn-base │ │ │ │ ├── e7 │ │ │ │ │ └── e73bf1494c4e0491d3225ccb624be32fab494c94.svn-base │ │ │ │ ├── ee │ │ │ │ │ ├── ee1b16a1b19a25fa62a74641f5d2d0a0158deae1.svn-base │ │ │ │ │ └── ee436375bc3765951275c9c11aa51d9d1afe2049.svn-base │ │ │ │ ├── f6 │ │ │ │ │ └── f6379654db2f6b280c3e79a674b301902b76fcf7.svn-base │ │ │ │ └── fe │ │ │ │ │ └── fe3b428c717c4ac8e1f5e55984456317e43b2403.svn-base │ │ │ └── wc.db │ │ ├── NSData+ImageContentType.h │ │ ├── NSData+ImageContentType.m │ │ ├── SDImageCache.h │ │ ├── SDImageCache.m │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageCompat.m │ │ ├── SDWebImageDecoder.h │ │ ├── SDWebImageDecoder.m │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloader.m │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageDownloaderOperation.m │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageManager.m │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImagePrefetcher.m │ │ ├── UIButton+WebCache.h │ │ ├── UIButton+WebCache.m │ │ ├── UIImage+GIF.h │ │ ├── UIImage+GIF.m │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImage+MultiFormat.m │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+HighlightedWebCache.m │ │ ├── UIImageView+WebCache.h │ │ ├── UIImageView+WebCache.m │ │ ├── UIView+WebCacheOperation.h │ │ └── UIView+WebCacheOperation.m │ │ └── danmakufile └── main.m ├── ioshuanwuTests ├── Info.plist └── ioshuanwuTests.m └── ioshuanwuUITests ├── Info.plist └── ioshuanwuUITests.m /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/.DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # avplayer 2 | 在cell中播放视频,仿网易新闻视频播放技术;wps 3 | -------------------------------------------------------------------------------- /ioshuanwu/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/.DS_Store -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu.xcodeproj/project.xcworkspace/xcuserdata/huanyin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu.xcodeproj/project.xcworkspace/xcuserdata/huanyin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu.xcodeproj/project.xcworkspace/xcuserdata/wangpengshuai.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu.xcodeproj/project.xcworkspace/xcuserdata/wangpengshuai.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu.xcodeproj/xcuserdata/huanyin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu.xcodeproj/xcuserdata/huanyin.xcuserdatad/xcschemes/ioshuanwu.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu.xcodeproj/xcuserdata/huanyin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ioshuanwu.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D1C37C4D1C2FB9FD00842069 16 | 17 | primary 18 | 19 | 20 | D1C37C661C2FB9FD00842069 21 | 22 | primary 23 | 24 | 25 | D1C37C711C2FB9FD00842069 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu.xcodeproj/xcuserdata/wangpengshuai.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ioshuanwu.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/.DS_Store -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/MaximumTrackImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "MaximumTrackImage@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 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/MaximumTrackImage.imageset/MaximumTrackImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/MaximumTrackImage.imageset/MaximumTrackImage@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/MinimumTrackImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "MinimumTrackImage@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 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/MinimumTrackImage.imageset/MinimumTrackImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/MinimumTrackImage.imageset/MinimumTrackImage@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/bg_media_default.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "bg_media_default@2x-1.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/bg_media_default.imageset/bg_media_default@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/bg_media_default.imageset/bg_media_default@2x-1.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/bg_media_default.imageset/bg_media_default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/bg_media_default.imageset/bg_media_default@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/fast_back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "fast_back.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/fast_back.imageset/fast_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/fast_back.imageset/fast_back.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/fast_forward.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "fast_forward.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/fast_forward.imageset/fast_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/fast_forward.imageset/fast_forward.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "full_minimize_btn@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "full_minimize_btn@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn.imageset/full_minimize_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn.imageset/full_minimize_btn@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn.imageset/full_minimize_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn.imageset/full_minimize_btn@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn_hl.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "full_minimize_btn_hl@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "full_minimize_btn_hl@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn_hl.imageset/full_minimize_btn_hl@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn_hl.imageset/full_minimize_btn_hl@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn_hl.imageset/full_minimize_btn_hl@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_minimize_btn_hl.imageset/full_minimize_btn_hl@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "full_pause_btn@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "full_pause_btn@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn.imageset/full_pause_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn.imageset/full_pause_btn@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn.imageset/full_pause_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn.imageset/full_pause_btn@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn_hl.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "full_pause_btn_hl@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "full_pause_btn_hl@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn_hl.imageset/full_pause_btn_hl@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn_hl.imageset/full_pause_btn_hl@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn_hl.imageset/full_pause_btn_hl@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_pause_btn_hl.imageset/full_pause_btn_hl@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "full_play_btn@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "full_play_btn@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn.imageset/full_play_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn.imageset/full_play_btn@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn.imageset/full_play_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn.imageset/full_play_btn@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn_hl.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "full_play_btn_hl@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "full_play_btn_hl@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn_hl.imageset/full_play_btn_hl@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn_hl.imageset/full_play_btn_hl@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn_hl.imageset/full_play_btn_hl@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/full_play_btn_hl.imageset/full_play_btn_hl@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mini_launchFullScreen_btn@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mini_launchFullScreen_btn@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn.imageset/mini_launchFullScreen_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn.imageset/mini_launchFullScreen_btn@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn.imageset/mini_launchFullScreen_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn.imageset/mini_launchFullScreen_btn@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn_hl.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mini_launchFullScreen_btn_hl@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mini_launchFullScreen_btn_hl@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn_hl.imageset/mini_launchFullScreen_btn_hl@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn_hl.imageset/mini_launchFullScreen_btn_hl@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn_hl.imageset/mini_launchFullScreen_btn_hl@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/mini_launchFullScreen_btn_hl.imageset/mini_launchFullScreen_btn_hl@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/thumbImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "thumbImage@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 | } -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/thumbImage.imageset/thumbImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Assets.xcassets/FMGAVPlayer/thumbImage.imageset/thumbImage@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/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 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/.DS_Store -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/AppDelegate/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/27. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/AppDelegate/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/27. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 21 | self.window.backgroundColor = [UIColor whiteColor]; 22 | [self.window makeKeyAndVisible]; 23 | 24 | RootTableViewController *rootVC = [[RootTableViewController alloc] init]; 25 | UINavigationController *rootNC = [[UINavigationController alloc] initWithRootViewController:rootVC]; 26 | self.window.rootViewController = rootNC; 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application { 31 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 32 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 33 | } 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application { 36 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 37 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 38 | } 39 | 40 | - (void)applicationWillEnterForeground:(UIApplication *)application { 41 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(UIApplication *)application { 45 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 46 | } 47 | 48 | - (void)applicationWillTerminate:(UIApplication *)application { 49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/BaseClass/RootTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootTableViewController.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/27. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RootTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/HeadView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HeadView.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/27. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // tableView的heardView 8 | 9 | #import 10 | 11 | @class HeardButton; 12 | @interface HeadView : UIView 13 | 14 | @property (nonatomic, strong) HeardButton * leftOneButton; 15 | @property (nonatomic, strong) HeardButton * leftTwoButton; 16 | @property (nonatomic, strong) HeardButton * rightOneButton; 17 | @property (nonatomic, strong) HeardButton * rigthTwoButton; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/HeadView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HeadView.m 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/27. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import "HeadView.h" 10 | 11 | @implementation HeadView 12 | 13 | - (UIButton *) leftOneButton 14 | { 15 | if (_leftOneButton == nil) { 16 | self.leftOneButton = [HeardButton buttonWithType:UIButtonTypeInfoDark]; 17 | self.leftOneButton.frame = CGRectMake(0, 0, kScreenWidth/5, kScreenWidth/5); 18 | self.leftOneButton.nameLabel.textAlignment = NSTextAlignmentCenter; 19 | self.leftOneButton.nameLabel.textColor = [UIColor darkGrayColor]; 20 | self.leftOneButton.nameLabel.font = [UIFont systemFontOfSize:14]; 21 | [self addSubview:_leftOneButton]; 22 | } 23 | return _leftOneButton; 24 | } 25 | - (UIButton *) leftTwoButton 26 | { 27 | if (_leftTwoButton == nil) { 28 | self.leftTwoButton = [HeardButton buttonWithType:UIButtonTypeSystem]; 29 | self.leftTwoButton.frame = CGRectMake(CGRectGetMaxX(self.leftOneButton.frame),CGRectGetMinY(self.leftOneButton.frame),CGRectGetWidth(self.leftOneButton.frame),CGRectGetHeight(self.leftOneButton.frame)); 30 | self.leftTwoButton.nameLabel.textAlignment = NSTextAlignmentCenter; 31 | self.leftTwoButton.nameLabel.textColor = [UIColor darkGrayColor]; 32 | self.leftTwoButton.nameLabel.font = [UIFont systemFontOfSize:14]; 33 | [self addSubview:_leftTwoButton]; 34 | } 35 | return _leftTwoButton; 36 | } 37 | - (UIButton *) rightOneButton 38 | { 39 | if (_rightOneButton == nil) { 40 | self.rightOneButton = [HeardButton buttonWithType:UIButtonTypeSystem]; 41 | self.rightOneButton.frame = CGRectMake(CGRectGetMaxX(self.leftTwoButton.frame), CGRectGetMinY(self.leftTwoButton.frame), CGRectGetWidth(self.leftTwoButton.frame), CGRectGetHeight(self.leftTwoButton.frame)); 42 | self.rightOneButton.nameLabel.textAlignment = NSTextAlignmentCenter; 43 | self.rightOneButton.nameLabel.textColor = [UIColor darkGrayColor]; 44 | self.rightOneButton.nameLabel.font = [UIFont systemFontOfSize:14]; 45 | [self addSubview:_rightOneButton]; 46 | } 47 | return _rightOneButton; 48 | } 49 | - (UIButton *) rigthTwoButton 50 | { 51 | if (_rigthTwoButton == nil) { 52 | self.rigthTwoButton = [HeardButton buttonWithType:UIButtonTypeSystem]; 53 | self.rigthTwoButton.frame = CGRectMake(CGRectGetMaxX(self.rightOneButton.frame), CGRectGetMinY(self.leftTwoButton.frame), CGRectGetWidth(self.leftTwoButton.frame), CGRectGetHeight(self.leftTwoButton.frame)); 54 | self.rigthTwoButton.nameLabel.textAlignment = NSTextAlignmentCenter; 55 | self.rigthTwoButton.nameLabel.textColor = [UIColor darkGrayColor]; 56 | self.rigthTwoButton.nameLabel.font = [UIFont systemFontOfSize:14]; 57 | [self addSubview:_rigthTwoButton]; 58 | } 59 | return _rigthTwoButton; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/HeardButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // HeardButton.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | @class VideoSid; 11 | 12 | @interface HeardButton : UIButton 13 | 14 | @property (nonatomic, strong) UIImageView * titleImage; 15 | @property (nonatomic, strong) UILabel * nameLabel; 16 | @property (nonatomic, strong) VideoSid * videoSid; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/HeardButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // HeardButton.m 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import "HeardButton.h" 10 | 11 | @implementation HeardButton 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | { 15 | if ([super initWithFrame:frame]) { 16 | self.videoSid = [[VideoSid alloc] init]; 17 | } 18 | return self; 19 | } 20 | 21 | - (UIImageView *)titleImage 22 | { 23 | if (_titleImage == nil) { 24 | self.titleImage = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.frame)/4, 10, CGRectGetWidth(self.frame)/2, CGRectGetWidth(self.frame)/2)]; 25 | self.titleImage.layer.cornerRadius = CGRectGetWidth(self.frame)/2*0.5; 26 | self.titleImage.layer.masksToBounds = YES; 27 | [self.titleImage sd_setImageWithURL:[NSURL URLWithString:_videoSid.imgsrc] placeholderImage:[UIImage imageNamed:@"logo"]]; 28 | [self addSubview:_titleImage]; 29 | } 30 | return _titleImage; 31 | } 32 | 33 | - (UILabel *)nameLabel 34 | { 35 | if (_nameLabel == nil) { 36 | self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.titleImage.frame), CGRectGetMaxY(self.titleImage.frame)+5, CGRectGetWidth(self.titleImage.frame), CGRectGetHeight(self.titleImage.frame)/2)]; 37 | self.nameLabel.text = _videoSid.title; 38 | [self addSubview:_nameLabel]; 39 | } 40 | return _nameLabel; 41 | } 42 | 43 | 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/HeardTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HeardTableViewController.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 16/1/4. 6 | // Copyright © 2016年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HeardTableViewController : UITableViewController 12 | 13 | @property (nonatomic, strong) VideoSid * videoSid; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/RootTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootTableViewCell.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | @class FMGVideoPlayView; 11 | @interface RootTableViewCell : UITableViewCell 12 | 13 | @property (nonatomic, strong) UILabel * title; 14 | @property (nonatomic, strong) UILabel * descriptionLabel; 15 | @property (nonatomic, strong) FMGVideoPlayView * playerView; 16 | @property (nonatomic, strong) UIImageView * timeImage; 17 | @property (nonatomic, strong) UILabel * timeLabel; 18 | @property (nonatomic, strong) UIImageView * playCountImage; 19 | @property (nonatomic, strong) UILabel * playCountLabel; 20 | @property (nonatomic, strong) UIButton * replyButton; 21 | @property (nonatomic, strong) UIButton * shareButton; 22 | @property (nonatomic, strong) UIImageView * backImage; 23 | @property (nonatomic, strong) UIButton * playButton; 24 | 25 | @property (nonatomic, strong) Video * video; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/RootTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootTableViewCell.m 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import "RootTableViewCell.h" 10 | 11 | @implementation RootTableViewCell 12 | 13 | - (UILabel *)title 14 | { 15 | if (_title == nil) { 16 | self.title = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, kScreenWidth-20, 20)]; 17 | // self.title.font = [UIFont systemFontOfSize:] 18 | [self.contentView addSubview:_title]; 19 | } 20 | return _title; 21 | } 22 | 23 | - (UILabel *)descriptionLabel 24 | { 25 | if (_descriptionLabel == nil) { 26 | self.descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.title.frame), CGRectGetMaxY(self.title.frame), CGRectGetWidth(self.title.frame), 20)]; 27 | self.descriptionLabel.textColor = [UIColor grayColor]; 28 | self.descriptionLabel.font = [UIFont systemFontOfSize:14]; 29 | [self.contentView addSubview:_descriptionLabel]; 30 | } 31 | return _descriptionLabel; 32 | } 33 | 34 | - (UIImageView *)backImage 35 | { 36 | if (_backImage == nil) { 37 | self.backImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.descriptionLabel.frame), kScreenWidth, CGRectGetWidth(self.title.frame)/2)]; 38 | [self.contentView addSubview:_backImage]; 39 | } 40 | return _backImage; 41 | } 42 | 43 | - (UIButton *)playButton{ 44 | if (_playButton == nil) { 45 | self.playButton = [UIButton buttonWithType:UIButtonTypeSystem]; 46 | self.playButton.frame = CGRectMake(0, 0, 50, 50); 47 | self.playButton.center = self.backImage.center; 48 | // self.playButton.backgroundColor = [UIColor yellowColor]; 49 | [self.contentView addSubview:_playButton]; 50 | } 51 | return _playButton; 52 | } 53 | 54 | - (UIImageView *)timeImage 55 | { 56 | if (_timeImage == nil) { 57 | self.timeImage = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.title.frame), CGRectGetMaxY(self.backImage.frame)+10, 20, 20)]; 58 | [self.contentView addSubview:_timeImage]; 59 | } 60 | return _timeImage; 61 | } 62 | 63 | - (UILabel *)timeLabel 64 | { 65 | if (_timeLabel == nil) { 66 | self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.timeImage.frame), CGRectGetMinY(self.timeImage.frame), CGRectGetWidth(self.timeImage.frame) * 2.5, CGRectGetHeight(self.timeImage.frame))]; 67 | self.timeLabel.font = [UIFont systemFontOfSize:14]; 68 | [self.contentView addSubview:_timeLabel]; 69 | } 70 | return _timeLabel; 71 | } 72 | 73 | - (UIImageView *)playCountImage 74 | { 75 | if (_playCountImage == nil) { 76 | self.playCountImage = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.timeLabel.frame), CGRectGetMinY(self.timeLabel.frame), CGRectGetWidth(self.timeImage.frame), CGRectGetHeight(self.timeImage.frame))]; 77 | [self.contentView addSubview:_playCountImage]; 78 | } 79 | return _playCountImage; 80 | } 81 | 82 | - (UILabel *)playCountLabel 83 | { 84 | if (_playCountLabel == nil) { 85 | self.playCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.playCountImage.frame), CGRectGetMinY(self.playCountImage.frame), CGRectGetWidth(self.timeLabel.frame), CGRectGetHeight(self.playCountImage.frame))]; 86 | self.playCountLabel.font = [UIFont systemFontOfSize:14]; 87 | [self.contentView addSubview:_playCountLabel]; 88 | } 89 | return _playCountLabel; 90 | } 91 | 92 | - (UIButton *)replyButton 93 | { 94 | if (_replyButton == nil) { 95 | self.replyButton = [UIButton buttonWithType:UIButtonTypeSystem]; 96 | self.replyButton.frame = CGRectMake(CGRectGetMaxX(self.playerView.frame) - 30, CGRectGetMinY(self.playCountLabel.frame), 15, 15); 97 | [self addSubview:_replyButton]; 98 | } 99 | return _replyButton; 100 | } 101 | 102 | - (UIButton *)shareButton 103 | { 104 | if (_shareButton == nil) { 105 | self.shareButton = [UIButton buttonWithType:UIButtonTypeSystem]; 106 | self.replyButton.frame = CGRectMake(CGRectGetMaxX(self.replyButton.frame), CGRectGetMinY(self.replyButton.frame), CGRectGetWidth(self.replyButton.frame), CGRectGetHeight(self.replyButton.frame)); 107 | [self.contentView addSubview:_shareButton]; 108 | } 109 | return _shareButton; 110 | } 111 | 112 | - (void)setVideo:(Video *)video 113 | { 114 | self.title.text = video.title; 115 | self.descriptionLabel.text = video.descriptionDe; 116 | [self.backImage sd_setImageWithURL:[NSURL URLWithString:video.cover] placeholderImage:[UIImage imageNamed:@"logo"]]; 117 | self.playCountLabel.text = [NSString stringWithFormat:@"%ld.%ld万",video.playCount/10000,video.playCount/1000-video.playCount/10000]; 118 | self.timeLabel.text = [video.ptime substringWithRange:NSMakeRange(12, 4)]; 119 | [self.playButton setBackgroundImage:[UIImage imageNamed:@"play"] forState:UIControlStateNormal]; 120 | self.playCountImage.image = [UIImage imageNamed:@"playcount"]; 121 | self.timeImage.image = [UIImage imageNamed:@"time"]; 122 | 123 | } 124 | 125 | - (void)awakeFromNib { 126 | // Initialization code 127 | } 128 | 129 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 130 | [super setSelected:selected animated:animated]; 131 | 132 | // Configure the view for the selected state 133 | } 134 | 135 | 136 | 137 | 138 | @end 139 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/Video.h: -------------------------------------------------------------------------------- 1 | // 2 | // Video.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 视频Model 8 | 9 | #import 10 | 11 | @interface Video : NSObject 12 | 13 | @property (nonatomic, strong) NSString * cover; 14 | @property (nonatomic, strong) NSString * descriptionDe; 15 | @property (nonatomic, assign) NSInteger length; 16 | @property (nonatomic, strong) NSString * m3u8_url; 17 | @property (nonatomic, strong) NSString * m3u8Hd_url; 18 | @property (nonatomic, strong) NSString * mp4_url; 19 | @property (nonatomic, strong) NSString * mp4_Hd_url; 20 | @property (nonatomic, assign) NSInteger playCount; 21 | @property (nonatomic, strong) NSString * playersize; 22 | @property (nonatomic, strong) NSString * ptime; 23 | @property (nonatomic, strong) NSString * replyBoard; 24 | @property (nonatomic, strong) NSString * replyCount; 25 | @property (nonatomic, strong) NSString * replyid; 26 | @property (nonatomic, strong) NSString * title; 27 | @property (nonatomic, strong) NSString * vid; 28 | @property (nonatomic, strong) NSString * videosource; 29 | 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/Video.m: -------------------------------------------------------------------------------- 1 | // 2 | // Video.m 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import "Video.h" 10 | 11 | @implementation Video 12 | 13 | - (void)setValue:(id)value forUndefinedKey:(NSString *)key 14 | { 15 | if ([key isEqualToString:@"description"]) { 16 | self.descriptionDe = value; 17 | } 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/VideoSid.h: -------------------------------------------------------------------------------- 1 | // 2 | // VideoSid.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 主页上方Model 8 | 9 | #import 10 | 11 | @interface VideoSid : NSObject 12 | 13 | @property (nonatomic, strong) NSString * imgsrc; 14 | @property (nonatomic, strong) NSString * sid; 15 | @property (nonatomic, strong) NSString * title; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/VideoSid.m: -------------------------------------------------------------------------------- 1 | // 2 | // VideoSid.m 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import "VideoSid.h" 10 | 11 | @implementation VideoSid 12 | 13 | - (void)setValue:(id)value forUndefinedKey:(NSString *)key 14 | { 15 | 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/CodeClass/VideoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // VideoViewController.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FullViewController; 12 | 13 | @interface VideoViewController : UIViewController 14 | 15 | @property (nonatomic, strong) Video *video; 16 | @property (nonatomic, strong) FMGVideoPlayView *playView; 17 | @property (nonatomic, assign) NSInteger index; 18 | @property (nonatomic, strong) UITextField * testDanma; 19 | @property (nonatomic, strong) UIButton * sendButton; 20 | @property (nonatomic, strong) UIButton * hiddenButton; 21 | 22 | 23 | 24 | + (instancetype) shareVideoController; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/EnNetWork/GetVideoDataTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // GetVideoDataTools.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | // heardViewArray 11 | typedef void(^HeardValue)(NSArray *heardArray,NSArray *videoArray); 12 | 13 | typedef void(^ListValue)(NSArray *listArray); 14 | 15 | @interface GetVideoDataTools : NSObject 16 | 17 | @property (nonatomic, strong) NSMutableArray * dataArray; 18 | 19 | // 单例 20 | + (instancetype)shareDataTools; 21 | // 根据URL获取数据 22 | - (void)getHeardDataWithURL:(NSString *)URL HeardValue:(HeardValue) heardValue; 23 | 24 | // 根据URL及VideoSid获得数据 25 | - (void)getListDataWithURL:(NSString *)URL ListID:(NSString *)ID ListValue:(ListValue) listValue; 26 | 27 | // 根据index返回一个Video 28 | - (Video *)getModelWithIndex:(NSInteger)index; 29 | 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/EnNetWork/GetVideoDataTools.m: -------------------------------------------------------------------------------- 1 | // 2 | // GetVideoDataTools.m 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/28. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import "GetVideoDataTools.h" 10 | 11 | @implementation GetVideoDataTools 12 | 13 | + (instancetype)shareDataTools 14 | { 15 | static GetVideoDataTools *gd = nil; 16 | static dispatch_once_t token; 17 | if (gd == nil) { 18 | dispatch_once(&token, ^{ 19 | gd = [[GetVideoDataTools alloc] init]; 20 | }); 21 | } 22 | return gd; 23 | } 24 | 25 | - (void)getHeardDataWithURL:(NSString *)URL HeardValue:(HeardValue)heardValue 26 | { 27 | dispatch_queue_t global_t = dispatch_get_global_queue(0, 0); 28 | dispatch_async(global_t, ^{ 29 | NSURL *url = [NSURL URLWithString:URL]; 30 | NSMutableArray *heardArray = [NSMutableArray array]; 31 | NSMutableArray *videoArray = [NSMutableArray array]; 32 | [NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url] queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * response, NSData * data, NSError * connectionError) { 33 | if (data == nil) { 34 | NSLog(@"错误%@",connectionError); 35 | return ; 36 | } 37 | NSDictionary * dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil]; 38 | NSArray *videoList = [dict objectForKey:@"videoList"]; 39 | NSArray *videoSidList = [dict objectForKey:@"videoSidList"]; 40 | for (NSDictionary * video in videoList) { 41 | Video * v = [[Video alloc] init]; 42 | [v setValuesForKeysWithDictionary:video]; 43 | [videoArray addObject:v]; 44 | } 45 | [self.dataArray addObjectsFromArray:videoArray]; 46 | // 加载头标题 47 | for (NSDictionary *d in videoSidList) { 48 | VideoSid *g = [[VideoSid alloc] init]; 49 | [g setValuesForKeysWithDictionary:d]; 50 | [heardArray addObject:g]; 51 | } 52 | heardValue(heardArray,videoArray); 53 | }]; 54 | 55 | }); 56 | 57 | } 58 | 59 | - (void)getListDataWithURL:(NSString *)URL ListID:(NSString *)ID ListValue:(ListValue) listValue{ 60 | dispatch_queue_t global_t = dispatch_get_global_queue(0, 0); 61 | dispatch_async(global_t, ^{ 62 | NSURL *url = [NSURL URLWithString:URL]; 63 | NSMutableArray *listArray = [NSMutableArray array]; 64 | [NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url] queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * response, NSData * data, NSError * connectionError) { 65 | if (data == nil) { 66 | NSLog(@"错误%@",connectionError); 67 | return ; 68 | } 69 | NSDictionary * dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil]; 70 | NSArray *videoList = [dict objectForKey:ID]; 71 | for (NSDictionary * video in videoList) { 72 | Video * v = [[Video alloc] init]; 73 | [v setValuesForKeysWithDictionary:video]; 74 | [listArray addObject:v]; 75 | } 76 | listValue(listArray); 77 | }]; 78 | 79 | }); 80 | 81 | } 82 | 83 | // 懒加载初始数组 84 | - (NSMutableArray *)dataArray 85 | { 86 | if (_dataArray == nil) { 87 | self.dataArray = [NSMutableArray array]; 88 | } 89 | return _dataArray; 90 | } 91 | 92 | 93 | - (Video *)getModelWithIndex:(NSInteger)index 94 | { 95 | return self.dataArray[index]; 96 | } 97 | 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Macro/APPHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // APPHeader.h 3 | // ProjectMusic 4 | // 5 | // Created by young on 15/7/31. 6 | // Copyright (c) 2015年 young. All rights reserved. 7 | // 这里存放普通的app宏定义和声明等信息. 8 | 9 | #ifndef Project_APPHeader_h 10 | #define Project_APPHeader_h 11 | 12 | #define kScreenWidth CGRectGetWidth([UIScreen mainScreen].bounds) 13 | #define kScreenHeight CGRectGetHeight([UIScreen mainScreen].bounds) 14 | 15 | #import "RootTableViewController.h" 16 | #import "HeadView.h" 17 | #import "HeardButton.h" 18 | #import "VideoSid.h" 19 | #import "Video.h" 20 | #import "GetVideoDataTools.h" 21 | #import "RootTableViewCell.h" 22 | #import "VideoViewController.h" 23 | #import "HeardTableViewController.h" 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 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | //TODO 提示 74 | #define STRINGIFY(S) #S 75 | #define DEFER_STRINGIFY(S) STRINGIFY(S) 76 | #define PRAGMA_MESSAGE(MSG) _Pragma(STRINGIFY(message(MSG))) 77 | #define FORMATTED_MESSAGE(MSG) "[TODO-" DEFER_STRINGIFY(__COUNTER__) "] " MSG " \n" \ 78 | DEFER_STRINGIFY(__FILE__) " line " DEFER_STRINGIFY(__LINE__) 79 | #define KEYWORDIFY try {} @catch (...) {} 80 | // 最终使用下面的宏 81 | #define TODO(MSG) KEYWORDIFY PRAGMA_MESSAGE(FORMATTED_MESSAGE(MSG)) 82 | 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Macro/IMPHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMPHeader.h 3 | // ProjectMusic 4 | // 5 | // Created by young on 15/7/31. 6 | // Copyright (c) 2015年 young. All rights reserved. 7 | // 这里存放三方的头文件/框架引用 8 | 9 | #ifndef Project_IMPHeader_h 10 | #define Project_IMPHeader_h 11 | 12 | #import "UIImageView+WebCache.h" // 图片请求 13 | #import "FMGVideoPlayView.h" // 播放器视图 14 | #import "MJRefresh.h" // 上拉刷新 15 | #import "CFDanmakuView.h" 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Macro/KEYHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // KEYHeader.h 3 | // ProjectMusic 4 | // 5 | // Created by young on 15/7/31. 6 | // Copyright (c) 2015年 young. All rights reserved. 7 | // 这里是三方key的声明/宏定义. 8 | 9 | #ifndef Project_KEYHeader_h 10 | #define Project_KEYHeader_h 11 | 12 | 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Macro/URLHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // URLHeader.h 3 | // ProjectMusic 4 | // 5 | // Created by young on 15/7/31. 6 | // Copyright (c) 2015年 young. All rights reserved. 7 | // 这里是URL信息 8 | 9 | #ifndef Project_URLHeader_h 10 | #define Project_URLHeader_h 11 | 12 | #define homeURL @"http://c.m.163.com/nc/video/home/0-10.html" 13 | #define moreURL @"http://c.m.163.com/nc/video/home/%ld-10.html" 14 | #define listURL @"http://c.3g.163.com/nc/video/list/%@/y/0-10.html" 15 | #define listMoreURL @"http://c.3g.163.com/nc/video/list/%@/y/%ld-10.html" 16 | #endif 17 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Macro/iosHuanWuPrefixHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // iosHuanWuPrefixHeader.h 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/27. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #ifndef iosHuanWuPrefixHeader_h 10 | #define iosHuanWuPrefixHeader_h 11 | 12 | #import "APPHeader.h" 13 | #import "IMPHeader.h" 14 | #import "KEYHeader.h" 15 | #import "URLHeader.h" 16 | 17 | 18 | #endif /* iosHuanWuPrefixHeader_h */ 19 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Resources/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/Resources/logo.gif -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/Resources/logo.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Resources/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/Resources/play.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Resources/playcount.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/Resources/playcount.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/Resources/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/Resources/time.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/.DS_Store -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/CFDanmaku.h: -------------------------------------------------------------------------------- 1 | // 2 | // CFDanmaku.h 3 | // 31- CFDanmakuDemo 4 | // 5 | // Created by 于 传峰 on 15/7/9. 6 | // Copyright (c) 2015年 于 传峰. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum : NSInteger { 12 | CFDanmakuPositionNone = 0, 13 | CFDanmakuPositionCenterTop, 14 | CFDanmakuPositionCenterBottom 15 | } CFDanmakuPosition; 16 | 17 | @interface CFDanmaku : NSObject 18 | 19 | // 对应视频的时间戳 20 | @property(nonatomic, assign) NSTimeInterval timePoint; 21 | // 弹幕内容 22 | @property(nonatomic, copy) NSAttributedString* contentStr; 23 | // 弹幕类型(如果不设置 默认情况下只是从右到左滚动) 24 | @property(nonatomic, assign) CFDanmakuPosition position; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/CFDanmaku.m: -------------------------------------------------------------------------------- 1 | // 2 | // CFDanmaku.m 3 | // 31- CFDanmakuDemo 4 | // 5 | // Created by 于 传峰 on 15/7/9. 6 | // Copyright (c) 2015年 于 传峰. All rights reserved. 7 | // 8 | 9 | #import "CFDanmaku.h" 10 | 11 | @implementation CFDanmaku 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/CFDanmakuInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // CFDanmakuInfo.h 3 | // HJDanmakuDemo 4 | // 5 | // Created by 于 传峰 on 15/7/10. 6 | // Copyright (c) 2015年 olinone. All rights reserved. 7 | // 8 | 9 | #import 10 | @class CFDanmaku; 11 | 12 | @interface CFDanmakuInfo : NSObject 13 | 14 | // 弹幕内容label 15 | @property(nonatomic, weak) UILabel *playLabel; 16 | // 弹幕label frame 17 | //@property(nonatomic, assign) CGRect labelFrame; 18 | // 19 | @property(nonatomic, assign) NSTimeInterval leftTime; 20 | @property(nonatomic, strong) CFDanmaku* danmaku; 21 | @property(nonatomic, assign) NSInteger lineCount; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/CFDanmakuInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // CFDanmakuInfo.m 3 | // HJDanmakuDemo 4 | // 5 | // Created by 于 传峰 on 15/7/10. 6 | // Copyright (c) 2015年 olinone. All rights reserved. 7 | // 8 | 9 | #import "CFDanmakuInfo.h" 10 | 11 | @implementation CFDanmakuInfo 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/CFDanmakuView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CFDanmakuView.h 3 | // 31- CFDanmakuDemo 4 | // 5 | // Created by 于 传峰 on 15/7/9. 6 | // Copyright (c) 2015年 于 传峰. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CFDanmaku.h" 11 | @class CFDanmakuView; 12 | 13 | @protocol CFDanmakuDelegate 14 | 15 | @required 16 | // 获取视频播放时间 17 | - (NSTimeInterval)danmakuViewGetPlayTime:(CFDanmakuView *)danmakuView; 18 | // 加载视频中 19 | - (BOOL)danmakuViewIsBuffering:(CFDanmakuView *)danmakuView; 20 | 21 | @end 22 | 23 | 24 | @interface CFDanmakuView : UIView 25 | @property (nonatomic, weak) id delegate; 26 | @property (nonatomic, readonly, assign) BOOL isPrepared; 27 | @property (nonatomic, readonly, assign) BOOL isPlaying; 28 | @property(nonatomic, readonly, assign) BOOL isPauseing; 29 | 30 | - (void)prepareDanmakus:(NSArray *)danmakus; 31 | 32 | // 以下属性都是必须配置的-------- 33 | // 弹幕动画时间 34 | @property (nonatomic, assign) CGFloat duration; 35 | // 中间上边/下边弹幕动画时间 36 | @property (nonatomic, assign) CGFloat centerDuration; 37 | // 弹幕弹道高度 38 | @property (nonatomic, assign) CGFloat lineHeight; 39 | // 弹幕弹道之间的间距 40 | @property (nonatomic, assign) CGFloat lineMargin; 41 | // 弹幕弹道最大行数 42 | @property (nonatomic, assign) NSInteger maxShowLineCount; 43 | // 弹幕弹道中间上边/下边最大行数 44 | @property (nonatomic, assign) NSInteger maxCenterLineCount; 45 | 46 | // start 与 stop 对应 pause 与 resume 对应 47 | - (void)start; 48 | - (void)pause; 49 | - (void)resume; 50 | - (void)stop; 51 | 52 | // 发送一个弹幕 53 | - (void)sendDanmakuSource:(CFDanmaku *)danmaku; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/MaximumTrackImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/MaximumTrackImage@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/MinimumTrackImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/MinimumTrackImage@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/bg_media_default@2x.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/bg_media_default@2x.jpg -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/fast_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/fast_back.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/fast_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/fast_forward.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_minimize_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_minimize_btn@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_minimize_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_minimize_btn@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_minimize_btn_hl@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_minimize_btn_hl@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_minimize_btn_hl@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_minimize_btn_hl@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_pause_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_pause_btn@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_pause_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_pause_btn@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_pause_btn_hl@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_pause_btn_hl@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_pause_btn_hl@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_pause_btn_hl@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_play_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_play_btn@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_play_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_play_btn@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_play_btn_hl@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_play_btn_hl@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_play_btn_hl@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/full_play_btn_hl@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/logo.gif -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/mini_launchFullScreen_btn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/mini_launchFullScreen_btn@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/mini_launchFullScreen_btn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/mini_launchFullScreen_btn@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/mini_launchFullScreen_btn_hl@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/mini_launchFullScreen_btn_hl@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/mini_launchFullScreen_btn_hl@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/mini_launchFullScreen_btn_hl@3x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/thumbImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGAVPlayer.bundle/thumbImage@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FMGVideoPlayView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMGVideoPlayView.h 3 | // 02-远程视频播放(AVPlayer) 4 | // 5 | // Created by apple on 15/8/16. 6 | // Copyright (c) 2015年 xiaomage. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class CFDanmakuView; 13 | @class FullViewController; 14 | 15 | @protocol FMGVideoPlayViewDelegate 16 | 17 | - (void)videoplayViewSwitchOrientation:(BOOL)isFull; 18 | 19 | @end 20 | 21 | @interface FMGVideoPlayView : UIView 22 | 23 | + (instancetype)videoPlayView; 24 | 25 | @property (nonatomic, assign) NSInteger index; 26 | 27 | /* playItem */ 28 | @property (nonatomic, strong) AVPlayerItem *currentItem; 29 | @property (weak, nonatomic) IBOutlet UISlider *progressSlider; 30 | 31 | 32 | /* 播放器 */ 33 | @property (nonatomic, strong) AVPlayer *player; 34 | 35 | /* 弹幕 */ 36 | 37 | @property (nonatomic, strong) CFDanmakuView * danmakuView; 38 | 39 | //@property (nonatomic, strong) AVPlayerItem *playerItem; 40 | @property (nonatomic, copy) NSString *urlString; 41 | @property (weak, nonatomic) IBOutlet UIButton *playOrPauseBtn; 42 | 43 | /* 包含在哪一个控制器中 */ 44 | @property (nonatomic, weak) UIViewController *contrainerViewController; 45 | 46 | /* 全屏控制器 */ 47 | @property (nonatomic, strong) FullViewController *fullVc; 48 | 49 | /* 代理 */ 50 | @property (nonatomic, assign) iddelegate; 51 | 52 | - (void)showToolView:(BOOL)isShow; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FullView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FullView.h 3 | // 02-远程视频播放(AVPlayer) 4 | // 5 | // Created by apple on 15/8/26. 6 | // Copyright (c) 2015年 xiaomage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FullView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FullView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FullView.m 3 | // 02-远程视频播放(AVPlayer) 4 | // 5 | // Created by apple on 15/8/26. 6 | // Copyright (c) 2015年 xiaomage. All rights reserved. 7 | // 8 | 9 | #import "FullView.h" 10 | 11 | @implementation FullView 12 | 13 | - (id)initWithCoder:(NSCoder *)aDecoder 14 | { 15 | if (self = [super initWithCoder:aDecoder]) { 16 | self.autoresizesSubviews = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 17 | self.backgroundColor = [UIColor blackColor]; 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FullViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FullViewController.h 3 | // 02-远程视频播放(AVPlayer) 4 | // 5 | // Created by apple on 15/8/16. 6 | // Copyright (c) 2015年 xiaomage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FullViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/FMGAVPlayer/FullViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FullViewController.m 3 | // 02-远程视频播放(AVPlayer) 4 | // 5 | // Created by apple on 15/8/16. 6 | // Copyright (c) 2015年 xiaomage. All rights reserved. 7 | // 8 | 9 | #import "FullViewController.h" 10 | #import "FullView.h" 11 | 12 | @interface FullViewController () 13 | 14 | @end 15 | 16 | @implementation FullViewController 17 | 18 | - (void)loadView 19 | { 20 | FullView *fullView = [[FullView alloc] init]; 21 | self.view = fullView; 22 | } 23 | 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | } 27 | 28 | - (NSUInteger)supportedInterfaceOrientations 29 | { 30 | return UIInterfaceOrientationMaskLandscape; 31 | } 32 | 33 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 34 | { 35 | return YES; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Base/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshAutoFooter : MJRefreshFooter 12 | /** 是否自动刷新(默认为YES) */ 13 | @property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh; 14 | 15 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 16 | @property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh MJRefreshDeprecated("请使用automaticallyChangeAlpha属性"); 17 | 18 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 19 | @property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent; 20 | @end 21 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Base/MJRefreshAutoFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoFooter.h" 10 | 11 | @interface MJRefreshAutoFooter() 12 | @end 13 | 14 | @implementation MJRefreshAutoFooter 15 | 16 | #pragma mark - 初始化 17 | - (void)willMoveToSuperview:(UIView *)newSuperview 18 | { 19 | [super willMoveToSuperview:newSuperview]; 20 | 21 | if (newSuperview) { // 新的父控件 22 | if (self.hidden == NO) { 23 | self.scrollView.mj_insetB += self.mj_h; 24 | } 25 | 26 | // 设置位置 27 | self.mj_y = _scrollView.mj_contentH; 28 | } else { // 被移除了 29 | if (self.hidden == NO) { 30 | self.scrollView.mj_insetB -= self.mj_h; 31 | } 32 | } 33 | } 34 | 35 | #pragma mark - 过期方法 36 | - (void)setAppearencePercentTriggerAutoRefresh:(CGFloat)appearencePercentTriggerAutoRefresh 37 | { 38 | self.triggerAutomaticallyRefreshPercent = appearencePercentTriggerAutoRefresh; 39 | } 40 | 41 | - (CGFloat)appearencePercentTriggerAutoRefresh 42 | { 43 | return self.triggerAutomaticallyRefreshPercent; 44 | } 45 | 46 | #pragma mark - 实现父类的方法 47 | - (void)prepare 48 | { 49 | [super prepare]; 50 | 51 | // 默认底部控件100%出现时才会自动刷新 52 | self.triggerAutomaticallyRefreshPercent = 1.0; 53 | 54 | // 设置为默认状态 55 | self.automaticallyRefresh = YES; 56 | } 57 | 58 | - (void)scrollViewContentSizeDidChange:(NSDictionary *)change 59 | { 60 | [super scrollViewContentSizeDidChange:change]; 61 | 62 | // 设置位置 63 | self.mj_y = self.scrollView.mj_contentH; 64 | } 65 | 66 | - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change 67 | { 68 | [super scrollViewContentOffsetDidChange:change]; 69 | 70 | if (self.state != MJRefreshStateIdle || !self.automaticallyRefresh || self.mj_y == 0) return; 71 | 72 | if (_scrollView.mj_insetT + _scrollView.mj_contentH > _scrollView.mj_h) { // 内容超过一个屏幕 73 | // 这里的_scrollView.mj_contentH替换掉self.mj_y更为合理 74 | if (_scrollView.mj_offsetY >= _scrollView.mj_contentH - _scrollView.mj_h + self.mj_h * self.triggerAutomaticallyRefreshPercent + _scrollView.mj_insetB - self.mj_h) { 75 | // 防止手松开时连续调用 76 | CGPoint old = [change[@"old"] CGPointValue]; 77 | CGPoint new = [change[@"new"] CGPointValue]; 78 | if (new.y <= old.y) return; 79 | 80 | // 当底部刷新控件完全出现时,才刷新 81 | [self beginRefreshing]; 82 | } 83 | } 84 | } 85 | 86 | - (void)scrollViewPanStateDidChange:(NSDictionary *)change 87 | { 88 | [super scrollViewPanStateDidChange:change]; 89 | 90 | if (self.state != MJRefreshStateIdle) return; 91 | 92 | if (_scrollView.panGestureRecognizer.state == UIGestureRecognizerStateEnded) {// 手松开 93 | if (_scrollView.mj_insetT + _scrollView.mj_contentH <= _scrollView.mj_h) { // 不够一个屏幕 94 | if (_scrollView.mj_offsetY >= - _scrollView.mj_insetT) { // 向上拽 95 | [self beginRefreshing]; 96 | } 97 | } else { // 超出一个屏幕 98 | if (_scrollView.mj_offsetY >= _scrollView.mj_contentH + _scrollView.mj_insetB - _scrollView.mj_h) { 99 | [self beginRefreshing]; 100 | } 101 | } 102 | } 103 | } 104 | 105 | - (void)setState:(MJRefreshState)state 106 | { 107 | MJRefreshCheckState 108 | 109 | if (state == MJRefreshStateRefreshing) { 110 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 111 | [self executeRefreshingCallback]; 112 | }); 113 | } 114 | } 115 | 116 | - (void)setHidden:(BOOL)hidden 117 | { 118 | BOOL lastHidden = self.isHidden; 119 | 120 | [super setHidden:hidden]; 121 | 122 | if (!lastHidden && hidden) { 123 | self.state = MJRefreshStateIdle; 124 | 125 | self.scrollView.mj_insetB -= self.mj_h; 126 | } else if (lastHidden && !hidden) { 127 | self.scrollView.mj_insetB += self.mj_h; 128 | 129 | // 设置位置 130 | self.mj_y = _scrollView.mj_contentH; 131 | } 132 | } 133 | @end 134 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Base/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshBackFooter : MJRefreshFooter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Base/MJRefreshComponent.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshComponent.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 刷新控件的基类 9 | 10 | #import 11 | #import "MJRefreshConst.h" 12 | #import "UIView+MJExtension.h" 13 | #import "UIScrollView+MJExtension.h" 14 | #import "UIScrollView+MJRefresh.h" 15 | 16 | /** 刷新控件的状态 */ 17 | typedef NS_ENUM(NSInteger, MJRefreshState) { 18 | /** 普通闲置状态 */ 19 | MJRefreshStateIdle = 1, 20 | /** 松开就可以进行刷新的状态 */ 21 | MJRefreshStatePulling, 22 | /** 正在刷新中的状态 */ 23 | MJRefreshStateRefreshing, 24 | /** 即将刷新的状态 */ 25 | MJRefreshStateWillRefresh, 26 | /** 所有数据加载完毕,没有更多的数据了 */ 27 | MJRefreshStateNoMoreData 28 | }; 29 | 30 | /** 进入刷新状态的回调 */ 31 | typedef void (^MJRefreshComponentRefreshingBlock)(); 32 | 33 | /** 刷新控件的基类 */ 34 | @interface MJRefreshComponent : UIView 35 | { 36 | /** 记录scrollView刚开始的inset */ 37 | UIEdgeInsets _scrollViewOriginalInset; 38 | /** 父控件 */ 39 | __weak UIScrollView *_scrollView; 40 | } 41 | #pragma mark - 刷新回调 42 | /** 正在刷新的回调 */ 43 | @property (copy, nonatomic) MJRefreshComponentRefreshingBlock refreshingBlock; 44 | /** 设置回调对象和回调方法 */ 45 | - (void)setRefreshingTarget:(id)target refreshingAction:(SEL)action; 46 | /** 回调对象 */ 47 | @property (weak, nonatomic) id refreshingTarget; 48 | /** 回调方法 */ 49 | @property (assign, nonatomic) SEL refreshingAction; 50 | /** 触发回调(交给子类去调用) */ 51 | - (void)executeRefreshingCallback; 52 | 53 | #pragma mark - 刷新状态控制 54 | /** 进入刷新状态 */ 55 | - (void)beginRefreshing; 56 | /** 结束刷新状态 */ 57 | - (void)endRefreshing; 58 | /** 是否正在刷新 */ 59 | - (BOOL)isRefreshing; 60 | /** 刷新状态 一般交给子类内部实现 */ 61 | @property (assign, nonatomic) MJRefreshState state; 62 | 63 | #pragma mark - 交给子类去访问 64 | /** 记录scrollView刚开始的inset */ 65 | @property (assign, nonatomic, readonly) UIEdgeInsets scrollViewOriginalInset; 66 | /** 父控件 */ 67 | @property (weak, nonatomic, readonly) UIScrollView *scrollView; 68 | 69 | #pragma mark - 交给子类们去实现 70 | /** 初始化 */ 71 | - (void)prepare NS_REQUIRES_SUPER; 72 | /** 摆放子控件frame */ 73 | - (void)placeSubviews NS_REQUIRES_SUPER; 74 | /** 当scrollView的contentOffset发生改变的时候调用 */ 75 | - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 76 | /** 当scrollView的contentSize发生改变的时候调用 */ 77 | - (void)scrollViewContentSizeDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 78 | /** 当scrollView的拖拽状态发生改变的时候调用 */ 79 | - (void)scrollViewPanStateDidChange:(NSDictionary *)change NS_REQUIRES_SUPER; 80 | 81 | 82 | #pragma mark - 其他 83 | /** 拉拽的百分比(交给子类重写) */ 84 | @property (assign, nonatomic) CGFloat pullingPercent; 85 | /** 根据拖拽比例自动切换透明度 */ 86 | @property (assign, nonatomic, getter=isAutoChangeAlpha) BOOL autoChangeAlpha MJRefreshDeprecated("请使用automaticallyChangeAlpha属性"); 87 | /** 根据拖拽比例自动切换透明度 */ 88 | @property (assign, nonatomic, getter=isAutomaticallyChangeAlpha) BOOL automaticallyChangeAlpha; 89 | @end 90 | 91 | @interface UILabel(MJRefresh) 92 | + (instancetype)label; 93 | @end 94 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Base/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshFooter.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/5. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 上拉刷新控件 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshFooter : MJRefreshComponent 13 | /** 创建footer */ 14 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建footer */ 16 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 提示没有更多的数据 */ 19 | - (void)endRefreshingWithNoMoreData; 20 | - (void)noticeNoMoreData MJRefreshDeprecated("使用endRefreshingWithNoMoreData"); 21 | 22 | /** 重置没有更多的数据(消除没有更多数据的状态) */ 23 | - (void)resetNoMoreData; 24 | 25 | /** 忽略多少scrollView的contentInset的bottom */ 26 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom; 27 | 28 | /** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏) */ 29 | @property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden; 30 | @end 31 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Base/MJRefreshFooter.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshFooter.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/5. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "MJRefreshFooter.h" 11 | 12 | @interface MJRefreshFooter() 13 | 14 | @end 15 | 16 | @implementation MJRefreshFooter 17 | #pragma mark - 构造方法 18 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock 19 | { 20 | MJRefreshFooter *cmp = [[self alloc] init]; 21 | cmp.refreshingBlock = refreshingBlock; 22 | return cmp; 23 | } 24 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action 25 | { 26 | MJRefreshFooter *cmp = [[self alloc] init]; 27 | [cmp setRefreshingTarget:target refreshingAction:action]; 28 | return cmp; 29 | } 30 | 31 | #pragma mark - 重写父类的方法 32 | - (void)prepare 33 | { 34 | [super prepare]; 35 | 36 | // 设置自己的高度 37 | self.mj_h = MJRefreshFooterHeight; 38 | 39 | // 默认是自动隐藏 40 | self.automaticallyHidden = YES; 41 | } 42 | 43 | - (void)willMoveToSuperview:(UIView *)newSuperview 44 | { 45 | [super willMoveToSuperview:newSuperview]; 46 | 47 | if (newSuperview) { 48 | // 监听scrollView数据的变化 49 | if ([self.scrollView isKindOfClass:[UITableView class]] || [self.scrollView isKindOfClass:[UICollectionView class]]) { 50 | [self.scrollView setMj_reloadDataBlock:^(NSInteger totalDataCount) { 51 | if (self.isAutomaticallyHidden) { 52 | self.hidden = (totalDataCount == 0); 53 | } 54 | }]; 55 | } 56 | } 57 | } 58 | 59 | #pragma mark - 公共方法 60 | - (void)endRefreshingWithNoMoreData 61 | { 62 | self.state = MJRefreshStateNoMoreData; 63 | } 64 | 65 | - (void)noticeNoMoreData 66 | { 67 | [self endRefreshingWithNoMoreData]; 68 | } 69 | 70 | - (void)resetNoMoreData 71 | { 72 | self.state = MJRefreshStateIdle; 73 | } 74 | @end 75 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Base/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshHeader.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 下拉刷新控件:负责监控用户下拉的状态 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshHeader : MJRefreshComponent 13 | /** 创建header */ 14 | + (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建header */ 16 | + (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 这个key用来存储上一次下拉刷新成功的时间 */ 19 | @property (copy, nonatomic) NSString *lastUpdatedTimeKey; 20 | /** 上一次下拉刷新成功的时间 */ 21 | @property (strong, nonatomic, readonly) NSDate *lastUpdatedTime; 22 | 23 | /** 忽略多少scrollView的contentInset的top */ 24 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop; 25 | @end 26 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoGifFooter : MJRefreshAutoStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoGifFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoGifFooter.h" 10 | 11 | @interface MJRefreshAutoGifFooter() 12 | { 13 | __unsafe_unretained UIImageView *_gifView; 14 | } 15 | /** 所有状态对应的动画图片 */ 16 | @property (strong, nonatomic) NSMutableDictionary *stateImages; 17 | /** 所有状态对应的动画时间 */ 18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations; 19 | @end 20 | 21 | @implementation MJRefreshAutoGifFooter 22 | #pragma mark - 懒加载 23 | - (UIImageView *)gifView 24 | { 25 | if (!_gifView) { 26 | UIImageView *gifView = [[UIImageView alloc] init]; 27 | [self addSubview:_gifView = gifView]; 28 | } 29 | return _gifView; 30 | } 31 | 32 | - (NSMutableDictionary *)stateImages 33 | { 34 | if (!_stateImages) { 35 | self.stateImages = [NSMutableDictionary dictionary]; 36 | } 37 | return _stateImages; 38 | } 39 | 40 | - (NSMutableDictionary *)stateDurations 41 | { 42 | if (!_stateDurations) { 43 | self.stateDurations = [NSMutableDictionary dictionary]; 44 | } 45 | return _stateDurations; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state 50 | { 51 | if (images == nil) return; 52 | 53 | self.stateImages[@(state)] = images; 54 | self.stateDurations[@(state)] = @(duration); 55 | 56 | /* 根据图片设置控件的高度 */ 57 | UIImage *image = [images firstObject]; 58 | if (image.size.height > self.mj_h) { 59 | self.mj_h = image.size.height; 60 | } 61 | } 62 | 63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state 64 | { 65 | [self setImages:images duration:images.count * 0.1 forState:state]; 66 | } 67 | 68 | #pragma mark - 实现父类的方法 69 | - (void)placeSubviews 70 | { 71 | [super placeSubviews]; 72 | 73 | if (self.gifView.constraints.count) return; 74 | 75 | self.gifView.frame = self.bounds; 76 | if (self.isRefreshingTitleHidden) { 77 | self.gifView.contentMode = UIViewContentModeCenter; 78 | } else { 79 | self.gifView.contentMode = UIViewContentModeRight; 80 | self.gifView.mj_w = self.mj_w * 0.5 - 90; 81 | } 82 | } 83 | 84 | - (void)setState:(MJRefreshState)state 85 | { 86 | MJRefreshCheckState 87 | 88 | // 根据状态做事情 89 | if (state == MJRefreshStateRefreshing) { 90 | NSArray *images = self.stateImages[@(state)]; 91 | if (images.count == 0) return; 92 | [self.gifView stopAnimating]; 93 | 94 | self.gifView.hidden = NO; 95 | if (images.count == 1) { // 单张图片 96 | self.gifView.image = [images lastObject]; 97 | } else { // 多张图片 98 | self.gifView.animationImages = images; 99 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue]; 100 | [self.gifView startAnimating]; 101 | } 102 | } else if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) { 103 | [self.gifView stopAnimating]; 104 | self.gifView.hidden = YES; 105 | } 106 | } 107 | @end 108 | 109 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter : MJRefreshAutoStateFooter 12 | /** 菊花的样式 */ 13 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 14 | @end 15 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoNormalFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter() 12 | @property (weak, nonatomic) UIActivityIndicatorView *loadingView; 13 | @end 14 | 15 | @implementation MJRefreshAutoNormalFooter 16 | #pragma mark - 懒加载子控件 17 | - (UIActivityIndicatorView *)loadingView 18 | { 19 | if (!_loadingView) { 20 | UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle]; 21 | loadingView.hidesWhenStopped = YES; 22 | [self addSubview:_loadingView = loadingView]; 23 | } 24 | return _loadingView; 25 | } 26 | 27 | - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle 28 | { 29 | _activityIndicatorViewStyle = activityIndicatorViewStyle; 30 | 31 | self.loadingView = nil; 32 | [self setNeedsLayout]; 33 | } 34 | #pragma makr - 重写父类的方法 35 | - (void)prepare 36 | { 37 | [super prepare]; 38 | 39 | self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; 40 | } 41 | 42 | - (void)placeSubviews 43 | { 44 | [super placeSubviews]; 45 | 46 | if (self.loadingView.constraints.count) return; 47 | 48 | // 圈圈 49 | CGFloat loadingCenterX = self.mj_w * 0.5; 50 | if (!self.isRefreshingTitleHidden) { 51 | loadingCenterX -= 100; 52 | } 53 | CGFloat loadingCenterY = self.mj_h * 0.5; 54 | self.loadingView.center = CGPointMake(loadingCenterX, loadingCenterY); 55 | } 56 | 57 | - (void)setState:(MJRefreshState)state 58 | { 59 | MJRefreshCheckState 60 | 61 | // 根据状态做事情 62 | if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) { 63 | [self.loadingView stopAnimating]; 64 | } else if (state == MJRefreshStateRefreshing) { 65 | [self.loadingView startAnimating]; 66 | } 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoFooter.h" 10 | 11 | @interface MJRefreshAutoStateFooter : MJRefreshAutoFooter 12 | /** 显示刷新状态的label */ 13 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 14 | 15 | /** 设置state状态下的文字 */ 16 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 17 | 18 | /** 隐藏刷新状态的文字 */ 19 | @property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden; 20 | @end 21 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoStateFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoStateFooter() 12 | { 13 | /** 显示刷新状态的label */ 14 | __unsafe_unretained UILabel *_stateLabel; 15 | } 16 | /** 所有状态对应的文字 */ 17 | @property (strong, nonatomic) NSMutableDictionary *stateTitles; 18 | @end 19 | 20 | @implementation MJRefreshAutoStateFooter 21 | #pragma mark - 懒加载 22 | - (NSMutableDictionary *)stateTitles 23 | { 24 | if (!_stateTitles) { 25 | self.stateTitles = [NSMutableDictionary dictionary]; 26 | } 27 | return _stateTitles; 28 | } 29 | 30 | - (UILabel *)stateLabel 31 | { 32 | if (!_stateLabel) { 33 | [self addSubview:_stateLabel = [UILabel label]]; 34 | } 35 | return _stateLabel; 36 | } 37 | 38 | #pragma mark - 公共方法 39 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state 40 | { 41 | if (title == nil) return; 42 | self.stateTitles[@(state)] = title; 43 | self.stateLabel.text = self.stateTitles[@(self.state)]; 44 | } 45 | 46 | #pragma mark - 私有方法 47 | - (void)stateLabelClick 48 | { 49 | if (self.state == MJRefreshStateIdle) { 50 | [self beginRefreshing]; 51 | } 52 | } 53 | 54 | #pragma mark - 重写父类的方法 55 | - (void)prepare 56 | { 57 | [super prepare]; 58 | 59 | // 初始化文字 60 | [self setTitle:MJRefreshAutoFooterIdleText forState:MJRefreshStateIdle]; 61 | [self setTitle:MJRefreshAutoFooterRefreshingText forState:MJRefreshStateRefreshing]; 62 | [self setTitle:MJRefreshAutoFooterNoMoreDataText forState:MJRefreshStateNoMoreData]; 63 | 64 | // 监听label 65 | self.stateLabel.userInteractionEnabled = YES; 66 | [self.stateLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(stateLabelClick)]]; 67 | } 68 | 69 | - (void)placeSubviews 70 | { 71 | [super placeSubviews]; 72 | 73 | if (self.stateLabel.constraints.count) return; 74 | 75 | // 状态标签 76 | self.stateLabel.frame = self.bounds; 77 | } 78 | 79 | - (void)setState:(MJRefreshState)state 80 | { 81 | MJRefreshCheckState 82 | 83 | if (self.isRefreshingTitleHidden && state == MJRefreshStateRefreshing) { 84 | self.stateLabel.text = nil; 85 | } else { 86 | self.stateLabel.text = self.stateTitles[@(state)]; 87 | } 88 | } 89 | @end -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackGifFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackGifFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackGifFooter.h" 10 | 11 | @interface MJRefreshBackGifFooter() 12 | { 13 | __unsafe_unretained UIImageView *_gifView; 14 | } 15 | /** 所有状态对应的动画图片 */ 16 | @property (strong, nonatomic) NSMutableDictionary *stateImages; 17 | /** 所有状态对应的动画时间 */ 18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations; 19 | @end 20 | 21 | @implementation MJRefreshBackGifFooter 22 | #pragma mark - 懒加载 23 | - (UIImageView *)gifView 24 | { 25 | if (!_gifView) { 26 | UIImageView *gifView = [[UIImageView alloc] init]; 27 | [self addSubview:_gifView = gifView]; 28 | } 29 | return _gifView; 30 | } 31 | 32 | - (NSMutableDictionary *)stateImages 33 | { 34 | if (!_stateImages) { 35 | self.stateImages = [NSMutableDictionary dictionary]; 36 | } 37 | return _stateImages; 38 | } 39 | 40 | - (NSMutableDictionary *)stateDurations 41 | { 42 | if (!_stateDurations) { 43 | self.stateDurations = [NSMutableDictionary dictionary]; 44 | } 45 | return _stateDurations; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state 50 | { 51 | if (images == nil) return; 52 | 53 | self.stateImages[@(state)] = images; 54 | self.stateDurations[@(state)] = @(duration); 55 | 56 | /* 根据图片设置控件的高度 */ 57 | UIImage *image = [images firstObject]; 58 | if (image.size.height > self.mj_h) { 59 | self.mj_h = image.size.height; 60 | } 61 | } 62 | 63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state 64 | { 65 | [self setImages:images duration:images.count * 0.1 forState:state]; 66 | } 67 | 68 | #pragma mark - 实现父类的方法 69 | - (void)setPullingPercent:(CGFloat)pullingPercent 70 | { 71 | [super setPullingPercent:pullingPercent]; 72 | NSArray *images = self.stateImages[@(MJRefreshStateIdle)]; 73 | if (self.state != MJRefreshStateIdle || images.count == 0) return; 74 | [self.gifView stopAnimating]; 75 | NSUInteger index = images.count * pullingPercent; 76 | if (index >= images.count) index = images.count - 1; 77 | self.gifView.image = images[index]; 78 | } 79 | 80 | - (void)placeSubviews 81 | { 82 | [super placeSubviews]; 83 | 84 | if (self.gifView.constraints.count) return; 85 | 86 | self.gifView.frame = self.bounds; 87 | if (self.stateLabel.hidden) { 88 | self.gifView.contentMode = UIViewContentModeCenter; 89 | } else { 90 | self.gifView.contentMode = UIViewContentModeRight; 91 | self.gifView.mj_w = self.mj_w * 0.5 - 90; 92 | } 93 | } 94 | 95 | - (void)setState:(MJRefreshState)state 96 | { 97 | MJRefreshCheckState 98 | 99 | // 根据状态做事情 100 | if (state == MJRefreshStatePulling || state == MJRefreshStateRefreshing) { 101 | NSArray *images = self.stateImages[@(state)]; 102 | if (images.count == 0) return; 103 | 104 | self.gifView.hidden = NO; 105 | [self.gifView stopAnimating]; 106 | if (images.count == 1) { // 单张图片 107 | self.gifView.image = [images lastObject]; 108 | } else { // 多张图片 109 | self.gifView.animationImages = images; 110 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue]; 111 | [self.gifView startAnimating]; 112 | } 113 | } else if (state == MJRefreshStateIdle) { 114 | self.gifView.hidden = NO; 115 | } else if (state == MJRefreshStateNoMoreData) { 116 | self.gifView.hidden = YES; 117 | } 118 | } 119 | @end 120 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackNormalFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackNormalFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackNormalFooter.h" 10 | 11 | @interface MJRefreshBackNormalFooter() 12 | { 13 | __unsafe_unretained UIImageView *_arrowView; 14 | } 15 | @property (weak, nonatomic) UIActivityIndicatorView *loadingView; 16 | @end 17 | 18 | @implementation MJRefreshBackNormalFooter 19 | #pragma mark - 懒加载子控件 20 | - (UIImageView *)arrowView 21 | { 22 | if (!_arrowView) { 23 | UIImage *image = [UIImage imageNamed:MJRefreshSrcName(@"arrow.png")] ?: [UIImage imageNamed:MJRefreshFrameworkSrcName(@"arrow.png")]; 24 | UIImageView *arrowView = [[UIImageView alloc] initWithImage:image]; 25 | [self addSubview:_arrowView = arrowView]; 26 | } 27 | return _arrowView; 28 | } 29 | 30 | 31 | - (UIActivityIndicatorView *)loadingView 32 | { 33 | if (!_loadingView) { 34 | UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle]; 35 | loadingView.hidesWhenStopped = YES; 36 | [self addSubview:_loadingView = loadingView]; 37 | } 38 | return _loadingView; 39 | } 40 | 41 | - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle 42 | { 43 | _activityIndicatorViewStyle = activityIndicatorViewStyle; 44 | 45 | self.loadingView = nil; 46 | [self setNeedsLayout]; 47 | } 48 | #pragma makr - 重写父类的方法 49 | - (void)prepare 50 | { 51 | [super prepare]; 52 | 53 | self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; 54 | } 55 | 56 | - (void)placeSubviews 57 | { 58 | [super placeSubviews]; 59 | 60 | // 箭头的中心点 61 | CGFloat arrowCenterX = self.mj_w * 0.5; 62 | if (!self.stateLabel.hidden) { 63 | arrowCenterX -= 100; 64 | } 65 | CGFloat arrowCenterY = self.mj_h * 0.5; 66 | CGPoint arrowCenter = CGPointMake(arrowCenterX, arrowCenterY); 67 | 68 | // 箭头 69 | if (self.arrowView.constraints.count == 0) { 70 | self.arrowView.mj_size = self.arrowView.image.size; 71 | self.arrowView.center = arrowCenter; 72 | } 73 | 74 | // 圈圈 75 | if (self.loadingView.constraints.count == 0) { 76 | self.loadingView.center = arrowCenter; 77 | } 78 | } 79 | 80 | - (void)setState:(MJRefreshState)state 81 | { 82 | MJRefreshCheckState 83 | 84 | // 根据状态做事情 85 | if (state == MJRefreshStateIdle) { 86 | if (oldState == MJRefreshStateRefreshing) { 87 | self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI); 88 | [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{ 89 | self.loadingView.alpha = 0.0; 90 | } completion:^(BOOL finished) { 91 | self.loadingView.alpha = 1.0; 92 | [self.loadingView stopAnimating]; 93 | 94 | self.arrowView.hidden = NO; 95 | }]; 96 | } else { 97 | self.arrowView.hidden = NO; 98 | [self.loadingView stopAnimating]; 99 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 100 | self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI); 101 | }]; 102 | } 103 | } else if (state == MJRefreshStatePulling) { 104 | self.arrowView.hidden = NO; 105 | [self.loadingView stopAnimating]; 106 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 107 | self.arrowView.transform = CGAffineTransformIdentity; 108 | }]; 109 | } else if (state == MJRefreshStateRefreshing) { 110 | self.arrowView.hidden = YES; 111 | [self.loadingView startAnimating]; 112 | } else if (state == MJRefreshStateNoMoreData) { 113 | self.arrowView.hidden = YES; 114 | [self.loadingView stopAnimating]; 115 | } 116 | } 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackFooter.h" 10 | 11 | @interface MJRefreshBackStateFooter : MJRefreshBackFooter 12 | /** 显示刷新状态的label */ 13 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 14 | /** 设置state状态下的文字 */ 15 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 16 | 17 | /** 获取state状态下的title */ 18 | - (NSString *)titleForState:(MJRefreshState)state; 19 | @end 20 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackStateFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackStateFooter() 12 | { 13 | /** 显示刷新状态的label */ 14 | __unsafe_unretained UILabel *_stateLabel; 15 | } 16 | /** 所有状态对应的文字 */ 17 | @property (strong, nonatomic) NSMutableDictionary *stateTitles; 18 | @end 19 | 20 | @implementation MJRefreshBackStateFooter 21 | #pragma mark - 懒加载 22 | - (NSMutableDictionary *)stateTitles 23 | { 24 | if (!_stateTitles) { 25 | self.stateTitles = [NSMutableDictionary dictionary]; 26 | } 27 | return _stateTitles; 28 | } 29 | 30 | - (UILabel *)stateLabel 31 | { 32 | if (!_stateLabel) { 33 | [self addSubview:_stateLabel = [UILabel label]]; 34 | } 35 | return _stateLabel; 36 | } 37 | 38 | #pragma mark - 公共方法 39 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state 40 | { 41 | if (title == nil) return; 42 | self.stateTitles[@(state)] = title; 43 | self.stateLabel.text = self.stateTitles[@(self.state)]; 44 | } 45 | 46 | - (NSString *)titleForState:(MJRefreshState)state { 47 | return self.stateTitles[@(state)]; 48 | } 49 | 50 | #pragma mark - 重写父类的方法 51 | - (void)prepare 52 | { 53 | [super prepare]; 54 | 55 | // 初始化文字 56 | [self setTitle:MJRefreshBackFooterIdleText forState:MJRefreshStateIdle]; 57 | [self setTitle:MJRefreshBackFooterPullingText forState:MJRefreshStatePulling]; 58 | [self setTitle:MJRefreshBackFooterRefreshingText forState:MJRefreshStateRefreshing]; 59 | [self setTitle:MJRefreshBackFooterNoMoreDataText forState:MJRefreshStateNoMoreData]; 60 | } 61 | 62 | - (void)placeSubviews 63 | { 64 | [super placeSubviews]; 65 | 66 | if (self.stateLabel.constraints.count) return; 67 | 68 | // 状态标签 69 | self.stateLabel.frame = self.bounds; 70 | } 71 | 72 | - (void)setState:(MJRefreshState)state 73 | { 74 | MJRefreshCheckState 75 | 76 | // 设置状态文字 77 | self.stateLabel.text = self.stateTitles[@(state)]; 78 | } 79 | @end 80 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Header/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshGifHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshGifHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Header/MJRefreshGifHeader.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshGifHeader.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshGifHeader.h" 10 | 11 | @interface MJRefreshGifHeader() 12 | { 13 | __unsafe_unretained UIImageView *_gifView; 14 | } 15 | /** 所有状态对应的动画图片 */ 16 | @property (strong, nonatomic) NSMutableDictionary *stateImages; 17 | /** 所有状态对应的动画时间 */ 18 | @property (strong, nonatomic) NSMutableDictionary *stateDurations; 19 | @end 20 | 21 | @implementation MJRefreshGifHeader 22 | #pragma mark - 懒加载 23 | - (UIImageView *)gifView 24 | { 25 | if (!_gifView) { 26 | UIImageView *gifView = [[UIImageView alloc] init]; 27 | [self addSubview:_gifView = gifView]; 28 | } 29 | return _gifView; 30 | } 31 | 32 | - (NSMutableDictionary *)stateImages 33 | { 34 | if (!_stateImages) { 35 | self.stateImages = [NSMutableDictionary dictionary]; 36 | } 37 | return _stateImages; 38 | } 39 | 40 | - (NSMutableDictionary *)stateDurations 41 | { 42 | if (!_stateDurations) { 43 | self.stateDurations = [NSMutableDictionary dictionary]; 44 | } 45 | return _stateDurations; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state 50 | { 51 | if (images == nil) return; 52 | 53 | self.stateImages[@(state)] = images; 54 | self.stateDurations[@(state)] = @(duration); 55 | 56 | /* 根据图片设置控件的高度 */ 57 | UIImage *image = [images firstObject]; 58 | if (image.size.height > self.mj_h) { 59 | self.mj_h = image.size.height; 60 | } 61 | } 62 | 63 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state 64 | { 65 | [self setImages:images duration:images.count * 0.1 forState:state]; 66 | } 67 | 68 | #pragma mark - 实现父类的方法 69 | - (void)setPullingPercent:(CGFloat)pullingPercent 70 | { 71 | [super setPullingPercent:pullingPercent]; 72 | NSArray *images = self.stateImages[@(MJRefreshStateIdle)]; 73 | if (self.state != MJRefreshStateIdle || images.count == 0) return; 74 | // 停止动画 75 | [self.gifView stopAnimating]; 76 | // 设置当前需要显示的图片 77 | NSUInteger index = images.count * pullingPercent; 78 | if (index >= images.count) index = images.count - 1; 79 | self.gifView.image = images[index]; 80 | } 81 | 82 | - (void)placeSubviews 83 | { 84 | [super placeSubviews]; 85 | 86 | if (self.gifView.constraints.count) return; 87 | 88 | self.gifView.frame = self.bounds; 89 | if (self.stateLabel.hidden && self.lastUpdatedTimeLabel.hidden) { 90 | self.gifView.contentMode = UIViewContentModeCenter; 91 | } else { 92 | self.gifView.contentMode = UIViewContentModeRight; 93 | self.gifView.mj_w = self.mj_w * 0.5 - 90; 94 | } 95 | } 96 | 97 | - (void)setState:(MJRefreshState)state 98 | { 99 | MJRefreshCheckState 100 | 101 | // 根据状态做事情 102 | if (state == MJRefreshStatePulling || state == MJRefreshStateRefreshing) { 103 | NSArray *images = self.stateImages[@(state)]; 104 | if (images.count == 0) return; 105 | 106 | [self.gifView stopAnimating]; 107 | if (images.count == 1) { // 单张图片 108 | self.gifView.image = [images lastObject]; 109 | } else { // 多张图片 110 | self.gifView.animationImages = images; 111 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue]; 112 | [self.gifView startAnimating]; 113 | } 114 | } else if (state == MJRefreshStateIdle) { 115 | [self.gifView stopAnimating]; 116 | } 117 | } 118 | @end 119 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Header/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshNormalHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshNormalHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Header/MJRefreshNormalHeader.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshNormalHeader.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshNormalHeader.h" 10 | 11 | @interface MJRefreshNormalHeader() 12 | { 13 | __unsafe_unretained UIImageView *_arrowView; 14 | } 15 | @property (weak, nonatomic) UIActivityIndicatorView *loadingView; 16 | @end 17 | 18 | @implementation MJRefreshNormalHeader 19 | #pragma mark - 懒加载子控件 20 | - (UIImageView *)arrowView 21 | { 22 | if (!_arrowView) { 23 | UIImage *image = [UIImage imageNamed:MJRefreshSrcName(@"arrow.png")] ?: [UIImage imageNamed:MJRefreshFrameworkSrcName(@"arrow.png")]; 24 | UIImageView *arrowView = [[UIImageView alloc] initWithImage:image]; 25 | [self addSubview:_arrowView = arrowView]; 26 | } 27 | return _arrowView; 28 | } 29 | 30 | - (UIActivityIndicatorView *)loadingView 31 | { 32 | if (!_loadingView) { 33 | UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle]; 34 | loadingView.hidesWhenStopped = YES; 35 | [self addSubview:_loadingView = loadingView]; 36 | } 37 | return _loadingView; 38 | } 39 | 40 | #pragma mark - 公共方法 41 | - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle 42 | { 43 | _activityIndicatorViewStyle = activityIndicatorViewStyle; 44 | 45 | self.loadingView = nil; 46 | [self setNeedsLayout]; 47 | } 48 | 49 | #pragma makr - 重写父类的方法 50 | - (void)prepare 51 | { 52 | [super prepare]; 53 | 54 | self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; 55 | } 56 | 57 | - (void)placeSubviews 58 | { 59 | [super placeSubviews]; 60 | 61 | // 箭头的中心点 62 | CGFloat arrowCenterX = self.mj_w * 0.5; 63 | if (!self.stateLabel.hidden) { 64 | arrowCenterX -= 100; 65 | } 66 | CGFloat arrowCenterY = self.mj_h * 0.5; 67 | CGPoint arrowCenter = CGPointMake(arrowCenterX, arrowCenterY); 68 | 69 | // 箭头 70 | if (self.arrowView.constraints.count == 0) { 71 | self.arrowView.mj_size = self.arrowView.image.size; 72 | self.arrowView.center = arrowCenter; 73 | } 74 | 75 | // 圈圈 76 | if (self.loadingView.constraints.count == 0) { 77 | self.loadingView.center = arrowCenter; 78 | } 79 | } 80 | 81 | - (void)setState:(MJRefreshState)state 82 | { 83 | MJRefreshCheckState 84 | 85 | // 根据状态做事情 86 | if (state == MJRefreshStateIdle) { 87 | if (oldState == MJRefreshStateRefreshing) { 88 | self.arrowView.transform = CGAffineTransformIdentity; 89 | 90 | [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{ 91 | self.loadingView.alpha = 0.0; 92 | } completion:^(BOOL finished) { 93 | // 如果执行完动画发现不是idle状态,就直接返回,进入其他状态 94 | if (self.state != MJRefreshStateIdle) return; 95 | 96 | self.loadingView.alpha = 1.0; 97 | [self.loadingView stopAnimating]; 98 | self.arrowView.hidden = NO; 99 | }]; 100 | } else { 101 | [self.loadingView stopAnimating]; 102 | self.arrowView.hidden = NO; 103 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 104 | self.arrowView.transform = CGAffineTransformIdentity; 105 | }]; 106 | } 107 | } else if (state == MJRefreshStatePulling) { 108 | [self.loadingView stopAnimating]; 109 | self.arrowView.hidden = NO; 110 | [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{ 111 | self.arrowView.transform = CGAffineTransformMakeRotation(0.000001 - M_PI); 112 | }]; 113 | } else if (state == MJRefreshStateRefreshing) { 114 | self.loadingView.alpha = 1.0; // 防止refreshing -> idle的动画完毕动作没有被执行 115 | [self.loadingView startAnimating]; 116 | self.arrowView.hidden = YES; 117 | } 118 | } 119 | @end 120 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Header/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshStateHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshHeader.h" 10 | 11 | @interface MJRefreshStateHeader : MJRefreshHeader 12 | #pragma mark - 刷新时间相关 13 | /** 利用这个block来决定显示的更新时间文字 */ 14 | @property (copy, nonatomic) NSString *(^lastUpdatedTimeText)(NSDate *lastUpdatedTime); 15 | /** 显示上一次刷新时间的label */ 16 | @property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel; 17 | 18 | #pragma mark - 状态相关 19 | /** 显示刷新状态的label */ 20 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 21 | /** 设置state状态下的文字 */ 22 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 23 | @end 24 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/Custom/Header/MJRefreshStateHeader.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshStateHeader.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshStateHeader() 12 | { 13 | /** 显示上一次刷新时间的label */ 14 | __unsafe_unretained UILabel *_lastUpdatedTimeLabel; 15 | /** 显示刷新状态的label */ 16 | __unsafe_unretained UILabel *_stateLabel; 17 | } 18 | /** 所有状态对应的文字 */ 19 | @property (strong, nonatomic) NSMutableDictionary *stateTitles; 20 | @end 21 | 22 | @implementation MJRefreshStateHeader 23 | #pragma mark - 懒加载 24 | - (NSMutableDictionary *)stateTitles 25 | { 26 | if (!_stateTitles) { 27 | self.stateTitles = [NSMutableDictionary dictionary]; 28 | } 29 | return _stateTitles; 30 | } 31 | 32 | - (UILabel *)stateLabel 33 | { 34 | if (!_stateLabel) { 35 | [self addSubview:_stateLabel = [UILabel label]]; 36 | } 37 | return _stateLabel; 38 | } 39 | 40 | - (UILabel *)lastUpdatedTimeLabel 41 | { 42 | if (!_lastUpdatedTimeLabel) { 43 | [self addSubview:_lastUpdatedTimeLabel = [UILabel label]]; 44 | } 45 | return _lastUpdatedTimeLabel; 46 | } 47 | 48 | #pragma mark - 公共方法 49 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state 50 | { 51 | if (title == nil) return; 52 | self.stateTitles[@(state)] = title; 53 | self.stateLabel.text = self.stateTitles[@(self.state)]; 54 | } 55 | 56 | #pragma mark - 日历获取在9.x之后的系统使用currentCalendar会出异常。在8.0之后使用系统新API。 57 | - (NSCalendar *)currentCalendar { 58 | if ([NSCalendar respondsToSelector:@selector(calendarWithIdentifier:)]) { 59 | return [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; 60 | } 61 | return [NSCalendar currentCalendar]; 62 | } 63 | 64 | #pragma mark key的处理 65 | - (void)setLastUpdatedTimeKey:(NSString *)lastUpdatedTimeKey 66 | { 67 | [super setLastUpdatedTimeKey:lastUpdatedTimeKey]; 68 | 69 | // 如果label隐藏了,就不用再处理 70 | if (self.lastUpdatedTimeLabel.hidden) return; 71 | 72 | NSDate *lastUpdatedTime = [[NSUserDefaults standardUserDefaults] objectForKey:lastUpdatedTimeKey]; 73 | 74 | // 如果有block 75 | if (self.lastUpdatedTimeText) { 76 | self.lastUpdatedTimeLabel.text = self.lastUpdatedTimeText(lastUpdatedTime); 77 | return; 78 | } 79 | 80 | if (lastUpdatedTime) { 81 | // 1.获得年月日 82 | NSCalendar *calendar = [self currentCalendar]; 83 | NSUInteger unitFlags = NSCalendarUnitYear| NSCalendarUnitMonth | NSCalendarUnitDay |NSCalendarUnitHour |NSCalendarUnitMinute; 84 | NSDateComponents *cmp1 = [calendar components:unitFlags fromDate:lastUpdatedTime]; 85 | NSDateComponents *cmp2 = [calendar components:unitFlags fromDate:[NSDate date]]; 86 | 87 | // 2.格式化日期 88 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 89 | if ([cmp1 day] == [cmp2 day]) { // 今天 90 | formatter.dateFormat = @"今天 HH:mm"; 91 | } else if ([cmp1 year] == [cmp2 year]) { // 今年 92 | formatter.dateFormat = @"MM-dd HH:mm"; 93 | } else { 94 | formatter.dateFormat = @"yyyy-MM-dd HH:mm"; 95 | } 96 | NSString *time = [formatter stringFromDate:lastUpdatedTime]; 97 | 98 | // 3.显示日期 99 | self.lastUpdatedTimeLabel.text = [NSString stringWithFormat:@"最后更新:%@", time]; 100 | } else { 101 | self.lastUpdatedTimeLabel.text = @"最后更新:无记录"; 102 | } 103 | } 104 | 105 | #pragma mark - 覆盖父类的方法 106 | - (void)prepare 107 | { 108 | [super prepare]; 109 | 110 | // 初始化文字 111 | [self setTitle:MJRefreshHeaderIdleText forState:MJRefreshStateIdle]; 112 | [self setTitle:MJRefreshHeaderPullingText forState:MJRefreshStatePulling]; 113 | [self setTitle:MJRefreshHeaderRefreshingText forState:MJRefreshStateRefreshing]; 114 | } 115 | 116 | - (void)placeSubviews 117 | { 118 | [super placeSubviews]; 119 | 120 | if (self.stateLabel.hidden) return; 121 | 122 | BOOL noConstrainsOnStatusLabel = self.stateLabel.constraints.count == 0; 123 | 124 | if (self.lastUpdatedTimeLabel.hidden) { 125 | // 状态 126 | if (noConstrainsOnStatusLabel) self.stateLabel.frame = self.bounds; 127 | } else { 128 | CGFloat stateLabelH = self.mj_h * 0.5; 129 | // 状态 130 | if (noConstrainsOnStatusLabel) { 131 | self.stateLabel.mj_x = 0; 132 | self.stateLabel.mj_y = 0; 133 | self.stateLabel.mj_w = self.mj_w; 134 | self.stateLabel.mj_h = stateLabelH; 135 | } 136 | 137 | // 更新时间 138 | if (self.lastUpdatedTimeLabel.constraints.count == 0) { 139 | self.lastUpdatedTimeLabel.mj_x = 0; 140 | self.lastUpdatedTimeLabel.mj_y = stateLabelH; 141 | self.lastUpdatedTimeLabel.mj_w = self.mj_w; 142 | self.lastUpdatedTimeLabel.mj_h = self.mj_h - self.lastUpdatedTimeLabel.mj_y; 143 | } 144 | } 145 | } 146 | 147 | - (void)setState:(MJRefreshState)state 148 | { 149 | MJRefreshCheckState 150 | 151 | // 设置状态文字 152 | self.stateLabel.text = self.stateTitles[@(state)]; 153 | 154 | // 重新设置key(重新显示时间) 155 | self.lastUpdatedTimeKey = self.lastUpdatedTimeKey; 156 | } 157 | @end 158 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/MJRefresh.bundle/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/MJRefresh.bundle/arrow@2x.png -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | 4 | #import "UIScrollView+MJRefresh.h" 5 | #import "UIScrollView+MJExtension.h" 6 | #import "UIView+MJExtension.h" 7 | 8 | #import "MJRefreshNormalHeader.h" 9 | #import "MJRefreshGifHeader.h" 10 | 11 | #import "MJRefreshBackNormalFooter.h" 12 | #import "MJRefreshBackGifFooter.h" 13 | #import "MJRefreshAutoNormalFooter.h" 14 | #import "MJRefreshAutoGifFooter.h" -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/MJRefreshConst.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | #import 4 | #import 5 | 6 | // 弱引用 7 | #define MJWeakSelf __weak typeof(self) weakSelf = self; 8 | 9 | // 日志输出 10 | #ifdef DEBUG 11 | #define MJRefreshLog(...) NSLog(__VA_ARGS__) 12 | #else 13 | #define MJRefreshLog(...) 14 | #endif 15 | 16 | // 过期提醒 17 | #define MJRefreshDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) 18 | 19 | // 运行时objc_msgSend 20 | #define MJRefreshMsgSend(...) ((void (*)(void *, SEL, UIView *))objc_msgSend)(__VA_ARGS__) 21 | #define MJRefreshMsgTarget(target) (__bridge void *)(target) 22 | 23 | // RGB颜色 24 | #define MJRefreshColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0] 25 | 26 | // 文字颜色 27 | #define MJRefreshLabelTextColor MJRefreshColor(90, 90, 90) 28 | 29 | // 字体大小 30 | #define MJRefreshLabelFont [UIFont boldSystemFontOfSize:14] 31 | 32 | // 图片路径 33 | #define MJRefreshSrcName(file) [@"MJRefresh.bundle" stringByAppendingPathComponent:file] 34 | #define MJRefreshFrameworkSrcName(file) [@"Frameworks/MJRefresh.framework/MJRefresh.bundle" stringByAppendingPathComponent:file] 35 | 36 | // 常量 37 | UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight; 38 | UIKIT_EXTERN const CGFloat MJRefreshFooterHeight; 39 | UIKIT_EXTERN const CGFloat MJRefreshFastAnimationDuration; 40 | UIKIT_EXTERN const CGFloat MJRefreshSlowAnimationDuration; 41 | 42 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentOffset; 43 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentSize; 44 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentInset; 45 | UIKIT_EXTERN NSString *const MJRefreshKeyPathPanState; 46 | 47 | UIKIT_EXTERN NSString *const MJRefreshHeaderLastUpdatedTimeKey; 48 | 49 | UIKIT_EXTERN NSString *const MJRefreshHeaderIdleText; 50 | UIKIT_EXTERN NSString *const MJRefreshHeaderPullingText; 51 | UIKIT_EXTERN NSString *const MJRefreshHeaderRefreshingText; 52 | 53 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterIdleText; 54 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterRefreshingText; 55 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterNoMoreDataText; 56 | 57 | UIKIT_EXTERN NSString *const MJRefreshBackFooterIdleText; 58 | UIKIT_EXTERN NSString *const MJRefreshBackFooterPullingText; 59 | UIKIT_EXTERN NSString *const MJRefreshBackFooterRefreshingText; 60 | UIKIT_EXTERN NSString *const MJRefreshBackFooterNoMoreDataText; 61 | 62 | // 状态检查 63 | #define MJRefreshCheckState \ 64 | MJRefreshState oldState = self.state; \ 65 | if (state == oldState) return; \ 66 | [super setState:state]; 67 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/MJRefreshConst.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | #import 4 | 5 | const CGFloat MJRefreshHeaderHeight = 54.0; 6 | const CGFloat MJRefreshFooterHeight = 44.0; 7 | const CGFloat MJRefreshFastAnimationDuration = 0.25; 8 | const CGFloat MJRefreshSlowAnimationDuration = 0.4; 9 | 10 | NSString *const MJRefreshKeyPathContentOffset = @"contentOffset"; 11 | NSString *const MJRefreshKeyPathContentInset = @"contentInset"; 12 | NSString *const MJRefreshKeyPathContentSize = @"contentSize"; 13 | NSString *const MJRefreshKeyPathPanState = @"state"; 14 | 15 | NSString *const MJRefreshHeaderLastUpdatedTimeKey = @"MJRefreshHeaderLastUpdatedTimeKey"; 16 | 17 | NSString *const MJRefreshHeaderIdleText = @"下拉可以刷新"; 18 | NSString *const MJRefreshHeaderPullingText = @"松开立即刷新"; 19 | NSString *const MJRefreshHeaderRefreshingText = @"正在刷新数据中..."; 20 | 21 | NSString *const MJRefreshAutoFooterIdleText = @"点击或上拉加载更多"; 22 | NSString *const MJRefreshAutoFooterRefreshingText = @"正在加载更多的数据..."; 23 | NSString *const MJRefreshAutoFooterNoMoreDataText = @"已经全部加载完毕"; 24 | 25 | NSString *const MJRefreshBackFooterIdleText = @"上拉可以加载更多"; 26 | NSString *const MJRefreshBackFooterPullingText = @"松开立即加载更多"; 27 | NSString *const MJRefreshBackFooterRefreshingText = @"正在加载更多的数据..."; 28 | NSString *const MJRefreshBackFooterNoMoreDataText = @"已经全部加载完毕"; -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIScrollView (MJExtension) 13 | @property (assign, nonatomic) CGFloat mj_insetT; 14 | @property (assign, nonatomic) CGFloat mj_insetB; 15 | @property (assign, nonatomic) CGFloat mj_insetL; 16 | @property (assign, nonatomic) CGFloat mj_insetR; 17 | 18 | @property (assign, nonatomic) CGFloat mj_offsetX; 19 | @property (assign, nonatomic) CGFloat mj_offsetY; 20 | 21 | @property (assign, nonatomic) CGFloat mj_contentW; 22 | @property (assign, nonatomic) CGFloat mj_contentH; 23 | @end 24 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/UIScrollView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+Extension.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIScrollView+MJExtension.h" 11 | #import 12 | 13 | @implementation UIScrollView (MJExtension) 14 | 15 | - (void)setMj_insetT:(CGFloat)mj_insetT 16 | { 17 | UIEdgeInsets inset = self.contentInset; 18 | inset.top = mj_insetT; 19 | self.contentInset = inset; 20 | } 21 | 22 | - (CGFloat)mj_insetT 23 | { 24 | return self.contentInset.top; 25 | } 26 | 27 | - (void)setMj_insetB:(CGFloat)mj_insetB 28 | { 29 | UIEdgeInsets inset = self.contentInset; 30 | inset.bottom = mj_insetB; 31 | self.contentInset = inset; 32 | } 33 | 34 | - (CGFloat)mj_insetB 35 | { 36 | return self.contentInset.bottom; 37 | } 38 | 39 | - (void)setMj_insetL:(CGFloat)mj_insetL 40 | { 41 | UIEdgeInsets inset = self.contentInset; 42 | inset.left = mj_insetL; 43 | self.contentInset = inset; 44 | } 45 | 46 | - (CGFloat)mj_insetL 47 | { 48 | return self.contentInset.left; 49 | } 50 | 51 | - (void)setMj_insetR:(CGFloat)mj_insetR 52 | { 53 | UIEdgeInsets inset = self.contentInset; 54 | inset.right = mj_insetR; 55 | self.contentInset = inset; 56 | } 57 | 58 | - (CGFloat)mj_insetR 59 | { 60 | return self.contentInset.right; 61 | } 62 | 63 | - (void)setMj_offsetX:(CGFloat)mj_offsetX 64 | { 65 | CGPoint offset = self.contentOffset; 66 | offset.x = mj_offsetX; 67 | self.contentOffset = offset; 68 | } 69 | 70 | - (CGFloat)mj_offsetX 71 | { 72 | return self.contentOffset.x; 73 | } 74 | 75 | - (void)setMj_offsetY:(CGFloat)mj_offsetY 76 | { 77 | CGPoint offset = self.contentOffset; 78 | offset.y = mj_offsetY; 79 | self.contentOffset = offset; 80 | } 81 | 82 | - (CGFloat)mj_offsetY 83 | { 84 | return self.contentOffset.y; 85 | } 86 | 87 | - (void)setMj_contentW:(CGFloat)mj_contentW 88 | { 89 | CGSize size = self.contentSize; 90 | size.width = mj_contentW; 91 | self.contentSize = size; 92 | } 93 | 94 | - (CGFloat)mj_contentW 95 | { 96 | return self.contentSize.width; 97 | } 98 | 99 | - (void)setMj_contentH:(CGFloat)mj_contentH 100 | { 101 | CGSize size = self.contentSize; 102 | size.height = mj_contentH; 103 | self.contentSize = size; 104 | } 105 | 106 | - (CGFloat)mj_contentH 107 | { 108 | return self.contentSize.height; 109 | } 110 | @end 111 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+MJRefresh.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 给ScrollView增加下拉刷新、上拉刷新的功能 9 | 10 | #import 11 | #import "MJRefreshConst.h" 12 | 13 | @class MJRefreshHeader, MJRefreshFooter; 14 | 15 | @interface UIScrollView (MJRefresh) 16 | /** 下拉刷新控件 */ 17 | @property (strong, nonatomic) MJRefreshHeader *mj_header; 18 | @property (strong, nonatomic) MJRefreshHeader *header MJRefreshDeprecated("使用mj_header"); 19 | /** 上拉刷新控件 */ 20 | @property (strong, nonatomic) MJRefreshFooter *mj_footer; 21 | @property (strong, nonatomic) MJRefreshFooter *footer MJRefreshDeprecated("使用mj_footer"); 22 | 23 | #pragma mark - other 24 | - (NSInteger)mj_totalDataCount; 25 | @property (copy, nonatomic) void (^mj_reloadDataBlock)(NSInteger totalDataCount); 26 | @end 27 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/UIScrollView+MJRefresh.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+MJRefresh.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIScrollView+MJRefresh.h" 11 | #import "MJRefreshHeader.h" 12 | #import "MJRefreshFooter.h" 13 | #import 14 | 15 | @implementation NSObject (MJRefresh) 16 | 17 | + (void)exchangeInstanceMethod1:(SEL)method1 method2:(SEL)method2 18 | { 19 | method_exchangeImplementations(class_getInstanceMethod(self, method1), class_getInstanceMethod(self, method2)); 20 | } 21 | 22 | + (void)exchangeClassMethod1:(SEL)method1 method2:(SEL)method2 23 | { 24 | method_exchangeImplementations(class_getClassMethod(self, method1), class_getClassMethod(self, method2)); 25 | } 26 | 27 | @end 28 | 29 | @implementation UIScrollView (MJRefresh) 30 | 31 | #pragma mark - header 32 | static const char MJRefreshHeaderKey = '\0'; 33 | - (void)setMj_header:(MJRefreshHeader *)mj_header 34 | { 35 | if (mj_header != self.mj_header) { 36 | // 删除旧的,添加新的 37 | [self.mj_header removeFromSuperview]; 38 | [self insertSubview:mj_header atIndex:0]; 39 | 40 | // 存储新的 41 | [self willChangeValueForKey:@"mj_header"]; // KVO 42 | objc_setAssociatedObject(self, &MJRefreshHeaderKey, 43 | mj_header, OBJC_ASSOCIATION_ASSIGN); 44 | [self didChangeValueForKey:@"mj_header"]; // KVO 45 | } 46 | } 47 | 48 | - (MJRefreshHeader *)mj_header 49 | { 50 | return objc_getAssociatedObject(self, &MJRefreshHeaderKey); 51 | } 52 | 53 | #pragma mark - footer 54 | static const char MJRefreshFooterKey = '\0'; 55 | - (void)setMj_footer:(MJRefreshFooter *)mj_footer 56 | { 57 | if (mj_footer != self.mj_footer) { 58 | // 删除旧的,添加新的 59 | [self.mj_footer removeFromSuperview]; 60 | [self addSubview:mj_footer]; 61 | 62 | // 存储新的 63 | [self willChangeValueForKey:@"mj_footer"]; // KVO 64 | objc_setAssociatedObject(self, &MJRefreshFooterKey, 65 | mj_footer, OBJC_ASSOCIATION_ASSIGN); 66 | [self didChangeValueForKey:@"mj_footer"]; // KVO 67 | } 68 | } 69 | 70 | - (MJRefreshFooter *)mj_footer 71 | { 72 | return objc_getAssociatedObject(self, &MJRefreshFooterKey); 73 | } 74 | 75 | #pragma mark - 过期 76 | - (void)setFooter:(MJRefreshFooter *)footer 77 | { 78 | self.mj_footer = footer; 79 | } 80 | 81 | - (MJRefreshFooter *)footer 82 | { 83 | return self.mj_footer; 84 | } 85 | 86 | - (void)setHeader:(MJRefreshHeader *)header 87 | { 88 | self.mj_header = header; 89 | } 90 | 91 | - (MJRefreshHeader *)header 92 | { 93 | return self.mj_header; 94 | } 95 | 96 | #pragma mark - other 97 | - (NSInteger)mj_totalDataCount 98 | { 99 | NSInteger totalCount = 0; 100 | if ([self isKindOfClass:[UITableView class]]) { 101 | UITableView *tableView = (UITableView *)self; 102 | 103 | for (NSInteger section = 0; section 11 | 12 | @interface UIView (MJExtension) 13 | @property (assign, nonatomic) CGFloat mj_x; 14 | @property (assign, nonatomic) CGFloat mj_y; 15 | @property (assign, nonatomic) CGFloat mj_w; 16 | @property (assign, nonatomic) CGFloat mj_h; 17 | @property (assign, nonatomic) CGSize mj_size; 18 | @property (assign, nonatomic) CGPoint mj_origin; 19 | @end 20 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/MJRefresh/UIView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIView+MJExtension.h" 11 | 12 | @implementation UIView (MJExtension) 13 | - (void)setMj_x:(CGFloat)mj_x 14 | { 15 | CGRect frame = self.frame; 16 | frame.origin.x = mj_x; 17 | self.frame = frame; 18 | } 19 | 20 | - (CGFloat)mj_x 21 | { 22 | return self.frame.origin.x; 23 | } 24 | 25 | - (void)setMj_y:(CGFloat)mj_y 26 | { 27 | CGRect frame = self.frame; 28 | frame.origin.y = mj_y; 29 | self.frame = frame; 30 | } 31 | 32 | - (CGFloat)mj_y 33 | { 34 | return self.frame.origin.y; 35 | } 36 | 37 | - (void)setMj_w:(CGFloat)mj_w 38 | { 39 | CGRect frame = self.frame; 40 | frame.size.width = mj_w; 41 | self.frame = frame; 42 | } 43 | 44 | - (CGFloat)mj_w 45 | { 46 | return self.frame.size.width; 47 | } 48 | 49 | - (void)setMj_h:(CGFloat)mj_h 50 | { 51 | CGRect frame = self.frame; 52 | frame.size.height = mj_h; 53 | self.frame = frame; 54 | } 55 | 56 | - (CGFloat)mj_h 57 | { 58 | return self.frame.size.height; 59 | } 60 | 61 | - (void)setMj_size:(CGSize)mj_size 62 | { 63 | CGRect frame = self.frame; 64 | frame.size = mj_size; 65 | self.frame = frame; 66 | } 67 | 68 | - (CGSize)mj_size 69 | { 70 | return self.frame.size; 71 | } 72 | 73 | - (void)setMj_origin:(CGPoint)mj_origin 74 | { 75 | CGRect frame = self.frame; 76 | frame.origin = mj_origin; 77 | self.frame = frame; 78 | } 79 | 80 | - (CGPoint)mj_origin 81 | { 82 | return self.frame.origin; 83 | } 84 | @end 85 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/entries: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/format: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/09/09bdfe405060f722eb541fbdb6285d064373865f.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import "NSData+ImageContentType.h" 7 | 8 | 9 | @implementation NSData (ImageContentType) 10 | 11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data { 12 | uint8_t c; 13 | [data getBytes:&c length:1]; 14 | switch (c) { 15 | case 0xFF: 16 | return @"image/jpeg"; 17 | case 0x89: 18 | return @"image/png"; 19 | case 0x47: 20 | return @"image/gif"; 21 | case 0x49: 22 | case 0x4D: 23 | return @"image/tiff"; 24 | case 0x52: 25 | // R as RIFF for WEBP 26 | if ([data length] < 12) { 27 | return nil; 28 | } 29 | 30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 32 | return @"image/webp"; 33 | } 34 | 35 | return nil; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | 42 | 43 | @implementation NSData (ImageContentTypeDeprecated) 44 | 45 | + (NSString *)contentTypeForImageData:(NSData *)data { 46 | return [self sd_contentTypeForImageData:data]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/20/2074587bedadcefbff98e8590a2d42b7448a7326.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher; 72 | 73 | /** 74 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 75 | * currently one image is downloaded at a time, 76 | * and skips images for failed downloads and proceed to the next image in the list 77 | * 78 | * @param urls list of URLs to prefetch 79 | */ 80 | - (void)prefetchURLs:(NSArray *)urls; 81 | 82 | /** 83 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 84 | * currently one image is downloaded at a time, 85 | * and skips images for failed downloads and proceed to the next image in the list 86 | * 87 | * @param urls list of URLs to prefetch 88 | * @param progressBlock block to be called when progress updates; 89 | * first parameter is the number of completed (successful or not) requests, 90 | * second parameter is the total number of images originally requested to be prefetched 91 | * @param completionBlock block to be called when prefetching is completed 92 | * first param is the number of completed (successful or not) requests, 93 | * second parameter is the number of skipped requests 94 | */ 95 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; 96 | 97 | /** 98 | * Remove and cancel queued list 99 | */ 100 | - (void)cancelPrefetching; 101 | 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/25/25969c88968e7c352a185561688f04247b4ff7a1.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @interface UIView (WebCacheOperation) 13 | 14 | /** 15 | * Set the image load operation (storage in a UIView based dictionary) 16 | * 17 | * @param operation the operation 18 | * @param key key for storing the operation 19 | */ 20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; 21 | 22 | /** 23 | * Cancel all operations for the current UIView and key 24 | * 25 | * @param key key for identifying the operations 26 | */ 27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; 28 | 29 | /** 30 | * Just remove the operations corresponding to the current UIView and key without cancelling them 31 | * 32 | * @param key key for identifying the operations 33 | */ 34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/67/67a518a5b2a75f5616f3fa164c3398d0e30bd6ad.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // SDWebImageCompat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 11/12/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { 16 | if (!image) { 17 | return nil; 18 | } 19 | 20 | if ([image.images count] > 0) { 21 | NSMutableArray *scaledImages = [NSMutableArray array]; 22 | 23 | for (UIImage *tempImage in image.images) { 24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 25 | } 26 | 27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 28 | } 29 | else { 30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 31 | CGFloat scale = 1.0; 32 | if (key.length >= 8) { 33 | // Search @2x. at the end of the string, before a 3 to 4 extension length (only if key len is 8 or more @2x. + 4 len ext) 34 | NSRange range = [key rangeOfString:@"@2x." options:0 range:NSMakeRange(key.length - 8, 5)]; 35 | if (range.location != NSNotFound) { 36 | scale = 2.0; 37 | } 38 | } 39 | 40 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 41 | image = scaledImage; 42 | } 43 | return image; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/6b/6b3378061f6886e54b3dfb5ff5610903f0005e85.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 17 | #error SDWebImage doesn't support Deployement Target version < 5.0 18 | #endif 19 | 20 | #if !TARGET_OS_IPHONE 21 | #import 22 | #ifndef UIImage 23 | #define UIImage NSImage 24 | #endif 25 | #ifndef UIImageView 26 | #define UIImageView NSImageView 27 | #endif 28 | #else 29 | 30 | #import 31 | 32 | #endif 33 | 34 | #ifndef NS_ENUM 35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 36 | #endif 37 | 38 | #ifndef NS_OPTIONS 39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 40 | #endif 41 | 42 | #if OS_OBJECT_USE_OBJC 43 | #undef SDDispatchQueueRelease 44 | #undef SDDispatchQueueSetterSementics 45 | #define SDDispatchQueueRelease(q) 46 | #define SDDispatchQueueSetterSementics strong 47 | #else 48 | #undef SDDispatchQueueRelease 49 | #undef SDDispatchQueueSetterSementics 50 | #define SDDispatchQueueRelease(q) (dispatch_release(q)) 51 | #define SDDispatchQueueSetterSementics assign 52 | #endif 53 | 54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 55 | 56 | typedef void(^SDWebImageNoParamsBlock)(); 57 | 58 | #define dispatch_main_sync_safe(block)\ 59 | if ([NSThread isMainThread]) {\ 60 | block();\ 61 | } else {\ 62 | dispatch_sync(dispatch_get_main_queue(), block);\ 63 | } 64 | 65 | #define dispatch_main_async_safe(block)\ 66 | if ([NSThread isMainThread]) {\ 67 | block();\ 68 | } else {\ 69 | dispatch_async(dispatch_get_main_queue(), block);\ 70 | } 71 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/7c/7c5002551466f2c235843f96a8cd0cf47231cf2f.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @interface NSData (ImageContentType) 9 | 10 | /** 11 | * Compute the content type for an image data 12 | * 13 | * @param data the input data 14 | * 15 | * @return the content type as string (i.e. image/jpeg, image/gif) 16 | */ 17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data; 18 | 19 | @end 20 | 21 | 22 | @interface NSData (ImageContentTypeDeprecated) 23 | 24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/a7/a78d714b2e435e97793ab3a819bc19eee897bdcf.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import "SDWebImageDecoder.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 16 | if (image.images) { 17 | // Do not decode animated images 18 | return image; 19 | } 20 | 21 | CGImageRef imageRef = image.CGImage; 22 | CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); 23 | CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize}; 24 | 25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 26 | CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); 27 | 28 | int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask); 29 | BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone || 30 | infoMask == kCGImageAlphaNoneSkipFirst || 31 | infoMask == kCGImageAlphaNoneSkipLast); 32 | 33 | // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB. 34 | // https://developer.apple.com/library/mac/#qa/qa1037/_index.html 35 | if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) { 36 | // Unset the old alpha info. 37 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 38 | 39 | // Set noneSkipFirst. 40 | bitmapInfo |= kCGImageAlphaNoneSkipFirst; 41 | } 42 | // Some PNGs tell us they have alpha but only 3 components. Odd. 43 | else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) { 44 | // Unset the old alpha info. 45 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 46 | bitmapInfo |= kCGImageAlphaPremultipliedFirst; 47 | } 48 | 49 | // It calculates the bytes-per-row based on the bitsPerComponent and width arguments. 50 | CGContextRef context = CGBitmapContextCreate(NULL, 51 | imageSize.width, 52 | imageSize.height, 53 | CGImageGetBitsPerComponent(imageRef), 54 | 0, 55 | colorSpace, 56 | bitmapInfo); 57 | CGColorSpaceRelease(colorSpace); 58 | 59 | // If failed, return undecompressed image 60 | if (!context) return image; 61 | 62 | CGContextDrawImage(context, imageRect, imageRef); 63 | CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context); 64 | 65 | CGContextRelease(context); 66 | 67 | UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation]; 68 | CGImageRelease(decompressedImageRef); 69 | return decompressedImage; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/bd/bdf510558c208a7f68839fb4dcb86bc3a28bf076.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MultiFormat) 12 | 13 | + (UIImage *)sd_imageWithData:(NSData *)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/d7/d70db16978149e237998f8c8062573697030e330.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.h 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (GIF) 12 | 13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name; 14 | 15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 16 | 17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/da/da65f4fa0be8c1e68aa1aa3a46b76791a6030fae.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import 12 | #import "SDWebImageCompat.h" 13 | 14 | @interface UIImage (ForceDecode) 15 | 16 | + (UIImage *)decodedImageWithImage:(UIImage *)image; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/e0/e08c7c1e5862b0017c169269ccda4bf201088923.svn-base: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "UIImage+GIF.h" 11 | #import "NSData+ImageContentType.h" 12 | #import 13 | 14 | #ifdef SD_WEBP 15 | #import "UIImage+WebP.h" 16 | #endif 17 | 18 | @implementation UIImage (MultiFormat) 19 | 20 | + (UIImage *)sd_imageWithData:(NSData *)data { 21 | UIImage *image; 22 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; 23 | if ([imageContentType isEqualToString:@"image/gif"]) { 24 | image = [UIImage sd_animatedGIFWithData:data]; 25 | } 26 | #ifdef SD_WEBP 27 | else if ([imageContentType isEqualToString:@"image/webp"]) 28 | { 29 | image = [UIImage sd_imageWithWebPData:data]; 30 | } 31 | #endif 32 | else { 33 | image = [[UIImage alloc] initWithData:data]; 34 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; 35 | if (orientation != UIImageOrientationUp) { 36 | image = [UIImage imageWithCGImage:image.CGImage 37 | scale:image.scale 38 | orientation:orientation]; 39 | } 40 | } 41 | 42 | 43 | return image; 44 | } 45 | 46 | 47 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { 48 | UIImageOrientation result = UIImageOrientationUp; 49 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); 50 | if (imageSource) { 51 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); 52 | if (properties) { 53 | CFTypeRef val; 54 | int exifOrientation; 55 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); 56 | if (val) { 57 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); 58 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; 59 | } // else - if it's not set it remains at up 60 | CFRelease((CFTypeRef) properties); 61 | } else { 62 | //NSLog(@"NO PROPERTIES, FAIL"); 63 | } 64 | CFRelease(imageSource); 65 | } 66 | return result; 67 | } 68 | 69 | #pragma mark EXIF orientation tag converter 70 | // Convert an EXIF image orientation to an iOS one. 71 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html 72 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { 73 | UIImageOrientation orientation = UIImageOrientationUp; 74 | switch (exifOrientation) { 75 | case 1: 76 | orientation = UIImageOrientationUp; 77 | break; 78 | 79 | case 3: 80 | orientation = UIImageOrientationDown; 81 | break; 82 | 83 | case 8: 84 | orientation = UIImageOrientationLeft; 85 | break; 86 | 87 | case 6: 88 | orientation = UIImageOrientationRight; 89 | break; 90 | 91 | case 2: 92 | orientation = UIImageOrientationUpMirrored; 93 | break; 94 | 95 | case 4: 96 | orientation = UIImageOrientationDownMirrored; 97 | break; 98 | 99 | case 5: 100 | orientation = UIImageOrientationLeftMirrored; 101 | break; 102 | 103 | case 7: 104 | orientation = UIImageOrientationRightMirrored; 105 | break; 106 | default: 107 | break; 108 | } 109 | return orientation; 110 | } 111 | 112 | 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/e3/e34b1cdcfc01cddcc52f78f8ba5ab3102dfc90c0.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | #import "UIView+WebCacheOperation.h" 11 | 12 | #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage" 13 | 14 | @implementation UIImageView (HighlightedWebCache) 15 | 16 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url { 17 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 18 | } 19 | 20 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 21 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 22 | } 23 | 24 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { 25 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 26 | } 27 | 28 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { 29 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 30 | } 31 | 32 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { 33 | [self sd_cancelCurrentHighlightedImageLoad]; 34 | 35 | if (url) { 36 | __weak UIImageView *wself = self; 37 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 38 | if (!wself) return; 39 | dispatch_main_sync_safe (^ 40 | { 41 | if (!wself) return; 42 | if (image) { 43 | wself.highlightedImage = image; 44 | [wself setNeedsLayout]; 45 | } 46 | if (completedBlock && finished) { 47 | completedBlock(image, error, cacheType, url); 48 | } 49 | }); 50 | }]; 51 | [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey]; 52 | } else { 53 | dispatch_main_async_safe(^{ 54 | NSError *error = [NSError errorWithDomain:@"SDWebImageErrorDomain" code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 55 | if (completedBlock) { 56 | completedBlock(nil, error, SDImageCacheTypeNone, url); 57 | } 58 | }); 59 | } 60 | } 61 | 62 | - (void)sd_cancelCurrentHighlightedImageLoad { 63 | [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey]; 64 | } 65 | 66 | @end 67 | 68 | 69 | @implementation UIImageView (HighlightedWebCacheDeprecated) 70 | 71 | - (void)setHighlightedImageWithURL:(NSURL *)url { 72 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 73 | } 74 | 75 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 76 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 77 | } 78 | 79 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { 80 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 81 | if (completedBlock) { 82 | completedBlock(image, error, cacheType); 83 | } 84 | }]; 85 | } 86 | 87 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { 88 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 89 | if (completedBlock) { 90 | completedBlock(image, error, cacheType); 91 | } 92 | }]; 93 | } 94 | 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { 96 | [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 97 | if (completedBlock) { 98 | completedBlock(image, error, cacheType); 99 | } 100 | }]; 101 | } 102 | 103 | - (void)cancelCurrentHighlightedImageLoad { 104 | [self sd_cancelCurrentHighlightedImageLoad]; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/e7/e73bf1494c4e0491d3225ccb624be32fab494c94.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/ee/ee436375bc3765951275c9c11aa51d9d1afe2049.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | @interface SDWebImageDownloaderOperation : NSOperation 14 | 15 | /** 16 | * The request used by the operation's connection. 17 | */ 18 | @property (strong, nonatomic, readonly) NSURLRequest *request; 19 | 20 | 21 | @property (assign, nonatomic) BOOL shouldDecompressImages; 22 | 23 | /** 24 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. 25 | * 26 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. 27 | */ 28 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage; 29 | 30 | /** 31 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 32 | * 33 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 34 | */ 35 | @property (nonatomic, strong) NSURLCredential *credential; 36 | 37 | /** 38 | * The SDWebImageDownloaderOptions for the receiver. 39 | */ 40 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 41 | 42 | /** 43 | * Initializes a `SDWebImageDownloaderOperation` object 44 | * 45 | * @see SDWebImageDownloaderOperation 46 | * 47 | * @param request the URL request 48 | * @param options downloader options 49 | * @param progressBlock the block executed when a new chunk of data arrives. 50 | * @note the progress block is executed on a background queue 51 | * @param completedBlock the block executed when the download is done. 52 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 53 | * @param cancelBlock the block executed if the download (operation) is cancelled 54 | * 55 | * @return the initialized instance 56 | */ 57 | - (id)initWithRequest:(NSURLRequest *)request 58 | options:(SDWebImageDownloaderOptions)options 59 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 60 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock 61 | cancelled:(SDWebImageNoParamsBlock)cancelBlock; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/pristine/f6/f6379654db2f6b280c3e79a674b301902b76fcf7.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | #import "objc/runtime.h" 11 | 12 | static char loadOperationKey; 13 | 14 | @implementation UIView (WebCacheOperation) 15 | 16 | - (NSMutableDictionary *)operationDictionary { 17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 18 | if (operations) { 19 | return operations; 20 | } 21 | operations = [NSMutableDictionary dictionary]; 22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | return operations; 24 | } 25 | 26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { 27 | [self sd_cancelImageLoadOperationWithKey:key]; 28 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 29 | [operationDictionary setObject:operation forKey:key]; 30 | } 31 | 32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { 33 | // Cancel in progress downloader from queue 34 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 35 | id operations = [operationDictionary objectForKey:key]; 36 | if (operations) { 37 | if ([operations isKindOfClass:[NSArray class]]) { 38 | for (id operation in operations) { 39 | if (operation) { 40 | [operation cancel]; 41 | } 42 | } 43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 44 | [(id) operations cancel]; 45 | } 46 | [operationDictionary removeObjectForKey:key]; 47 | } 48 | } 49 | 50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key { 51 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 52 | [operationDictionary removeObjectForKey:key]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/wc.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JackiePS/avplayer/f8e581c9c5583b2d59e5f6dc3ced872b4d656d13/ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/.svn/wc.db -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @interface NSData (ImageContentType) 9 | 10 | /** 11 | * Compute the content type for an image data 12 | * 13 | * @param data the input data 14 | * 15 | * @return the content type as string (i.e. image/jpeg, image/gif) 16 | */ 17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data; 18 | 19 | @end 20 | 21 | 22 | @interface NSData (ImageContentTypeDeprecated) 23 | 24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`"); 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Fabrice Aneche on 06/01/14. 3 | // Copyright (c) 2014 Dailymotion. All rights reserved. 4 | // 5 | 6 | #import "NSData+ImageContentType.h" 7 | 8 | 9 | @implementation NSData (ImageContentType) 10 | 11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data { 12 | uint8_t c; 13 | [data getBytes:&c length:1]; 14 | switch (c) { 15 | case 0xFF: 16 | return @"image/jpeg"; 17 | case 0x89: 18 | return @"image/png"; 19 | case 0x47: 20 | return @"image/gif"; 21 | case 0x49: 22 | case 0x4D: 23 | return @"image/tiff"; 24 | case 0x52: 25 | // R as RIFF for WEBP 26 | if ([data length] < 12) { 27 | return nil; 28 | } 29 | 30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 32 | return @"image/webp"; 33 | } 34 | 35 | return nil; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | 42 | 43 | @implementation NSData (ImageContentTypeDeprecated) 44 | 45 | + (NSString *)contentTypeForImageData:(NSData *)data { 46 | return [self sd_contentTypeForImageData:data]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 17 | #error SDWebImage doesn't support Deployement Target version < 5.0 18 | #endif 19 | 20 | #if !TARGET_OS_IPHONE 21 | #import 22 | #ifndef UIImage 23 | #define UIImage NSImage 24 | #endif 25 | #ifndef UIImageView 26 | #define UIImageView NSImageView 27 | #endif 28 | #else 29 | 30 | #import 31 | 32 | #endif 33 | 34 | #ifndef NS_ENUM 35 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 36 | #endif 37 | 38 | #ifndef NS_OPTIONS 39 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 40 | #endif 41 | 42 | #if OS_OBJECT_USE_OBJC 43 | #undef SDDispatchQueueRelease 44 | #undef SDDispatchQueueSetterSementics 45 | #define SDDispatchQueueRelease(q) 46 | #define SDDispatchQueueSetterSementics strong 47 | #else 48 | #undef SDDispatchQueueRelease 49 | #undef SDDispatchQueueSetterSementics 50 | #define SDDispatchQueueRelease(q) (dispatch_release(q)) 51 | #define SDDispatchQueueSetterSementics assign 52 | #endif 53 | 54 | extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 55 | 56 | typedef void(^SDWebImageNoParamsBlock)(); 57 | 58 | #define dispatch_main_sync_safe(block)\ 59 | if ([NSThread isMainThread]) {\ 60 | block();\ 61 | } else {\ 62 | dispatch_sync(dispatch_get_main_queue(), block);\ 63 | } 64 | 65 | #define dispatch_main_async_safe(block)\ 66 | if ([NSThread isMainThread]) {\ 67 | block();\ 68 | } else {\ 69 | dispatch_async(dispatch_get_main_queue(), block);\ 70 | } 71 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | // 2 | // SDWebImageCompat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 11/12/12. 6 | // Copyright (c) 2012 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) { 16 | if (!image) { 17 | return nil; 18 | } 19 | 20 | if ([image.images count] > 0) { 21 | NSMutableArray *scaledImages = [NSMutableArray array]; 22 | 23 | for (UIImage *tempImage in image.images) { 24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 25 | } 26 | 27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 28 | } 29 | else { 30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 31 | CGFloat scale = 1.0; 32 | if (key.length >= 8) { 33 | // Search @2x. at the end of the string, before a 3 to 4 extension length (only if key len is 8 or more @2x. + 4 len ext) 34 | NSRange range = [key rangeOfString:@"@2x." options:0 range:NSMakeRange(key.length - 8, 5)]; 35 | if (range.location != NSNotFound) { 36 | scale = 2.0; 37 | } 38 | } 39 | 40 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 41 | image = scaledImage; 42 | } 43 | return image; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import 12 | #import "SDWebImageCompat.h" 13 | 14 | @interface UIImage (ForceDecode) 15 | 16 | + (UIImage *)decodedImageWithImage:(UIImage *)image; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/SDWebImageDecoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * Created by james on 9/28/11. 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | #import "SDWebImageDecoder.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 16 | if (image.images) { 17 | // Do not decode animated images 18 | return image; 19 | } 20 | 21 | CGImageRef imageRef = image.CGImage; 22 | CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); 23 | CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize}; 24 | 25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 26 | CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef); 27 | 28 | int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask); 29 | BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone || 30 | infoMask == kCGImageAlphaNoneSkipFirst || 31 | infoMask == kCGImageAlphaNoneSkipLast); 32 | 33 | // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB. 34 | // https://developer.apple.com/library/mac/#qa/qa1037/_index.html 35 | if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) { 36 | // Unset the old alpha info. 37 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 38 | 39 | // Set noneSkipFirst. 40 | bitmapInfo |= kCGImageAlphaNoneSkipFirst; 41 | } 42 | // Some PNGs tell us they have alpha but only 3 components. Odd. 43 | else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) { 44 | // Unset the old alpha info. 45 | bitmapInfo &= ~kCGBitmapAlphaInfoMask; 46 | bitmapInfo |= kCGImageAlphaPremultipliedFirst; 47 | } 48 | 49 | // It calculates the bytes-per-row based on the bitsPerComponent and width arguments. 50 | CGContextRef context = CGBitmapContextCreate(NULL, 51 | imageSize.width, 52 | imageSize.height, 53 | CGImageGetBitsPerComponent(imageRef), 54 | 0, 55 | colorSpace, 56 | bitmapInfo); 57 | CGColorSpaceRelease(colorSpace); 58 | 59 | // If failed, return undecompressed image 60 | if (!context) return image; 61 | 62 | CGContextDrawImage(context, imageRect, imageRef); 63 | CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context); 64 | 65 | CGContextRelease(context); 66 | 67 | UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation]; 68 | CGImageRelease(decompressedImageRef); 69 | return decompressedImage; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageDownloader.h" 11 | #import "SDWebImageOperation.h" 12 | 13 | @interface SDWebImageDownloaderOperation : NSOperation 14 | 15 | /** 16 | * The request used by the operation's connection. 17 | */ 18 | @property (strong, nonatomic, readonly) NSURLRequest *request; 19 | 20 | 21 | @property (assign, nonatomic) BOOL shouldDecompressImages; 22 | 23 | /** 24 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default. 25 | * 26 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`. 27 | */ 28 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage; 29 | 30 | /** 31 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`. 32 | * 33 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present. 34 | */ 35 | @property (nonatomic, strong) NSURLCredential *credential; 36 | 37 | /** 38 | * The SDWebImageDownloaderOptions for the receiver. 39 | */ 40 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options; 41 | 42 | /** 43 | * Initializes a `SDWebImageDownloaderOperation` object 44 | * 45 | * @see SDWebImageDownloaderOperation 46 | * 47 | * @param request the URL request 48 | * @param options downloader options 49 | * @param progressBlock the block executed when a new chunk of data arrives. 50 | * @note the progress block is executed on a background queue 51 | * @param completedBlock the block executed when the download is done. 52 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue 53 | * @param cancelBlock the block executed if the download (operation) is cancelled 54 | * 55 | * @return the initialized instance 56 | */ 57 | - (id)initWithRequest:(NSURLRequest *)request 58 | options:(SDWebImageDownloaderOptions)options 59 | progress:(SDWebImageDownloaderProgressBlock)progressBlock 60 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock 61 | cancelled:(SDWebImageNoParamsBlock)cancelBlock; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (nonatomic, assign) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (SDWebImagePrefetcher *)sharedImagePrefetcher; 72 | 73 | /** 74 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 75 | * currently one image is downloaded at a time, 76 | * and skips images for failed downloads and proceed to the next image in the list 77 | * 78 | * @param urls list of URLs to prefetch 79 | */ 80 | - (void)prefetchURLs:(NSArray *)urls; 81 | 82 | /** 83 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 84 | * currently one image is downloaded at a time, 85 | * and skips images for failed downloads and proceed to the next image in the list 86 | * 87 | * @param urls list of URLs to prefetch 88 | * @param progressBlock block to be called when progress updates; 89 | * first parameter is the number of completed (successful or not) requests, 90 | * second parameter is the total number of images originally requested to be prefetched 91 | * @param completionBlock block to be called when prefetching is completed 92 | * first param is the number of completed (successful or not) requests, 93 | * second parameter is the number of skipped requests 94 | */ 95 | - (void)prefetchURLs:(NSArray *)urls progress:(SDWebImagePrefetcherProgressBlock)progressBlock completed:(SDWebImagePrefetcherCompletionBlock)completionBlock; 96 | 97 | /** 98 | * Remove and cancel queued list 99 | */ 100 | - (void)cancelPrefetching; 101 | 102 | 103 | @end 104 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.h 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (GIF) 12 | 13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name; 14 | 15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 16 | 17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.h 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MultiFormat) 12 | 13 | + (UIImage *)sd_imageWithData:(NSData *)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MultiFormat.m 3 | // SDWebImage 4 | // 5 | // Created by Olivier Poitrey on 07/06/13. 6 | // Copyright (c) 2013 Dailymotion. All rights reserved. 7 | // 8 | 9 | #import "UIImage+MultiFormat.h" 10 | #import "UIImage+GIF.h" 11 | #import "NSData+ImageContentType.h" 12 | #import 13 | 14 | #ifdef SD_WEBP 15 | #import "UIImage+WebP.h" 16 | #endif 17 | 18 | @implementation UIImage (MultiFormat) 19 | 20 | + (UIImage *)sd_imageWithData:(NSData *)data { 21 | UIImage *image; 22 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data]; 23 | if ([imageContentType isEqualToString:@"image/gif"]) { 24 | image = [UIImage sd_animatedGIFWithData:data]; 25 | } 26 | #ifdef SD_WEBP 27 | else if ([imageContentType isEqualToString:@"image/webp"]) 28 | { 29 | image = [UIImage imageWithWebPData:data]; 30 | } 31 | #endif 32 | else { 33 | image = [[UIImage alloc] initWithData:data]; 34 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data]; 35 | if (orientation != UIImageOrientationUp) { 36 | image = [UIImage imageWithCGImage:image.CGImage 37 | scale:image.scale 38 | orientation:orientation]; 39 | } 40 | } 41 | 42 | 43 | return image; 44 | } 45 | 46 | 47 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData { 48 | UIImageOrientation result = UIImageOrientationUp; 49 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL); 50 | if (imageSource) { 51 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL); 52 | if (properties) { 53 | CFTypeRef val; 54 | int exifOrientation; 55 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation); 56 | if (val) { 57 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation); 58 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation]; 59 | } // else - if it's not set it remains at up 60 | CFRelease((CFTypeRef) properties); 61 | } else { 62 | //NSLog(@"NO PROPERTIES, FAIL"); 63 | } 64 | CFRelease(imageSource); 65 | } 66 | return result; 67 | } 68 | 69 | #pragma mark EXIF orientation tag converter 70 | // Convert an EXIF image orientation to an iOS one. 71 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html 72 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation { 73 | UIImageOrientation orientation = UIImageOrientationUp; 74 | switch (exifOrientation) { 75 | case 1: 76 | orientation = UIImageOrientationUp; 77 | break; 78 | 79 | case 3: 80 | orientation = UIImageOrientationDown; 81 | break; 82 | 83 | case 8: 84 | orientation = UIImageOrientationLeft; 85 | break; 86 | 87 | case 6: 88 | orientation = UIImageOrientationRight; 89 | break; 90 | 91 | case 2: 92 | orientation = UIImageOrientationUpMirrored; 93 | break; 94 | 95 | case 4: 96 | orientation = UIImageOrientationDownMirrored; 97 | break; 98 | 99 | case 5: 100 | orientation = UIImageOrientationLeftMirrored; 101 | break; 102 | 103 | case 7: 104 | orientation = UIImageOrientationRightMirrored; 105 | break; 106 | default: 107 | break; 108 | } 109 | return orientation; 110 | } 111 | 112 | 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageManager.h" 12 | 13 | /** 14 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 15 | */ 16 | @interface UIImageView (HighlightedWebCache) 17 | 18 | /** 19 | * Set the imageView `highlightedImage` with an `url`. 20 | * 21 | * The download is asynchronous and cached. 22 | * 23 | * @param url The url for the image. 24 | */ 25 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url; 26 | 27 | /** 28 | * Set the imageView `highlightedImage` with an `url` and custom options. 29 | * 30 | * The download is asynchronous and cached. 31 | * 32 | * @param url The url for the image. 33 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 34 | */ 35 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options; 36 | 37 | /** 38 | * Set the imageView `highlightedImage` with an `url`. 39 | * 40 | * The download is asynchronous and cached. 41 | * 42 | * @param url The url for the image. 43 | * @param completedBlock A block called when operation has been completed. This block has no return value 44 | * and takes the requested UIImage as first parameter. In case of error the image parameter 45 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 46 | * indicating if the image was retrived from the local cache or from the network. 47 | * The fourth parameter is the original image url. 48 | */ 49 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock; 50 | 51 | /** 52 | * Set the imageView `highlightedImage` with an `url` and custom options. 53 | * 54 | * The download is asynchronous and cached. 55 | * 56 | * @param url The url for the image. 57 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 58 | * @param completedBlock A block called when operation has been completed. This block has no return value 59 | * and takes the requested UIImage as first parameter. In case of error the image parameter 60 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 61 | * indicating if the image was retrived from the local cache or from the network. 62 | * The fourth parameter is the original image url. 63 | */ 64 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock; 65 | 66 | /** 67 | * Set the imageView `highlightedImage` with an `url` and custom options. 68 | * 69 | * The download is asynchronous and cached. 70 | * 71 | * @param url The url for the image. 72 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 73 | * @param progressBlock A block called while image is downloading 74 | * @param completedBlock A block called when operation has been completed. This block has no return value 75 | * and takes the requested UIImage as first parameter. In case of error the image parameter 76 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 77 | * indicating if the image was retrived from the local cache or from the network. 78 | * The fourth parameter is the original image url. 79 | */ 80 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock; 81 | 82 | /** 83 | * Cancel the current download 84 | */ 85 | - (void)sd_cancelCurrentHighlightedImageLoad; 86 | 87 | @end 88 | 89 | 90 | @interface UIImageView (HighlightedWebCacheDeprecated) 91 | 92 | - (void)setHighlightedImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:`"); 93 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:`"); 94 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:completed:`"); 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:completed:`"); 96 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `sd_setHighlightedImageWithURL:options:progress:completed:`"); 97 | 98 | - (void)cancelCurrentHighlightedImageLoad __deprecated_msg("Use `sd_cancelCurrentHighlightedImageLoad`"); 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/UIImageView+HighlightedWebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | #import "UIView+WebCacheOperation.h" 11 | 12 | #define UIImageViewHighlightedWebCacheOperationKey @"highlightedImage" 13 | 14 | @implementation UIImageView (HighlightedWebCache) 15 | 16 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url { 17 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 18 | } 19 | 20 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 21 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 22 | } 23 | 24 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletionBlock)completedBlock { 25 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 26 | } 27 | 28 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock { 29 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 30 | } 31 | 32 | - (void)sd_setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock { 33 | [self sd_cancelCurrentHighlightedImageLoad]; 34 | 35 | if (url) { 36 | __weak UIImageView *wself = self; 37 | id operation = [SDWebImageManager.sharedManager downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 38 | if (!wself) return; 39 | dispatch_main_sync_safe (^ 40 | { 41 | if (!wself) return; 42 | if (image) { 43 | wself.highlightedImage = image; 44 | [wself setNeedsLayout]; 45 | } 46 | if (completedBlock && finished) { 47 | completedBlock(image, error, cacheType, url); 48 | } 49 | }); 50 | }]; 51 | [self sd_setImageLoadOperation:operation forKey:UIImageViewHighlightedWebCacheOperationKey]; 52 | } else { 53 | dispatch_main_async_safe(^{ 54 | NSError *error = [NSError errorWithDomain:@"SDWebImageErrorDomain" code:-1 userInfo:@{NSLocalizedDescriptionKey : @"Trying to load a nil url"}]; 55 | if (completedBlock) { 56 | completedBlock(nil, error, SDImageCacheTypeNone, url); 57 | } 58 | }); 59 | } 60 | } 61 | 62 | - (void)sd_cancelCurrentHighlightedImageLoad { 63 | [self sd_cancelImageLoadOperationWithKey:UIImageViewHighlightedWebCacheOperationKey]; 64 | } 65 | 66 | @end 67 | 68 | 69 | @implementation UIImageView (HighlightedWebCacheDeprecated) 70 | 71 | - (void)setHighlightedImageWithURL:(NSURL *)url { 72 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 73 | } 74 | 75 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options { 76 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 77 | } 78 | 79 | - (void)setHighlightedImageWithURL:(NSURL *)url completed:(SDWebImageCompletedBlock)completedBlock { 80 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 81 | if (completedBlock) { 82 | completedBlock(image, error, cacheType); 83 | } 84 | }]; 85 | } 86 | 87 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock { 88 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 89 | if (completedBlock) { 90 | completedBlock(image, error, cacheType); 91 | } 92 | }]; 93 | } 94 | 95 | - (void)setHighlightedImageWithURL:(NSURL *)url options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletedBlock)completedBlock { 96 | [self sd_setHighlightedImageWithURL:url options:0 progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { 97 | if (completedBlock) { 98 | completedBlock(image, error, cacheType); 99 | } 100 | }]; 101 | } 102 | 103 | - (void)cancelCurrentHighlightedImageLoad { 104 | [self sd_cancelCurrentHighlightedImageLoad]; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @interface UIView (WebCacheOperation) 13 | 14 | /** 15 | * Set the image load operation (storage in a UIView based dictionary) 16 | * 17 | * @param operation the operation 18 | * @param key key for storing the operation 19 | */ 20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key; 21 | 22 | /** 23 | * Cancel all operations for the current UIView and key 24 | * 25 | * @param key key for identifying the operations 26 | */ 27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key; 28 | 29 | /** 30 | * Just remove the operations corresponding to the current UIView and key without cancelling them 31 | * 32 | * @param key key for identifying the operations 33 | */ 34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/Source/TheThird/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | #import "objc/runtime.h" 11 | 12 | static char loadOperationKey; 13 | 14 | @implementation UIView (WebCacheOperation) 15 | 16 | - (NSMutableDictionary *)operationDictionary { 17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 18 | if (operations) { 19 | return operations; 20 | } 21 | operations = [NSMutableDictionary dictionary]; 22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | return operations; 24 | } 25 | 26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key { 27 | [self sd_cancelImageLoadOperationWithKey:key]; 28 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 29 | [operationDictionary setObject:operation forKey:key]; 30 | } 31 | 32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key { 33 | // Cancel in progress downloader from queue 34 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 35 | id operations = [operationDictionary objectForKey:key]; 36 | if (operations) { 37 | if ([operations isKindOfClass:[NSArray class]]) { 38 | for (id operation in operations) { 39 | if (operation) { 40 | [operation cancel]; 41 | } 42 | } 43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 44 | [(id) operations cancel]; 45 | } 46 | [operationDictionary removeObjectForKey:key]; 47 | } 48 | } 49 | 50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key { 51 | NSMutableDictionary *operationDictionary = [self operationDictionary]; 52 | [operationDictionary removeObjectForKey:key]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwu/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ioshuanwu 4 | // 5 | // Created by 幻音 on 15/12/27. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwuTests/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 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwuTests/ioshuanwuTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ioshuanwuTests.m 3 | // ioshuanwuTests 4 | // 5 | // Created by 幻音 on 15/12/27. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ioshuanwuTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ioshuanwuTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwuUITests/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 | -------------------------------------------------------------------------------- /ioshuanwu/ioshuanwuUITests/ioshuanwuUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ioshuanwuUITests.m 3 | // ioshuanwuUITests 4 | // 5 | // Created by 幻音 on 15/12/27. 6 | // Copyright © 2015年 幻音. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ioshuanwuUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ioshuanwuUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // 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. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------