├── .DS_Store
├── App.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ ├── Calvin.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ │ └── zhangdinghao.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── xcuserdata
│ ├── Calvin.xcuserdatad
│ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ │ ├── App.xcscheme
│ │ └── xcschememanagement.plist
│ └── zhangdinghao.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ ├── App.xcscheme
│ └── xcschememanagement.plist
├── App
├── .DS_Store
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── AppIcon40x40@3x-1.png
│ │ ├── AppIcon40x40@3x-2.png
│ │ ├── AppIcon40x40@3x.png
│ │ ├── AppIcon60x60@3x.png
│ │ └── Contents.json
│ ├── Contents.json
│ └── LaunchImage.launchimage
│ │ ├── Contents.json
│ │ ├── LaunchImage-700-568h@2x.png
│ │ ├── LaunchImage-700-Landscape@2x~ipad.png
│ │ ├── LaunchImage-700-Landscape~ipad.png
│ │ ├── LaunchImage-700-Portrait@2x~ipad.png
│ │ ├── LaunchImage-700-Portrait~ipad.png
│ │ ├── LaunchImage-700@2x.png
│ │ ├── LaunchImage-800-667h@2x.png
│ │ └── LaunchImage-800-Portrait-736h@3x.png
├── Base.lproj
│ └── LaunchScreen.storyboard
├── Info.plist
├── Other
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── CustomerNavigation
│ │ ├── CustomNavigationController.h
│ │ ├── CustomNavigationController.m
│ │ ├── UIViewController+CustomNavigationExtension.h
│ │ └── UIViewController+CustomNavigationExtension.m
│ ├── MainView.h
│ ├── MainView.m
│ ├── VideoPlayViewController.h
│ └── VideoPlayViewController.m
├── UI
│ ├── Author
│ │ ├── Controller
│ │ │ ├── AuthorDetailController.h
│ │ │ ├── AuthorDetailController.m
│ │ │ ├── ThreeViewController.h
│ │ │ └── ThreeViewController.m
│ │ ├── Model
│ │ │ ├── AuthorDetailModel.h
│ │ │ ├── AuthorDetailModel.m
│ │ │ ├── AuthorModel.h
│ │ │ └── AuthorModel.m
│ │ └── View
│ │ │ ├── AuthorDetailCell.h
│ │ │ ├── AuthorDetailCell.m
│ │ │ ├── AuthorTableViewCell.h
│ │ │ ├── AuthorTableViewCell.m
│ │ │ └── CustomView
│ │ │ ├── HeadView.h
│ │ │ ├── HeadView.m
│ │ │ ├── NavHeadTitleView.h
│ │ │ └── NavHeadTitleView.m
│ ├── Collection
│ │ ├── Controller
│ │ │ ├── DailyDetailViewController.h
│ │ │ ├── DailyDetailViewController.m
│ │ │ ├── OneViewController.h
│ │ │ └── OneViewController.m
│ │ ├── Model
│ │ │ ├── VideoListModel.h
│ │ │ └── VideoListModel.m
│ │ └── View
│ │ │ ├── VideoListTableViewCell.h
│ │ │ └── VideoListTableViewCell.m
│ ├── Discovery
│ │ ├── Controller
│ │ │ ├── DiscoveryDetailController.h
│ │ │ ├── DiscoveryDetailController.m
│ │ │ ├── PopularViewController.h
│ │ │ ├── PopularViewController.m
│ │ │ ├── ProjectNextViewController.h
│ │ │ ├── ProjectNextViewController.m
│ │ │ ├── ProjectViewController.h
│ │ │ ├── ProjectViewController.m
│ │ │ ├── TwoViewController.h
│ │ │ └── TwoViewController.m
│ │ ├── Model
│ │ │ ├── DiscoveryModel.h
│ │ │ └── DiscoveryModel.m
│ │ └── View
│ │ │ ├── DiscoveryCell.h
│ │ │ ├── DiscoveryCell.m
│ │ │ ├── PopularCell.h
│ │ │ └── PopularCell.m
│ └── Me
│ │ ├── Controller
│ │ ├── FourViewController.h
│ │ ├── FourViewController.m
│ │ ├── LoginViewController.h
│ │ ├── LoginViewController.m
│ │ ├── MeNextViewController.h
│ │ ├── MeNextViewController.m
│ │ ├── UserAgreement.h
│ │ └── UserAgreement.m
│ │ └── View
│ │ ├── MyTableViewCell.h
│ │ └── MyTableViewCell.m
├── lib
│ ├── .DS_Store
│ ├── AFNetworking
│ │ ├── .DS_Store
│ │ ├── AFNetworking
│ │ │ ├── AFHTTPRequestOperation.h
│ │ │ ├── AFHTTPRequestOperation.m
│ │ │ ├── AFHTTPRequestOperationManager.h
│ │ │ ├── AFHTTPRequestOperationManager.m
│ │ │ ├── AFHTTPSessionManager.h
│ │ │ ├── AFHTTPSessionManager.m
│ │ │ ├── AFNetworkReachabilityManager.h
│ │ │ ├── AFNetworkReachabilityManager.m
│ │ │ ├── AFNetworking.h
│ │ │ ├── AFSecurityPolicy.h
│ │ │ ├── AFSecurityPolicy.m
│ │ │ ├── AFURLConnectionOperation.h
│ │ │ ├── AFURLConnectionOperation.m
│ │ │ ├── AFURLRequestSerialization.h
│ │ │ ├── AFURLRequestSerialization.m
│ │ │ ├── AFURLResponseSerialization.h
│ │ │ ├── AFURLResponseSerialization.m
│ │ │ ├── AFURLSessionManager.h
│ │ │ └── AFURLSessionManager.m
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── UIKit+AFNetworking
│ │ │ ├── AFNetworkActivityIndicatorManager.h
│ │ │ ├── AFNetworkActivityIndicatorManager.m
│ │ │ ├── UIActivityIndicatorView+AFNetworking.h
│ │ │ ├── UIActivityIndicatorView+AFNetworking.m
│ │ │ ├── UIAlertView+AFNetworking.h
│ │ │ ├── UIAlertView+AFNetworking.m
│ │ │ ├── UIButton+AFNetworking.h
│ │ │ ├── UIButton+AFNetworking.m
│ │ │ ├── UIImageView+AFNetworking.h
│ │ │ ├── UIImageView+AFNetworking.m
│ │ │ ├── UIKit+AFNetworking.h
│ │ │ ├── UIProgressView+AFNetworking.h
│ │ │ ├── UIProgressView+AFNetworking.m
│ │ │ ├── UIRefreshControl+AFNetworking.h
│ │ │ ├── UIRefreshControl+AFNetworking.m
│ │ │ ├── UIWebView+AFNetworking.h
│ │ │ └── UIWebView+AFNetworking.m
│ ├── CustomShare
│ │ ├── ShareScrollView.h
│ │ ├── ShareScrollView.m
│ │ ├── ShareView.h
│ │ └── ShareView.m
│ ├── Helper
│ │ ├── .DS_Store
│ │ ├── Factory.h
│ │ ├── Factory.m
│ │ ├── HelpViewController.h
│ │ ├── HelpViewController.m
│ │ ├── MyHelper.h
│ │ ├── UIColor+FlatColors.h
│ │ ├── UIColor+FlatColors.m
│ │ ├── UIView+Addition.h
│ │ └── UIView+Addition.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
│ │ │ ├── en.lproj
│ │ │ │ └── Localizable.strings
│ │ │ ├── zh-Hans.lproj
│ │ │ │ └── Localizable.strings
│ │ │ └── zh-Hant.lproj
│ │ │ │ └── Localizable.strings
│ │ ├── MJRefresh.h
│ │ ├── MJRefreshConst.h
│ │ ├── MJRefreshConst.m
│ │ ├── NSBundle+MJRefresh.h
│ │ ├── NSBundle+MJRefresh.m
│ │ ├── UIScrollView+MJExtension.h
│ │ ├── UIScrollView+MJExtension.m
│ │ ├── UIScrollView+MJRefresh.h
│ │ ├── UIScrollView+MJRefresh.m
│ │ ├── UIView+MJExtension.h
│ │ └── UIView+MJExtension.m
│ ├── MyPrefixHeader.pch
│ ├── Net.h
│ ├── Networking.h
│ ├── Networking.m
│ ├── SDWebImage
│ │ ├── 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
│ ├── SVProgressHUD
│ │ ├── SVIndefiniteAnimatedView.h
│ │ ├── SVIndefiniteAnimatedView.m
│ │ ├── SVProgressAnimatedView.h
│ │ ├── SVProgressAnimatedView.m
│ │ ├── SVProgressHUD-Prefix.pch
│ │ ├── SVProgressHUD.bundle
│ │ │ ├── angle-mask.png
│ │ │ ├── angle-mask@2x.png
│ │ │ ├── angle-mask@3x.png
│ │ │ ├── error.png
│ │ │ ├── error@2x.png
│ │ │ ├── error@3x.png
│ │ │ ├── info.png
│ │ │ ├── info@2x.png
│ │ │ ├── info@3x.png
│ │ │ ├── success.png
│ │ │ ├── success@2x.png
│ │ │ └── success@3x.png
│ │ ├── SVProgressHUD.h
│ │ ├── SVProgressHUD.m
│ │ ├── SVRadialGradientLayer.h
│ │ └── SVRadialGradientLayer.m
│ └── XHLaunchAd
│ │ ├── UIButton+XHEnlarged.h
│ │ ├── UIButton+XHEnlarged.m
│ │ ├── UIImage+XHGIF.h
│ │ ├── UIImage+XHGIF.m
│ │ ├── UIImageView+XHWebCache.h
│ │ ├── UIImageView+XHWebCache.m
│ │ ├── XHImageCache.h
│ │ ├── XHImageCache.m
│ │ ├── XHLaunchAd.h
│ │ ├── XHLaunchAd.m
│ │ ├── XHWebImageDownload.h
│ │ └── XHWebImageDownload.m
├── main.m
└── res
│ ├── .DS_Store
│ ├── FZLTXIHJW--GB1-0.TTF
│ ├── FZLTZCHJW--GB1-0.TTF
│ ├── Lobster.ttf
│ ├── Login_BKG.png
│ ├── Splash_BKG.jpg
│ ├── V+.png
│ ├── V-.png
│ ├── audio_AD_close@2x.png
│ ├── audio_AD_close@3x.png
│ ├── backImage@2x.png
│ ├── backImage@3x.png
│ ├── btn_HD_disabled.png
│ ├── btn_HD_disabled@2x.png
│ ├── btn_HD_normal.png
│ ├── btn_HD_normal@2x.png
│ ├── btn_airplay_normal.png
│ ├── btn_back_normal.png
│ ├── btn_back_normal@2x.png
│ ├── btn_backdown_normal@2x.png
│ ├── btn_download_disabled.png
│ ├── btn_download_disabled@2x.png
│ ├── btn_download_normal@2x.png
│ ├── btn_next.png
│ ├── btn_next@2x.png
│ ├── btn_next@3x.png
│ ├── btn_next_iPad.png
│ ├── btn_next_iPad@2x.png
│ ├── btn_pause.png
│ ├── btn_pause@2x.png
│ ├── btn_pause@3x.png
│ ├── btn_pause_iPad.png
│ ├── btn_pause_iPad@2x.png
│ ├── btn_play.png
│ ├── btn_play@2x.png
│ ├── btn_play@3x.png
│ ├── btn_play_iPad.png
│ ├── btn_play_iPad@2x.png
│ ├── collect.png
│ ├── collectSelete.png
│ ├── icon_share_n@2x.png
│ ├── play.png
│ ├── player_handle.png
│ ├── player_handle@2x.png
│ ├── service_terms_chs.html
│ ├── shareView_friend@2x.png
│ ├── shareView_qq@2x.png
│ ├── shareView_qzone@2x.png
│ ├── shareView_wb@2x.png
│ ├── shareView_wx@2x.png
│ ├── share_copyLink@2x.png
│ ├── share_qq@2x.png
│ ├── share_qq_zone@2x.png
│ ├── share_sina_n@2x.png
│ ├── share_weixin@2x.png
│ ├── share_weixin_friends@2x.png
│ ├── toolbar_more_n_p@3x.png
│ ├── upload.png
│ ├── uploadSelete.png
│ └── white.png
├── AppTests
├── AppTests.m
└── Info.plist
├── AppUITests
├── AppUITests.m
└── Info.plist
├── AuthorDetail.gif
├── CustomerNav.gif
├── Play.gif
├── README.md
├── Share.gif
└── Views.gif
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/.DS_Store
--------------------------------------------------------------------------------
/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/App.xcodeproj/project.xcworkspace/xcuserdata/Calvin.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App.xcodeproj/project.xcworkspace/xcuserdata/Calvin.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/App.xcodeproj/project.xcworkspace/xcuserdata/zhangdinghao.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App.xcodeproj/project.xcworkspace/xcuserdata/zhangdinghao.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/App.xcodeproj/xcuserdata/Calvin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/App.xcodeproj/xcuserdata/Calvin.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | App.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 9221A4A61D7D236B00C76C73
16 |
17 | primary
18 |
19 |
20 | 9221A4B91D7D236B00C76C73
21 |
22 | primary
23 |
24 |
25 | 9221A4C41D7D236B00C76C73
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/App.xcodeproj/xcuserdata/zhangdinghao.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/App.xcodeproj/xcuserdata/zhangdinghao.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | App.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 9221A4A61D7D236B00C76C73
16 |
17 | primary
18 |
19 |
20 | 9221A4B91D7D236B00C76C73
21 |
22 | primary
23 |
24 |
25 | 9221A4C41D7D236B00C76C73
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/App/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/.DS_Store
--------------------------------------------------------------------------------
/App/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@3x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@3x-1.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@3x-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@3x-2.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@3x.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@3x.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "29x29",
26 | "scale" : "3x"
27 | },
28 | {
29 | "size" : "40x40",
30 | "idiom" : "iphone",
31 | "filename" : "AppIcon40x40@3x-1.png",
32 | "scale" : "2x"
33 | },
34 | {
35 | "size" : "40x40",
36 | "idiom" : "iphone",
37 | "filename" : "AppIcon40x40@3x.png",
38 | "scale" : "3x"
39 | },
40 | {
41 | "size" : "60x60",
42 | "idiom" : "iphone",
43 | "filename" : "AppIcon40x40@3x-2.png",
44 | "scale" : "2x"
45 | },
46 | {
47 | "size" : "60x60",
48 | "idiom" : "iphone",
49 | "filename" : "AppIcon60x60@3x.png",
50 | "scale" : "3x"
51 | },
52 | {
53 | "idiom" : "ipad",
54 | "size" : "20x20",
55 | "scale" : "1x"
56 | },
57 | {
58 | "idiom" : "ipad",
59 | "size" : "20x20",
60 | "scale" : "2x"
61 | },
62 | {
63 | "idiom" : "ipad",
64 | "size" : "29x29",
65 | "scale" : "1x"
66 | },
67 | {
68 | "idiom" : "ipad",
69 | "size" : "29x29",
70 | "scale" : "2x"
71 | },
72 | {
73 | "idiom" : "ipad",
74 | "size" : "40x40",
75 | "scale" : "1x"
76 | },
77 | {
78 | "idiom" : "ipad",
79 | "size" : "40x40",
80 | "scale" : "2x"
81 | },
82 | {
83 | "idiom" : "ipad",
84 | "size" : "76x76",
85 | "scale" : "1x"
86 | },
87 | {
88 | "idiom" : "ipad",
89 | "size" : "76x76",
90 | "scale" : "2x"
91 | },
92 | {
93 | "idiom" : "ipad",
94 | "size" : "83.5x83.5",
95 | "scale" : "2x"
96 | },
97 | {
98 | "idiom" : "car",
99 | "size" : "60x60",
100 | "scale" : "2x"
101 | },
102 | {
103 | "idiom" : "car",
104 | "size" : "60x60",
105 | "scale" : "3x"
106 | },
107 | {
108 | "size" : "24x24",
109 | "idiom" : "watch",
110 | "scale" : "2x",
111 | "role" : "notificationCenter",
112 | "subtype" : "38mm"
113 | },
114 | {
115 | "size" : "27.5x27.5",
116 | "idiom" : "watch",
117 | "scale" : "2x",
118 | "role" : "notificationCenter",
119 | "subtype" : "42mm"
120 | },
121 | {
122 | "size" : "29x29",
123 | "idiom" : "watch",
124 | "role" : "companionSettings",
125 | "scale" : "2x"
126 | },
127 | {
128 | "size" : "29x29",
129 | "idiom" : "watch",
130 | "role" : "companionSettings",
131 | "scale" : "3x"
132 | },
133 | {
134 | "size" : "40x40",
135 | "idiom" : "watch",
136 | "scale" : "2x",
137 | "role" : "appLauncher",
138 | "subtype" : "38mm"
139 | },
140 | {
141 | "size" : "86x86",
142 | "idiom" : "watch",
143 | "scale" : "2x",
144 | "role" : "quickLook",
145 | "subtype" : "38mm"
146 | },
147 | {
148 | "size" : "98x98",
149 | "idiom" : "watch",
150 | "scale" : "2x",
151 | "role" : "quickLook",
152 | "subtype" : "42mm"
153 | }
154 | ],
155 | "info" : {
156 | "version" : 1,
157 | "author" : "xcode"
158 | }
159 | }
--------------------------------------------------------------------------------
/App/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/App/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "scale" : "1x"
8 | },
9 | {
10 | "orientation" : "portrait",
11 | "idiom" : "iphone",
12 | "filename" : "LaunchImage-700@2x.png",
13 | "extent" : "full-screen",
14 | "scale" : "2x"
15 | },
16 | {
17 | "orientation" : "portrait",
18 | "idiom" : "iphone",
19 | "extent" : "full-screen",
20 | "subtype" : "retina4",
21 | "scale" : "2x"
22 | },
23 | {
24 | "orientation" : "landscape",
25 | "idiom" : "ipad",
26 | "filename" : "LaunchImage-700-Landscape~ipad.png",
27 | "extent" : "full-screen",
28 | "scale" : "1x"
29 | },
30 | {
31 | "orientation" : "landscape",
32 | "idiom" : "ipad",
33 | "filename" : "LaunchImage-700-Landscape@2x~ipad.png",
34 | "extent" : "full-screen",
35 | "scale" : "2x"
36 | },
37 | {
38 | "extent" : "full-screen",
39 | "idiom" : "iphone",
40 | "subtype" : "736h",
41 | "filename" : "LaunchImage-800-Portrait-736h@3x.png",
42 | "minimum-system-version" : "8.0",
43 | "orientation" : "portrait",
44 | "scale" : "3x"
45 | },
46 | {
47 | "orientation" : "landscape",
48 | "idiom" : "iphone",
49 | "extent" : "full-screen",
50 | "minimum-system-version" : "8.0",
51 | "subtype" : "736h",
52 | "scale" : "3x"
53 | },
54 | {
55 | "extent" : "full-screen",
56 | "idiom" : "iphone",
57 | "subtype" : "667h",
58 | "filename" : "LaunchImage-800-667h@2x.png",
59 | "minimum-system-version" : "8.0",
60 | "orientation" : "portrait",
61 | "scale" : "2x"
62 | },
63 | {
64 | "orientation" : "portrait",
65 | "idiom" : "iphone",
66 | "extent" : "full-screen",
67 | "minimum-system-version" : "7.0",
68 | "scale" : "2x"
69 | },
70 | {
71 | "extent" : "full-screen",
72 | "idiom" : "iphone",
73 | "subtype" : "retina4",
74 | "filename" : "LaunchImage-700-568h@2x.png",
75 | "minimum-system-version" : "7.0",
76 | "orientation" : "portrait",
77 | "scale" : "2x"
78 | },
79 | {
80 | "orientation" : "portrait",
81 | "idiom" : "ipad",
82 | "filename" : "LaunchImage-700-Portrait~ipad.png",
83 | "extent" : "full-screen",
84 | "minimum-system-version" : "7.0",
85 | "scale" : "1x"
86 | },
87 | {
88 | "orientation" : "portrait",
89 | "idiom" : "ipad",
90 | "filename" : "LaunchImage-700-Portrait@2x~ipad.png",
91 | "extent" : "full-screen",
92 | "minimum-system-version" : "7.0",
93 | "scale" : "2x"
94 | }
95 | ],
96 | "info" : {
97 | "version" : 1,
98 | "author" : "xcode"
99 | }
100 | }
--------------------------------------------------------------------------------
/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-568h@2x.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-Landscape~ipad.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-Portrait~ipad.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700@2x.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-667h@2x.png
--------------------------------------------------------------------------------
/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-Portrait-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-Portrait-736h@3x.png
--------------------------------------------------------------------------------
/App/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/App/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 | 开眼
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 | UIAppFonts
31 |
32 | Lobster.ttf
33 | Lobster_1.3.otf
34 | Lobster 1.4.otf
35 | FZLTXIHJW--GB1-0.TTF
36 | FZLTZCHJW--GB1-0.TTF
37 |
38 | UIRequiredDeviceCapabilities
39 |
40 | armv7
41 |
42 | UISupportedInterfaceOrientations
43 |
44 | UIInterfaceOrientationPortrait
45 | UIInterfaceOrientationLandscapeRight
46 | UIInterfaceOrientationLandscapeLeft
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/App/Other/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface AppDelegate : UIResponder
15 |
16 | @property (strong, nonatomic) UIWindow *window;
17 |
18 |
19 | @end
20 |
21 |
--------------------------------------------------------------------------------
/App/Other/CustomerNavigation/CustomNavigationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CustomNavigationController.h
3 | // CustomTransitions
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 CalvinCheung. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface CustomWrapViewController : UIViewController
15 |
16 | @property (nonatomic, strong, readonly) UIViewController *rootViewController;
17 |
18 | + (CustomWrapViewController *)wrapViewControllerWithViewController:(UIViewController *)viewController;
19 |
20 | @end
21 |
22 | @interface CustomNavigationController : UINavigationController
23 |
24 | @property (nonatomic, strong) UIImage *backButtonImage;
25 |
26 | @property (nonatomic, assign) BOOL fullScreenPopGestureEnabled;
27 |
28 | @property (nonatomic, copy, readonly) NSArray *Custom_viewControllers;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/App/Other/CustomerNavigation/UIViewController+CustomNavigationExtension.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+CustomNavigationExtension.h
3 | // CustomTransitions
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 CalvinCheung. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 | #import "CustomNavigationController.h"
14 |
15 | @interface UIViewController (CustomNavigationExtension)
16 |
17 | @property (nonatomic, assign) BOOL Custom_fullScreenPopGestureEnabled;
18 |
19 | @property (nonatomic, weak) CustomNavigationController *Custom_navigationController;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/App/Other/CustomerNavigation/UIViewController+CustomNavigationExtension.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+CustomNavigationExtension.m
3 | // CustomTransitions
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 CalvinCheung. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "UIViewController+CustomNavigationExtension.h"
13 | #import
14 |
15 |
16 | @implementation UIViewController (CustomNavigationExtension)
17 |
18 | - (BOOL)Custom_fullScreenPopGestureEnabled {
19 | return [objc_getAssociatedObject(self, _cmd) boolValue];
20 | }
21 |
22 | - (void)setCustom_fullScreenPopGestureEnabled:(BOOL)fullScreenPopGestureEnabled {
23 | objc_setAssociatedObject(self, @selector(Custom_fullScreenPopGestureEnabled), @(fullScreenPopGestureEnabled), OBJC_ASSOCIATION_RETAIN);
24 | }
25 |
26 | - (CustomNavigationController *)Custom_navigationController {
27 | return objc_getAssociatedObject(self, _cmd);
28 | }
29 |
30 | - (void)setCustom_navigationController:(CustomNavigationController *)navigationController {
31 | objc_setAssociatedObject(self, @selector(Custom_navigationController), navigationController, OBJC_ASSOCIATION_ASSIGN);
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/App/Other/MainView.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainView.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface MainView : UITabBarController
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/Other/MainView.m:
--------------------------------------------------------------------------------
1 | //
2 | // MainView.m
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "MainView.h"
13 | #import "OneViewController.h"
14 | #import "TwoViewController.h"
15 | #import "ThreeViewController.h"
16 | #import "FourViewController.h"
17 | #import "MyHelper.h"
18 | #import "CustomNavigationController.h"
19 |
20 | @interface MainView ()
21 |
22 | @property (nonatomic,strong)NSArray *Arrs;
23 |
24 | @end
25 |
26 | @implementation MainView
27 |
28 | - (BOOL)shouldAutorotate//是否支持旋转屏幕
29 | {
30 | return YES;
31 | }
32 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations//支持哪些方向
33 | {
34 | return UIInterfaceOrientationMaskPortrait;
35 | }
36 | - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation//默认显示的方向
37 | {
38 | return UIInterfaceOrientationPortrait;
39 | }
40 |
41 | - (void)viewDidLoad {
42 | [super viewDidLoad];
43 | // Do any additional setup after loading the view.
44 |
45 | //创建子控制器
46 | [self createSubViewControllers];
47 | //设置所有的、分栏元素项
48 | [self setTabBarItems];
49 | }
50 |
51 | - (void)createSubViewControllers{
52 |
53 | OneViewController *One = [[OneViewController alloc]init];
54 | CustomNavigationController *navi = [[CustomNavigationController alloc]initWithRootViewController:One];
55 | navi.fullScreenPopGestureEnabled = YES;
56 |
57 | TwoViewController *Two = [[TwoViewController alloc]init];
58 | CustomNavigationController *navitwo = [[CustomNavigationController alloc]initWithRootViewController:Two];
59 | navitwo.fullScreenPopGestureEnabled = YES;
60 |
61 | ThreeViewController *Three = [[ThreeViewController alloc]init];
62 | CustomNavigationController *navithree = [[CustomNavigationController alloc]initWithRootViewController:Three];
63 | navithree.fullScreenPopGestureEnabled = YES;
64 |
65 | FourViewController *Four = [[FourViewController alloc]init];
66 | CustomNavigationController *naviFour = [[CustomNavigationController alloc]initWithRootViewController:Four];
67 | naviFour.fullScreenPopGestureEnabled = YES;
68 |
69 | self.viewControllers = @[navi,navitwo,navithree,naviFour];
70 | }
71 |
72 | - (void)setTabBarItems{
73 |
74 | NSArray *titleArr = @[@"精选",@"发现",@"作者",@"我的"];
75 | NSArray *normalImgArr = @[@"ali1",@"011",@"win1",@"my1"];
76 | NSArray *selectedImgArr = @[@"aliSelete1",@"01Selete1",@"winSelete1",@"mySelete1"];
77 | //循环设置信息
78 | for (int i = 0; i<4; i++) {
79 | UIViewController *vc = self.viewControllers[i];
80 | vc.tabBarItem = [[UITabBarItem alloc]initWithTitle:titleArr[i] image:[UIImage imageNamed:normalImgArr[i]] selectedImage:[[UIImage imageNamed:selectedImgArr[i]]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ]];
81 | vc.tabBarItem.tag = i;
82 | }
83 |
84 | [[UITabBarItem appearance]setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]} forState:UIControlStateSelected];
85 |
86 | //self.navigationController.navigationBar 这个的话会有一个专题改不了,所以这用最高权限
87 | //获取导航条最高权限
88 | [[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20]}];
89 | }
90 |
91 |
92 | @end
93 |
--------------------------------------------------------------------------------
/App/Other/VideoPlayViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoPlayViewController.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface VideoPlayViewController : UIViewController
15 |
16 | // 视频地址
17 | @property(nonatomic,strong) NSString *UrlString;
18 | // 视频标题
19 | @property(nonatomic,strong) NSString *titleStr;
20 | // 视频时长
21 | @property(nonatomic, assign) double duration;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/App/UI/Author/Controller/AuthorDetailController.h:
--------------------------------------------------------------------------------
1 | //
2 | // AuthorDetailController.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface AuthorDetailController : UIViewController
15 |
16 | @property (nonatomic, copy) NSString *authorId;
17 |
18 | // 作者信息
19 | @property (nonatomic, copy) NSString *authorName;
20 |
21 | @property (nonatomic, copy) NSString *authorDesc;
22 |
23 | @property (nonatomic, copy) NSString *authorIcon;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/App/UI/Author/Controller/ThreeViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ThreeViewController.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface ThreeViewController : UIViewController
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/UI/Author/Model/AuthorDetailModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // AuthorDetailModel.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface AuthorDetailModel : NSObject
15 |
16 | /** 图片 */
17 | @property (nonatomic, copy) NSString *ImageView;
18 |
19 | @property (nonatomic, copy) NSString *shadeView;
20 |
21 | /** 标题 */
22 | @property (nonatomic, copy) NSString *titleLabel;
23 |
24 | @property (nonatomic, copy) NSString *category;
25 |
26 | @property (nonatomic, copy) NSString *duration;
27 |
28 | @property (nonatomic, copy) NSString *desc;
29 |
30 | @property (nonatomic, copy) NSDictionary *consumption;
31 |
32 | @property (nonatomic, copy) NSString *playUrl;
33 |
34 | @property (nonatomic, copy) NSString *actionUrl;
35 |
36 |
37 | // 作者信息
38 | @property (nonatomic, copy) NSString *authorName;
39 |
40 | @property (nonatomic, copy) NSString *authorDesc;
41 |
42 | @property (nonatomic, copy) NSString *authorIcon;
43 |
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/App/UI/Author/Model/AuthorDetailModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // AuthorDetailModel.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "AuthorDetailModel.h"
13 |
14 | @implementation AuthorDetailModel
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/UI/Author/Model/AuthorModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // AuthorModel.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface AuthorModel : NSObject
15 |
16 | // icon
17 | @property (nonatomic, copy) NSString *iconImage;
18 | // 作者
19 | @property (nonatomic, copy) NSString *authorLabel;
20 | // 视频数量
21 | @property (nonatomic, copy) NSString *videoCount;
22 | // 简介
23 | @property (nonatomic, copy) NSString *desLabel;
24 | // ID
25 | @property (nonatomic, copy) NSString *authorId;
26 | // actionUrl
27 | @property (nonatomic, copy) NSString *actionUrl;
28 |
29 | + (instancetype)tgWithDict:(NSDictionary *)dict;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/App/UI/Author/Model/AuthorModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // AuthorModel.m
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "AuthorModel.h"
13 |
14 | @implementation AuthorModel
15 |
16 | + (instancetype)tgWithDict:(NSDictionary *)dict
17 | {
18 | AuthorModel *author = [[self alloc] init];
19 | [author setValuesForKeysWithDictionary:dict];
20 | return author;
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/App/UI/Author/View/AuthorDetailCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // AuthorDetailCell.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface AuthorDetailCell : UITableViewCell
15 |
16 | /** 图片 */
17 | @property (nonatomic, weak) UIImageView *ImageView;
18 |
19 | @property (nonatomic, weak) UIImageView *shadeView;
20 |
21 | /** 标题 */
22 | @property (nonatomic, weak) UILabel *titleLabel;
23 |
24 | /** Message */
25 | @property (nonatomic, weak) UILabel *messageLabel;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/App/UI/Author/View/AuthorDetailCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // AuthorDetailCell.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "AuthorDetailCell.h"
13 |
14 | @implementation AuthorDetailCell
15 |
16 | // 在这个方法中添加所有的子控件
17 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
18 | {
19 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
20 |
21 | UIImageView *image = [[UIImageView alloc] init];
22 | [self.contentView addSubview:image];
23 | self.ImageView = image;
24 |
25 | UIImageView *shadeView = [[UIImageView alloc]init];
26 | shadeView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.4];
27 | self.shadeView = shadeView;
28 | [image addSubview:self.shadeView];
29 |
30 |
31 | UILabel *titleLabel = [[UILabel alloc] init];
32 | titleLabel.textColor = [UIColor whiteColor];
33 | titleLabel.font = [UIFont fontWithName:MyChinFont size:15.f];
34 | titleLabel.textAlignment = NSTextAlignmentCenter;
35 | [self.contentView addSubview:titleLabel];
36 | self.titleLabel = titleLabel;
37 |
38 | UILabel *messageLabel = [[UILabel alloc] init];
39 | messageLabel.textColor = [UIColor whiteColor];
40 | messageLabel.font = [UIFont systemFontOfSize:12.f];
41 | messageLabel.textAlignment = NSTextAlignmentCenter;
42 | [self.contentView addSubview:messageLabel];
43 | self.messageLabel = messageLabel;
44 | }
45 | return self;
46 | }
47 |
48 | // 设置所有的子控件的frame
49 | - (void)layoutSubviews
50 | {
51 | [super layoutSubviews];
52 |
53 | self.ImageView.frame = self.bounds;
54 |
55 | self.shadeView.frame = self.bounds;
56 |
57 | /** 标题 */
58 | self.titleLabel.frame = CGRectMake(5, self.bounds.size.height/2 - 20, self.bounds.size.width - 10, 30);
59 |
60 | /** 信息 */
61 | self.messageLabel.frame = CGRectMake(0, _titleLabel.bottom + 5, _titleLabel.width, 25);
62 | }
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/App/UI/Author/View/AuthorTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // AuthorTableViewCell.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface AuthorTableViewCell : UITableViewCell
15 |
16 | // icon
17 | @property (nonatomic, strong) UIImageView *iconImage;
18 | // 作者
19 | @property (nonatomic, strong) UILabel *authorLabel;
20 | // 视频数量
21 | @property (nonatomic, strong) UILabel *videoCount;
22 | // 简介
23 | @property (nonatomic, strong) UILabel *desLabel;
24 |
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/App/UI/Author/View/AuthorTableViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // AuthorTableViewCell.m
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "AuthorTableViewCell.h"
13 |
14 | @implementation AuthorTableViewCell
15 |
16 | // 在这个方法中添加所有的子控件
17 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
18 | {
19 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
20 |
21 | UIImageView *image = [[UIImageView alloc] init];
22 | [self.contentView addSubview:image];
23 | self.iconImage = image;
24 |
25 | UILabel *authorLabel = [[UILabel alloc] init];
26 | authorLabel.textColor = [UIColor blackColor];
27 | authorLabel.font = [UIFont fontWithName:MyChinFont size:14.f];
28 | authorLabel.textAlignment = NSTextAlignmentLeft;
29 | [self.contentView addSubview:authorLabel];
30 | self.authorLabel = authorLabel;
31 |
32 | UILabel *videoCount = [[UILabel alloc] init];
33 | videoCount.textColor = [UIColor darkGrayColor];
34 | videoCount.font = [UIFont systemFontOfSize:10.f];
35 | videoCount.textAlignment = NSTextAlignmentLeft;
36 | [self.contentView addSubview:videoCount];
37 | self.videoCount = videoCount;
38 |
39 | UILabel *desLabel = [[UILabel alloc] init];
40 | desLabel.textColor = [UIColor darkGrayColor];
41 | desLabel.font = [UIFont systemFontOfSize:12.f];
42 | desLabel.textAlignment = NSTextAlignmentLeft;
43 | [self.contentView addSubview:desLabel];
44 | self.desLabel = desLabel;
45 | }
46 | return self;
47 | }
48 |
49 | // 设置所有的子控件的frame
50 | - (void)layoutSubviews
51 | {
52 | [super layoutSubviews];
53 |
54 | self.iconImage.frame = CGRectMake(10, 15, 40, 40);
55 | self.iconImage.layer.cornerRadius = 20;
56 | self.iconImage.layer.masksToBounds = YES;
57 |
58 | self.authorLabel.frame = CGRectMake(60, 15, self.width - 100, 20);
59 |
60 | // self.videoCount.frame = CGRectMake(_authorLabel.right + 3, _authorLabel.top, 60, 20);
61 |
62 | self.desLabel.frame = CGRectMake(_authorLabel.left, _authorLabel.bottom + 5, self.bounds.size.width - 90, 20);
63 | }
64 |
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/App/UI/Author/View/CustomView/HeadView.h:
--------------------------------------------------------------------------------
1 | //
2 | // HeadView.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface HeadView : UIView
15 |
16 | @property (nonatomic, copy) NSString *imageUrl;
17 |
18 | @property (nonatomic, copy) NSString *name;
19 |
20 | @property (nonatomic, copy) NSString *content;
21 |
22 | @property (nonatomic, strong) UIImageView *imageView;
23 |
24 | @property (nonatomic, strong) UILabel *NameLab;
25 |
26 | @property (nonatomic, strong) UILabel *contentLab;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/App/UI/Author/View/CustomView/HeadView.m:
--------------------------------------------------------------------------------
1 | //
2 | // HeadView.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "HeadView.h"
13 |
14 | @implementation HeadView
15 |
16 | -(instancetype)initWithFrame:(CGRect)frame
17 | {
18 | if (self = [super initWithFrame:frame]) {
19 | self.backgroundColor = [UIColor clearColor];
20 | self.imageView = [[UIImageView alloc]init];
21 | self.imageView.frame = CGRectMake(ScreenWidth/2 - 30, 30, 60, 60);
22 | self.imageView.layer.masksToBounds = YES;
23 | self.imageView.layer.cornerRadius = 30;
24 | [self addSubview:self.imageView];
25 |
26 | self.NameLab = [[UILabel alloc]init];
27 | self.NameLab.textAlignment = NSTextAlignmentCenter;
28 | self.NameLab.textColor = [UIColor blackColor];
29 | self.NameLab.font = [UIFont boldSystemFontOfSize:14.0f];
30 | self.NameLab.frame = CGRectMake(20, self.imageView.bottom + 10, ScreenWidth - 40, 20);
31 | [self addSubview:self.NameLab];
32 |
33 | self.contentLab = [[UILabel alloc]init];
34 | self.contentLab.frame = CGRectMake(20, self.NameLab.bottom + 5, ScreenWidth - 40, 50);
35 | self.contentLab.textAlignment = NSTextAlignmentCenter;
36 | self.contentLab.textColor = [UIColor darkGrayColor];
37 | self.contentLab.font = [UIFont systemFontOfSize:12.0f];
38 | self.contentLab.numberOfLines = 0;
39 | [self addSubview:self.contentLab];
40 | }
41 | return self;
42 | }
43 |
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/App/UI/Author/View/CustomView/NavHeadTitleView.h:
--------------------------------------------------------------------------------
1 | //
2 | // NavHeadTitleView.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @protocol NavHeadTitleViewDelegate
15 |
16 | @optional
17 |
18 | - (void)NavHeadback;
19 | - (void)NavHeadToRight;
20 |
21 | @end
22 |
23 | @interface NavHeadTitleView : UIView
24 |
25 | @property (nonatomic, assign) iddelegate;
26 |
27 | @property (nonatomic, strong) UIImageView *headBgView;
28 |
29 | @property (nonatomic, copy) NSString *title;
30 |
31 | @property (nonatomic, strong) UIColor *color;
32 |
33 | @property (nonatomic, copy) NSString *backTitleImage;
34 |
35 | @property (nonatomic, copy) NSString *rightImageView;
36 |
37 | @property (nonatomic, copy) NSString *rightTitleImage;
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/App/UI/Collection/Controller/DailyDetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DailyDetailViewController.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 | #import "VideoListModel.h"
14 |
15 | @interface DailyDetailViewController : UIViewController
16 |
17 | @property (nonatomic, strong) VideoListModel *model;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/App/UI/Collection/Controller/OneViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // OneViewController.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface OneViewController : UIViewController
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/UI/Collection/Model/VideoListModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoListModel.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface VideoListModel : NSObject
15 |
16 | /** 图片 */
17 | @property (nonatomic, copy) NSString *ImageView;
18 |
19 | @property (nonatomic, copy) NSString *shadeView;
20 |
21 | /** 标题 */
22 | @property (nonatomic, copy) NSString *titleLabel;
23 |
24 | @property (nonatomic, copy) NSString *category;
25 |
26 | @property (nonatomic, copy) NSString *duration;
27 |
28 | @property (nonatomic, copy) NSString *desc;
29 |
30 | @property (nonatomic, copy) NSDictionary *consumption;
31 |
32 | @property (nonatomic, copy) NSString *playUrl;
33 |
34 | @property (nonatomic, copy) NSString *actionUrl;
35 |
36 | @property (nonatomic, copy) NSString *idStr;
37 |
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/App/UI/Collection/Model/VideoListModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // VideoListModel.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "VideoListModel.h"
13 |
14 | @implementation VideoListModel
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/UI/Collection/View/VideoListTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoListTableViewCell.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface VideoListTableViewCell : UITableViewCell
15 |
16 | /** 图片 */
17 | @property (nonatomic, weak) UIImageView *ImageView;
18 |
19 | @property (nonatomic, weak) UIImageView *shadeView;
20 |
21 | /** 标题 */
22 | @property (nonatomic, weak) UILabel *titleLabel;
23 |
24 | /** Message */
25 | @property (nonatomic, weak) UILabel *messageLabel;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/App/UI/Collection/View/VideoListTableViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // VideoListTableViewCell.m
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "VideoListTableViewCell.h"
13 |
14 | @implementation VideoListTableViewCell
15 |
16 | // 在这个方法中添加所有的子控件
17 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
18 | {
19 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
20 |
21 | UIImageView *image = [[UIImageView alloc] init];
22 | [self.contentView addSubview:image];
23 | self.ImageView = image;
24 |
25 | UIImageView *shadeView = [[UIImageView alloc]init];
26 | shadeView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.4];
27 | self.shadeView = shadeView;
28 | [image addSubview:self.shadeView];
29 |
30 |
31 | UILabel *titleLabel = [[UILabel alloc] init];
32 | titleLabel.textColor = [UIColor whiteColor];
33 | titleLabel.font = [UIFont fontWithName:MyChinFont size:15.f];
34 | titleLabel.textAlignment = NSTextAlignmentCenter;
35 | [self.contentView addSubview:titleLabel];
36 | self.titleLabel = titleLabel;
37 |
38 | UILabel *messageLabel = [[UILabel alloc] init];
39 | messageLabel.textColor = [UIColor whiteColor];
40 | messageLabel.font = [UIFont systemFontOfSize:12.f];
41 | messageLabel.textAlignment = NSTextAlignmentCenter;
42 | [self.contentView addSubview:messageLabel];
43 | self.messageLabel = messageLabel;
44 | }
45 | return self;
46 | }
47 |
48 | // 设置所有的子控件的frame
49 | - (void)layoutSubviews
50 | {
51 | [super layoutSubviews];
52 |
53 | self.ImageView.frame = self.bounds;
54 |
55 | self.shadeView.frame = self.bounds;
56 |
57 | /** 标题 */
58 | self.titleLabel.frame = CGRectMake(5, self.bounds.size.height/2 - 20, self.bounds.size.width - 10, 30);
59 |
60 | /** 信息 */
61 | self.messageLabel.frame = CGRectMake(0, _titleLabel.bottom + 5, _titleLabel.width, 25);
62 | }
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/App/UI/Discovery/Controller/DiscoveryDetailController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DiscoveryDetailController.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 | #import "NavHeadTitleView.h"
14 |
15 | @interface DiscoveryDetailController : UIViewController
16 |
17 | @property (nonatomic, copy) NSString *actionUrl;
18 |
19 | @property (nonatomic, copy) NSString *pageTitle;
20 |
21 | @property (nonatomic, copy) NSString *NextPageStr;
22 |
23 | @property (nonatomic, strong) UITableView *tableView;
24 |
25 | @property (nonatomic, strong) NSMutableArray *ListArr;
26 |
27 | @property (nonatomic, strong) UILabel *topLine;
28 |
29 | @property (nonatomic, strong) UILabel *line;
30 |
31 | @property (nonatomic, strong) UIButton *seleBtn;
32 |
33 | @property (nonatomic, copy) NSString *RequestUrl;
34 |
35 | @property (nonatomic, copy) NSString *idStr;
36 |
37 | @property (nonatomic, copy) NSString *ReqId;
38 |
39 | @property (nonatomic, strong) NavHeadTitleView *NavView;
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/App/UI/Discovery/Controller/PopularViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // PopularViewController.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface PopularViewController : UIViewController
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/UI/Discovery/Controller/ProjectNextViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ProjectNextViewController.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/10/2.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 | #import "VideoListModel.h"
14 |
15 | @interface ProjectNextViewController : UIViewController
16 |
17 | @property (nonatomic, strong) VideoListModel *model;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/App/UI/Discovery/Controller/ProjectViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ProjectViewController.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface ProjectViewController : UIViewController
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/UI/Discovery/Controller/TwoViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // TwoViewController.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface TwoViewController : UIViewController
15 |
16 | @property (nonatomic, strong) UICollectionView *collectionView;
17 | @property (nonatomic, strong) NSIndexPath *currentIndexPath;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/App/UI/Discovery/Model/DiscoveryModel.h:
--------------------------------------------------------------------------------
1 | //
2 | // DiscoveryModel.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface DiscoveryModel : NSObject
15 |
16 | @property (nonatomic, copy) NSString *actionUrl;
17 | @property (nonatomic, copy) NSString *dataType;
18 | @property (nonatomic, copy) NSString *image;
19 | @property (nonatomic, copy) NSString *title;
20 | @property (nonatomic, copy) NSString *IdStr;
21 |
22 | /*
23 |
24 | actionUrl = "eyepetizer://ranklist/";
25 | adTrack = "";
26 | dataType = SquareCard;
27 | id = "-1";
28 | image = "http://img.wdjimg.com/image/video/46360c61d96fef74a776b3db1e221db7_0_0.jpeg";
29 | shade = 0;
30 | title = "";
31 |
32 | */
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/App/UI/Discovery/Model/DiscoveryModel.m:
--------------------------------------------------------------------------------
1 | //
2 | // DiscoveryModel.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "DiscoveryModel.h"
13 |
14 | @implementation DiscoveryModel
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/UI/Discovery/View/DiscoveryCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // DiscoveryCell.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface DiscoveryCell : UICollectionViewCell
15 |
16 | /** 图片 */
17 | @property (nonatomic, strong) UIImageView *ImageView;
18 |
19 | @property (nonatomic, strong) UIImageView *shadeView;
20 |
21 | /** 标题 */
22 | @property (nonatomic, strong) UILabel *titleLabel;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/App/UI/Discovery/View/DiscoveryCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // DiscoveryCell.m
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "DiscoveryCell.h"
13 |
14 | @interface DiscoveryCell()
15 |
16 | @end
17 |
18 | @implementation DiscoveryCell
19 |
20 | - (id)initWithFrame:(CGRect)frame
21 | {
22 | self = [super initWithFrame:frame];
23 | if (self)
24 | {
25 | _ImageView = [[UIImageView alloc] initWithFrame:self.bounds];
26 | _ImageView.backgroundColor = [UIColor grayColor];
27 | [self.contentView addSubview:_ImageView];
28 |
29 | _shadeView = [[UIImageView alloc]initWithFrame:self.bounds];
30 | _shadeView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.3];
31 | [self.contentView addSubview:_shadeView];
32 |
33 | _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.bounds.size.height/2-20, self.bounds.size.width, 40)];
34 | _titleLabel.textAlignment = NSTextAlignmentCenter;
35 | _titleLabel.textColor = [UIColor whiteColor];
36 | _titleLabel.font = [UIFont fontWithName:MyChinFont size:16.f];
37 | [self.contentView addSubview:_titleLabel];
38 | }
39 | return self;
40 | }
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/App/UI/Discovery/View/PopularCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // PopularCell.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface PopularCell : UITableViewCell
15 |
16 | /** 图片 */
17 | @property (nonatomic, weak) UIImageView *ImageView;
18 |
19 | @property (nonatomic, weak) UIImageView *shadeView;
20 |
21 | /** 标题 */
22 | @property (nonatomic, weak) UILabel *titleLabel;
23 |
24 | /** Message */
25 | @property (nonatomic, weak) UILabel *messageLabel;
26 |
27 | @property (nonatomic, weak) UILabel *indexLabel;
28 |
29 | @property (nonatomic, weak) UIButton *topLine;
30 |
31 | @property (nonatomic, weak) UIButton *bottomLine;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/App/UI/Discovery/View/PopularCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // PopularCell.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/30.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "PopularCell.h"
13 |
14 | @implementation PopularCell
15 |
16 | // 在这个方法中添加所有的子控件
17 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
18 | {
19 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
20 |
21 | UIImageView *image = [[UIImageView alloc] init];
22 | [self.contentView addSubview:image];
23 | self.ImageView = image;
24 |
25 | UIImageView *shadeView = [[UIImageView alloc]init];
26 | shadeView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.4];
27 | self.shadeView = shadeView;
28 | [image addSubview:self.shadeView];
29 |
30 |
31 | UILabel *titleLabel = [[UILabel alloc] init];
32 | titleLabel.textColor = [UIColor whiteColor];
33 | titleLabel.font = [UIFont fontWithName:MyChinFont size:14.f];
34 | titleLabel.textAlignment = NSTextAlignmentCenter;
35 | [self.contentView addSubview:titleLabel];
36 | self.titleLabel = titleLabel;
37 |
38 | UILabel *messageLabel = [[UILabel alloc] init];
39 | messageLabel.textColor = [UIColor whiteColor];
40 | messageLabel.font = [UIFont systemFontOfSize:12.f];
41 | messageLabel.textAlignment = NSTextAlignmentCenter;
42 | [self.contentView addSubview:messageLabel];
43 | self.messageLabel = messageLabel;
44 |
45 | UILabel *index = [[UILabel alloc] init];
46 | index.textColor = [UIColor whiteColor];
47 | index.font = [UIFont fontWithName:MyEnFontTwo size:12];
48 | index.textAlignment = NSTextAlignmentCenter;
49 | [self.contentView addSubview:index];
50 | self.indexLabel = index;
51 |
52 | UIButton *top = [[UIButton alloc]init];
53 | top.backgroundColor = [UIColor whiteColor];
54 | top.userInteractionEnabled = NO;
55 | [self.contentView addSubview:top];
56 | self.topLine = top;
57 |
58 | UIButton *bottom = [[UIButton alloc]init];
59 | bottom.backgroundColor = [UIColor whiteColor];
60 | bottom.userInteractionEnabled = NO;
61 | [self.contentView addSubview:bottom];
62 | self.bottomLine = bottom;
63 | }
64 | return self;
65 | }
66 |
67 | // 设置所有的子控件的frame
68 | - (void)layoutSubviews
69 | {
70 | [super layoutSubviews];
71 |
72 | self.ImageView.frame = self.bounds;
73 |
74 | self.shadeView.frame = self.bounds;
75 |
76 | /** 标题 */
77 | self.titleLabel.frame = CGRectMake(5, self.bounds.size.height/2 - 10, self.bounds.size.width - 10, 20);
78 |
79 | /** 信息 */
80 | self.messageLabel.frame = CGRectMake(0, _titleLabel.bottom, _titleLabel.width, 25);
81 |
82 | self.topLine.frame = CGRectMake(ScreenWidth/2 - 15, _messageLabel.bottom + 20, 30, 0.5);
83 |
84 | self.indexLabel.frame = CGRectMake(ScreenWidth/2 - 30, _topLine.bottom + 5, 60, 15);
85 |
86 | self.bottomLine.frame = CGRectMake(ScreenWidth/2 - 15, _indexLabel.bottom + 3, 30, 0.5);
87 | }
88 | @end
89 |
--------------------------------------------------------------------------------
/App/UI/Me/Controller/FourViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // FourViewController.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface FourViewController : UIViewController
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/UI/Me/Controller/LoginViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LoginViewController.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/10/3.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface LoginViewController : UIViewController
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/UI/Me/Controller/MeNextViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MeNextViewController.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/10/3.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface MeNextViewController : UIViewController
15 |
16 | @property (nonatomic, copy) NSString *pageTitle;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/App/UI/Me/Controller/MeNextViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // MeNextViewController.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/10/3.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "MeNextViewController.h"
13 |
14 | @interface MeNextViewController ()
15 |
16 | @end
17 |
18 | @implementation MeNextViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 |
23 | self.view.backgroundColor = RandomColor;
24 |
25 | self.title = self.pageTitle;
26 |
27 | [self.navigationController.navigationBar setTitleTextAttributes:
28 |
29 | @{NSFontAttributeName:[UIFont fontWithName:MyChinFont size:16.f],
30 |
31 | NSForegroundColorAttributeName:[UIColor blackColor]}];
32 | }
33 |
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/App/UI/Me/Controller/UserAgreement.h:
--------------------------------------------------------------------------------
1 | //
2 | // UserAgreement.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/10/3.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UserAgreement : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/App/UI/Me/Controller/UserAgreement.m:
--------------------------------------------------------------------------------
1 | //
2 | // UserAgreement.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/10/3.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 |
9 | #import "UserAgreement.h"
10 |
11 | @interface UserAgreement ()
12 |
13 | @end
14 |
15 | @implementation UserAgreement
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 |
21 | self.view.backgroundColor = [UIColor whiteColor];
22 |
23 | [self getData];
24 |
25 | UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(20, 30, 30, 30)];
26 | [btn setBackgroundImage:[UIImage imageNamed:@"audio_AD_close"] forState:UIControlStateNormal];
27 | [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
28 | [self.view addSubview:btn];
29 | }
30 |
31 | - (void)getData{
32 |
33 | UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 20, ScreenWidth, ScreenHeight)];
34 | webView.backgroundColor = [UIColor whiteColor];
35 | NSString *path = [[NSBundle mainBundle] bundlePath];
36 | NSURL *baseURL = [NSURL fileURLWithPath:path];
37 | NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"service_terms_chs.html"
38 | ofType:nil];
39 | NSString *htmlCont = [NSString stringWithContentsOfFile:htmlPath
40 | encoding:NSUTF8StringEncoding
41 | error:nil];
42 | [webView loadHTMLString:htmlCont baseURL:baseURL];
43 |
44 | [self.view addSubview:webView];
45 | }
46 |
47 | - (void)btnClick{
48 |
49 | [self dismissViewControllerAnimated:YES completion:nil];
50 | }
51 |
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/App/UI/Me/View/MyTableViewCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // MyTableViewCell.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/10/3.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 |
14 | @interface MyTableViewCell : UITableViewCell
15 |
16 | @property (nonatomic, strong) UILabel *label;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/App/UI/Me/View/MyTableViewCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // MyTableViewCell.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/10/3.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "MyTableViewCell.h"
13 |
14 | @implementation MyTableViewCell
15 |
16 | // 在这个方法中添加所有的子控件
17 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
18 | {
19 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
20 |
21 | UILabel *desLabel = [[UILabel alloc] init];
22 | desLabel.textColor = [UIColor darkGrayColor];
23 | desLabel.font = [UIFont fontWithName:MyChinFont size:14.f];
24 | desLabel.textAlignment = NSTextAlignmentCenter;
25 | [self.contentView addSubview:desLabel];
26 | self.label = desLabel;
27 | }
28 | return self;
29 | }
30 |
31 | // 设置所有的子控件的frame
32 | - (void)layoutSubviews
33 | {
34 | [super layoutSubviews];
35 |
36 | self.label.frame = CGRectMake(10, self.height/2 - 15, self.width - 20, 30);
37 | }
38 |
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/App/lib/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/.DS_Store
--------------------------------------------------------------------------------
/App/lib/AFNetworking/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/AFNetworking/.DS_Store
--------------------------------------------------------------------------------
/App/lib/AFNetworking/AFNetworking/AFNetworking.h:
--------------------------------------------------------------------------------
1 | // AFNetworking.h
2 | //
3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/)
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 | #import
25 |
26 | #ifndef _AFNETWORKING_
27 | #define _AFNETWORKING_
28 |
29 | #import "AFURLRequestSerialization.h"
30 | #import "AFURLResponseSerialization.h"
31 | #import "AFSecurityPolicy.h"
32 | #import "AFNetworkReachabilityManager.h"
33 |
34 | #import "AFURLConnectionOperation.h"
35 | #import "AFHTTPRequestOperation.h"
36 | #import "AFHTTPRequestOperationManager.h"
37 |
38 | #if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \
39 | ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) )
40 | #import "AFURLSessionManager.h"
41 | #import "AFHTTPSessionManager.h"
42 | #endif
43 |
44 | #endif /* _AFNETWORKING_ */
45 |
--------------------------------------------------------------------------------
/App/lib/AFNetworking/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com/)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/App/lib/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIActivityIndicatorView+AFNetworking.h
2 | //
3 | // Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | #import
26 |
27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
28 |
29 | #import
30 |
31 | @class AFURLConnectionOperation;
32 |
33 | /**
34 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a request operation or session task.
35 | */
36 | @interface UIActivityIndicatorView (AFNetworking)
37 |
38 | ///----------------------------------
39 | /// @name Animating for Session Tasks
40 | ///----------------------------------
41 |
42 | /**
43 | Binds the animating state to the state of the specified task.
44 |
45 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
46 | */
47 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
48 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task;
49 | #endif
50 |
51 | ///---------------------------------------
52 | /// @name Animating for Request Operations
53 | ///---------------------------------------
54 |
55 | /**
56 | Binds the animating state to the execution state of the specified operation.
57 |
58 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
59 | */
60 | - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation;
61 |
62 | @end
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/App/lib/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIKit+AFNetworking.h
2 | //
3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/)
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | #ifndef _UIKIT_AFNETWORKING_
26 | #define _UIKIT_AFNETWORKING_
27 |
28 | #import "AFNetworkActivityIndicatorManager.h"
29 |
30 | #import "UIActivityIndicatorView+AFNetworking.h"
31 | #import "UIAlertView+AFNetworking.h"
32 | #import "UIButton+AFNetworking.h"
33 | #import "UIImageView+AFNetworking.h"
34 | #import "UIKit+AFNetworking.h"
35 | #import "UIProgressView+AFNetworking.h"
36 | #import "UIRefreshControl+AFNetworking.h"
37 | #import "UIWebView+AFNetworking.h"
38 | #endif /* _UIKIT_AFNETWORKING_ */
39 |
--------------------------------------------------------------------------------
/App/lib/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIProgressView+AFNetworking.h
2 | //
3 | // Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | #import
26 |
27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
28 |
29 | #import
30 |
31 | @class AFURLConnectionOperation;
32 |
33 | /**
34 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task or request operation.
35 | */
36 | @interface UIProgressView (AFNetworking)
37 |
38 | ///------------------------------------
39 | /// @name Setting Session Task Progress
40 | ///------------------------------------
41 |
42 | /**
43 | Binds the progress to the upload progress of the specified session task.
44 |
45 | @param task The session task.
46 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
47 | */
48 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
49 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
50 | animated:(BOOL)animated;
51 | #endif
52 |
53 | /**
54 | Binds the progress to the download progress of the specified session task.
55 |
56 | @param task The session task.
57 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
58 | */
59 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
60 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
61 | animated:(BOOL)animated;
62 | #endif
63 |
64 | ///------------------------------------
65 | /// @name Setting Session Task Progress
66 | ///------------------------------------
67 |
68 | /**
69 | Binds the progress to the upload progress of the specified request operation.
70 |
71 | @param operation The request operation.
72 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
73 | */
74 | - (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation
75 | animated:(BOOL)animated;
76 |
77 | /**
78 | Binds the progress to the download progress of the specified request operation.
79 |
80 | @param operation The request operation.
81 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
82 | */
83 | - (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation
84 | animated:(BOOL)animated;
85 |
86 | @end
87 |
88 | #endif
89 |
--------------------------------------------------------------------------------
/App/lib/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIRefreshControl+AFNetworking.m
2 | //
3 | // Copyright (c) 2014 AFNetworking (http://afnetworking.com)
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | #import
26 |
27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
28 |
29 | #import
30 |
31 | @class AFURLConnectionOperation;
32 |
33 | /**
34 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically begining and ending refreshing depending on the loading state of a request operation or session task.
35 | */
36 | @interface UIRefreshControl (AFNetworking)
37 |
38 | ///-----------------------------------
39 | /// @name Refreshing for Session Tasks
40 | ///-----------------------------------
41 |
42 | /**
43 | Binds the refreshing state to the state of the specified task.
44 |
45 | @param task The task. If `nil`, automatic updating from any previously specified operation will be diabled.
46 | */
47 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
48 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task;
49 | #endif
50 |
51 | ///----------------------------------------
52 | /// @name Refreshing for Request Operations
53 | ///----------------------------------------
54 |
55 | /**
56 | Binds the refreshing state to the execution state of the specified operation.
57 |
58 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
59 | */
60 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation;
61 |
62 | @end
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/App/lib/CustomShare/ShareScrollView.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShareScrollView.h
3 | // CustomToShare
4 | //
5 | // Created by 张丁豪 on 16/9/17.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | // icon起点X坐标
12 | #define OriginX 15.0
13 | // icon起点Y坐标
14 | #define OriginY 15.0
15 | // 正方形图标宽度
16 | #define IconWidth 57.0
17 | // 图标和标题间的间隔
18 | #define IconAndTitleSpace 10.0
19 | // 标签字体大小
20 | #define TitleSize 10.0
21 | // 标签字体颜色
22 | #define TitleColor [UIColor colorWithRed:52/255.0 green:52/255.0 blue:50/255.0 alpha:1.0]
23 | // 尾部间隔
24 | #define LastlySpace 15.0
25 | // 横向间距
26 | #define HorizontalSpace 15.0
27 |
28 | @class ShareScrollView;
29 |
30 | @protocol ShareScrollViewDelegate
31 |
32 | - (void)shareScrollViewButtonAction:(ShareScrollView *)shareScrollView title:(NSString *)title;
33 |
34 | @end
35 |
36 | @interface ShareScrollView : UIScrollView
37 |
38 | @property (nonatomic,assign) id MyScrollViewDelegate;
39 | // icon起点X坐标
40 | @property (nonatomic,assign) float originX;
41 | // icon起点Y坐标
42 | @property (nonatomic,assign) float originY;
43 | // 正方形图标宽度
44 | @property (nonatomic,assign) float icoWidth;
45 | // 图标和标题间的间隔
46 | @property (nonatomic,assign) float icoAndTitleSpace;
47 | // 标签字体大小
48 | @property (nonatomic,assign) float titleSize;
49 | // 标签字体颜色
50 | @property (nonatomic,strong) UIColor *titleColor;
51 | // 尾部间隔
52 | @property (nonatomic,assign) float lastlySpace;
53 | // 横向间距
54 | @property (nonatomic,assign) float horizontalSpace;
55 |
56 | - (void)setShareAry:(NSArray *)shareAry delegate:(id)delegate;
57 |
58 | + (float)getShareScrollViewHeight;
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/App/lib/CustomShare/ShareView.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShareView.h
3 | // CustomToShare
4 | //
5 | // Created by 张丁豪 on 16/9/17.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class ShareView;
12 |
13 | @protocol CustomShareViewDelegate
14 |
15 | - (void)easyCustomShareViewButtonAction:(ShareView *)shareView title:(NSString *)title;
16 |
17 | @end
18 |
19 | @interface ShareView : UIView
20 |
21 | @property (nonatomic,assign) id delegate;
22 | // 背景View
23 | @property (nonatomic,strong) UIView *backView;
24 | // 头部分享标题
25 | @property (nonatomic,strong) UIView *headerView;
26 | // 中间View,主要放分享
27 | @property (nonatomic,strong) UIView *boderView;
28 | // 中间分隔线
29 | @property (nonatomic,strong) UILabel *middleLineLabel;
30 | // 第一行分享媒介数量,分享媒介最多显示2行,如果第一行显示了全部则不显示第二行
31 | @property (nonatomic,assign) NSInteger firstCount;
32 | // 尾部其他自定义View
33 | @property (nonatomic,strong) UIView *footerView;
34 | // 取消
35 | @property (nonatomic,strong) UIButton *cancleButton;
36 | // 是否显示滚动条
37 | @property (nonatomic,assign) BOOL showsHorizontalScrollIndicator;
38 |
39 | - (void)setShareAry:(NSArray *)shareAry delegate:(id)delegate;
40 |
41 | - (float)getBoderViewHeight:(NSArray *)shareAry firstCount:(NSInteger)count;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/App/lib/Helper/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/Helper/.DS_Store
--------------------------------------------------------------------------------
/App/lib/Helper/Factory.h:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // Created by 张丁豪 on 15/7/28.
4 | // Copyright (c) 2015年 张丁豪. All rights reserved.
5 | //
6 |
7 | #import
8 | #import
9 |
10 | @interface Factory : NSObject
11 |
12 |
13 | + (UIButton *)createButtonWithTitle:(NSString *)title frame:(CGRect)frame target:(id)target tag:(NSInteger)tag selector:(SEL)selector;
14 | + (UIButton *)createButtonWithFrame:(CGRect)frame target:(id)target sel:(SEL)sel tag:(NSInteger)tag image:(NSString *)name title:(NSString *)title;
15 | + (UIButton *)createButtonWithTitle:(NSString *)title frame:(CGRect)frame target:(id)target selector:(SEL)selector font:(UIFont *)font tintColor:(UIColor *)tintcolor backgroundColor:(UIColor *)backColor;
16 |
17 | + (UIButton *)createButtonWithFrame:(CGRect)frame target:(id)target sel:(SEL)sel tag:(NSInteger)tag normalImage:(NSString *)normalName seleImage:(NSString *)seleName title:(NSString *)title font:(UIFont *)font tintColor:(UIColor *)tintcolor;
18 |
19 |
20 | + (UILabel *)createLabelWithTitle:(NSString *)title frame:(CGRect)frame;
21 | + (UILabel *)createLabelWithTitle:(NSString *)title frame:(CGRect)frame textColor:(UIColor *)color fontSize:(CGFloat)size;
22 | + (UILabel *)createLabelWithFrame:(CGRect)frame text:(NSString *)text ;
23 |
24 | + (UIView *)createViewWithBackgroundColor:(UIColor *)color frame:(CGRect)frame;
25 |
26 | + (UIImageView *)createImageViewWithFrame:(CGRect)frame imageName:(NSString *)name;
27 |
28 | + (UITextField *)createTextFieldWithFrame:(CGRect)frame placeHolder:(NSString *)string delegate:(id )delegate tag:(NSInteger)tag;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/App/lib/Helper/HelpViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // HelpViewController.h
3 | // XieYingEchoPlay
4 | //
5 | // Created by 张东良 on 15/12/22.
6 | // Copyright © 2015年 张东良. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "UIView+Addition.h"
11 | #import "Factory.h"
12 | #import "MyHelper.h"
13 |
14 | @interface HelpViewController : UIViewController
15 |
16 | - (void)createNavigationLeftButton:(id)view;
17 |
18 | - (void)createNavigationLeftButtonWithTitle:(NSString *)title target:(id)target action:(SEL)action;
19 |
20 | - (void)createNavigationRightButton:(id)view;
21 |
22 | - (void)createNavigationRightButtonWithTitle:(NSString *)title target:(id)target action:(SEL)action;
23 |
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/App/lib/Helper/HelpViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // HelpViewController.m
3 | // XieYingEchoPlay
4 | //
5 | // Created by 张东良 on 15/12/22.
6 | // Copyright © 2015年 张东良. All rights reserved.
7 | //
8 |
9 | #import "HelpViewController.h"
10 |
11 | @interface HelpViewController ()
12 |
13 |
14 | @end
15 |
16 | @implementation HelpViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 |
21 | self.view.backgroundColor = [UIColor whiteColor];
22 | }
23 |
24 | - (void)didReceiveMemoryWarning {
25 | [super didReceiveMemoryWarning];
26 | // Dispose of any resources that can be recreated.
27 | }
28 |
29 | - (void)createNavigationLeftButton:(id)view {
30 | UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:view];
31 | self.navigationItem.leftBarButtonItem = leftItem;
32 | }
33 |
34 | - (void)createNavigationLeftButtonWithTitle:(NSString *)title target:(id)target action:(SEL)action {
35 | UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:target action:action];
36 | self.navigationItem.leftBarButtonItem = leftItem;
37 | }
38 |
39 | - (void)createNavigationRightButton:(id)view {
40 | UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:view];
41 | self.navigationItem.rightBarButtonItem = rightItem;
42 | }
43 |
44 | - (void)createNavigationRightButtonWithTitle:(NSString *)title target:(id)target action:(SEL)action {
45 | UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:target action:action];
46 | self.navigationItem.rightBarButtonItem = rightItem;
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/App/lib/Helper/MyHelper.h:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // Created by 张丁豪 on 15/8/3.
4 | // Copyright (c) 2015年 张丁豪. All rights reserved.
5 | //
6 |
7 | #ifndef UIControlDemo_MyHelper_h
8 | #define UIControlDemo_MyHelper_h
9 |
10 | #define Default 44
11 |
12 | #define LeftDistance 10
13 |
14 | #define ScreenWidth [[UIScreen mainScreen] bounds].size.width
15 |
16 | #define ScreenHeight [[UIScreen mainScreen] bounds].size.height
17 |
18 | #define RightDistance 10
19 |
20 | #define ControlDistance 20
21 | //安全释放宏
22 | #define Release_Safe(_control) [_control release], _control = nil;
23 |
24 | #define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
25 |
26 | #define RGB(r,g,b) RGBA(r,g,b,1.f)
27 |
28 | #define RandomColor RGB(arc4random()%256,arc4random()%256,arc4random()%256)
29 |
30 | #define LDColorHex(c) [UIColor colorWithRed:((c>>16)&0xFF)/255.0 green:((c>>8)&0xFF)/255.0 blue:((c)&0xFF)/255.0 alpha:1.0]
31 |
32 | #define BASECOLOR [UIColor colorWithRed:1 green:.78 blue:.27 alpha:1]
33 |
34 | #ifdef DEBUG
35 | #define MyLog(FORMAT, ...) fprintf(stderr,"%s: 第%d行\t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
36 |
37 | #else
38 | #define MyLog(...)
39 | #endif
40 |
41 | #endif
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/App/lib/Helper/UIColor+FlatColors.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIColor+FlatColors.h
3 | // 项目框架
4 | //
5 | // Created by 张东良 on 15/12/11.
6 | // Copyright (c) 2015年 张丁豪. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIColor (FlatColors)
12 |
13 | + (UIColor *)flatTurquoiseColor;
14 |
15 | + (UIColor *)flatGreenSeaColor;
16 |
17 | + (UIColor *)flatEmeraldColor;
18 |
19 | + (UIColor *)flatNephritisColor;
20 |
21 | + (UIColor *)flatPeterRiverColor;
22 |
23 | + (UIColor *)flatBelizeHoleColor;
24 |
25 | + (UIColor *)flatAmethystColor;
26 |
27 | + (UIColor *)flatWisteriaColor;
28 |
29 | + (UIColor *)flatWetAsphaltColor;
30 |
31 | + (UIColor *)flatMidnightBlueColor;
32 |
33 | + (UIColor *)flatSunFlowerColor;
34 |
35 | + (UIColor *)flatOrangeColor;
36 |
37 | + (UIColor *)flatCarrotColor;
38 |
39 | + (UIColor *)flatPumpkinColor;
40 |
41 | + (UIColor *)flatAlizarinColor;
42 |
43 | + (UIColor *)flatPomegranateColor;
44 |
45 | + (UIColor *)flatCloudsColor;
46 |
47 | + (UIColor *)flatSilverColor;
48 |
49 | + (UIColor *)flatConcreteColor;
50 |
51 | + (UIColor *)flatAsbestosColor;
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/App/lib/Helper/UIColor+FlatColors.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIColor+FlatColors.m
3 | // 项目框架
4 | //
5 | // Created by 张东良 on 15/12/11.
6 | // Copyright (c) 2015年 张丁豪. All rights reserved.
7 | //
8 |
9 | #import "UIColor+FlatColors.h"
10 |
11 | @implementation UIColor (FlatColors)
12 |
13 | #define AGEColorImplement(COLOR_NAME,RED,GREEN,BLUE) \
14 | + (UIColor *)COLOR_NAME{ \
15 | static UIColor* COLOR_NAME##_color; \
16 | static dispatch_once_t COLOR_NAME##_onceToken; \
17 | dispatch_once(&COLOR_NAME##_onceToken, ^{ \
18 | COLOR_NAME##_color = [UIColor colorWithRed:RED green:GREEN blue:BLUE alpha:1.0]; \
19 | }); \
20 | return COLOR_NAME##_color; \
21 | }
22 |
23 | AGEColorImplement(flatTurquoiseColor, 0.10196078431372549, 0.7372549019607844, 0.611764705882353)
24 | AGEColorImplement(flatGreenSeaColor, 0.08627450980392157, 0.6274509803921569, 0.5215686274509804)
25 | AGEColorImplement(flatEmeraldColor, 0.1803921568627451, 0.8, 0.44313725490196076)
26 | AGEColorImplement(flatNephritisColor, 0.15294117647058825, 0.6823529411764706, 0.3764705882352941)
27 | AGEColorImplement(flatPeterRiverColor, 0.20392156862745098, 0.596078431372549, 0.8588235294117647)
28 | AGEColorImplement(flatBelizeHoleColor, 0.1607843137254902, 0.5019607843137255, 0.7254901960784313)
29 | AGEColorImplement(flatAmethystColor, 0.6078431372549019, 0.34901960784313724, 0.7137254901960784)
30 | AGEColorImplement(flatWisteriaColor, 0.5568627450980392, 0.26666666666666666, 0.6784313725490196)
31 | AGEColorImplement(flatWetAsphaltColor, 0.20392156862745098, 0.28627450980392155, 0.3686274509803922)
32 | AGEColorImplement(flatMidnightBlueColor, 0.17254901960784313, 0.24313725490196078, 0.3137254901960784)
33 | AGEColorImplement(flatSunFlowerColor, 0.9450980392156862, 0.7686274509803922, 0.058823529411764705)
34 | AGEColorImplement(flatOrangeColor, 0.9529411764705882, 0.611764705882353, 0.07058823529411765)
35 | AGEColorImplement(flatCarrotColor, 0.9019607843137255, 0.49411764705882355, 0.13333333333333333)
36 | AGEColorImplement(flatPumpkinColor, 0.8274509803921568, 0.32941176470588235, 0)
37 | AGEColorImplement(flatAlizarinColor, 0.9058823529411765, 0.2980392156862745, 0.23529411764705882)
38 | AGEColorImplement(flatPomegranateColor, 0.7529411764705882, 0.2235294117647059, 0.16862745098039217)
39 | AGEColorImplement(flatCloudsColor, 0.9254901960784314, 0.9411764705882353, 0.9450980392156862)
40 | AGEColorImplement(flatSilverColor, 0.7411764705882353, 0.7647058823529411, 0.7803921568627451)
41 | AGEColorImplement(flatConcreteColor, 0.5843137254901961, 0.6470588235294118, 0.6509803921568628)
42 | AGEColorImplement(flatAsbestosColor, 0.4980392156862745, 0.5490196078431373, 0.5529411764705883)
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/App/lib/Helper/UIView+Addition.h:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // Created by 张丁豪 on 15/7/29.
4 | // Copyright (c) 2015年 张丁豪. All rights reserved.
5 | //
6 |
7 | #import
8 |
9 | @interface UIView (Addition)
10 |
11 | @property (nonatomic, assign) CGFloat sd_height;
12 | @property (nonatomic, assign) CGFloat sd_width;
13 |
14 | @property (nonatomic, assign) CGFloat sd_y;
15 | @property (nonatomic, assign) CGFloat sd_x;
16 |
17 |
18 |
19 | //宽
20 | - (CGFloat)width;
21 |
22 | //高
23 | - (CGFloat)height;
24 |
25 | //上
26 | - (CGFloat)top;
27 |
28 | //下
29 | - (CGFloat)bottom;
30 |
31 | //左
32 | - (CGFloat)left;
33 |
34 | //右
35 | - (CGFloat)right;
36 |
37 | //设置宽
38 | - (void)setWidth:(CGFloat)width;
39 |
40 | //设置高
41 | - (void)setHeight:(CGFloat)height;
42 |
43 | //设置x
44 | - (void)setXOffset:(CGFloat)x;
45 |
46 | //设置y
47 | - (void)setYOffset:(CGFloat)y;
48 |
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/App/lib/Helper/UIView+Addition.m:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // Created by 张丁豪 on 15/7/29.
4 | // Copyright (c) 2015年 张丁豪. All rights reserved.
5 | //
6 |
7 | #import "UIView+Addition.h"
8 |
9 | @implementation UIView (Addition)
10 |
11 | - (CGFloat)sd_height
12 | {
13 | return self.frame.size.height;
14 | }
15 |
16 | - (void)setSd_height:(CGFloat)sd_height
17 | {
18 | CGRect temp = self.frame;
19 | temp.size.height = sd_height;
20 | self.frame = temp;
21 | }
22 |
23 | - (CGFloat)sd_width
24 | {
25 | return self.frame.size.width;
26 | }
27 |
28 | - (void)setSd_width:(CGFloat)sd_width
29 | {
30 | CGRect temp = self.frame;
31 | temp.size.width = sd_width;
32 | self.frame = temp;
33 | }
34 |
35 |
36 | - (CGFloat)sd_y
37 | {
38 | return self.frame.origin.y;
39 | }
40 |
41 | - (void)setSd_y:(CGFloat)sd_y
42 | {
43 | CGRect temp = self.frame;
44 | temp.origin.y = sd_y;
45 | self.frame = temp;
46 | }
47 |
48 | - (CGFloat)sd_x
49 | {
50 | return self.frame.origin.x;
51 | }
52 |
53 | - (void)setSd_x:(CGFloat)sd_x
54 | {
55 | CGRect temp = self.frame;
56 | temp.origin.x = sd_x;
57 | self.frame = temp;
58 | }
59 |
60 | /************************************/
61 |
62 | - (CGFloat)width {
63 | return self.frame.size.width;
64 | }
65 |
66 | - (CGFloat)height {
67 | return self.frame.size.height;
68 | }
69 |
70 | - (CGFloat)top {
71 | return self.frame.origin.y;
72 | }
73 |
74 | - (CGFloat)bottom {
75 | return self.frame.origin.y + self.frame.size.height;
76 | }
77 |
78 | - (CGFloat)left {
79 | return self.frame.origin.x;
80 | }
81 |
82 | - (CGFloat)right {
83 | return self.frame.origin.x + self.frame.size.width;
84 | }
85 |
86 | - (void)setWidth:(CGFloat)width {
87 | CGRect frame = self.frame;
88 | frame.size.width = width;
89 | self.frame = frame;
90 | }
91 |
92 | - (void)setHeight:(CGFloat)height {
93 | CGRect frame = self.frame;
94 | frame.size.height = height;
95 | self.frame = frame;
96 | }
97 |
98 | - (void)setXOffset:(CGFloat)x {
99 | CGRect frame = self.frame;
100 | frame.origin.x = x;
101 | self.frame = frame;
102 | }
103 |
104 | - (void)setYOffset:(CGFloat)y {
105 | CGRect frame = self.frame;
106 | frame.origin.y = y;
107 | self.frame = frame;
108 | }
109 |
110 | @end
111 |
--------------------------------------------------------------------------------
/App/lib/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("请使用triggerAutomaticallyRefreshPercent属性");
17 |
18 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */
19 | @property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent;
20 | @end
21 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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 | /** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏。默认是NO) */
29 | @property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden;
30 | @end
31 |
--------------------------------------------------------------------------------
/App/lib/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 = NO;
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 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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)prepare
70 | {
71 | [super prepare];
72 |
73 | // 初始化间距
74 | self.labelLeftInset = 20;
75 | }
76 |
77 | - (void)placeSubviews
78 | {
79 | [super placeSubviews];
80 |
81 | if (self.gifView.constraints.count) return;
82 |
83 | self.gifView.frame = self.bounds;
84 | if (self.isRefreshingTitleHidden) {
85 | self.gifView.contentMode = UIViewContentModeCenter;
86 | } else {
87 | self.gifView.contentMode = UIViewContentModeRight;
88 | self.gifView.mj_w = self.mj_w * 0.5 - self.labelLeftInset - self.stateLabel.mj_textWith * 0.5;
89 | }
90 | }
91 |
92 | - (void)setState:(MJRefreshState)state
93 | {
94 | MJRefreshCheckState
95 |
96 | // 根据状态做事情
97 | if (state == MJRefreshStateRefreshing) {
98 | NSArray *images = self.stateImages[@(state)];
99 | if (images.count == 0) return;
100 | [self.gifView stopAnimating];
101 |
102 | self.gifView.hidden = NO;
103 | if (images.count == 1) { // 单张图片
104 | self.gifView.image = [images lastObject];
105 | } else { // 多张图片
106 | self.gifView.animationImages = images;
107 | self.gifView.animationDuration = [self.stateDurations[@(state)] doubleValue];
108 | [self.gifView startAnimating];
109 | }
110 | } else if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) {
111 | [self.gifView stopAnimating];
112 | self.gifView.hidden = YES;
113 | }
114 | }
115 | @end
116 |
117 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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 mark - 重写父类的方法
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 -= self.stateLabel.mj_textWith * 0.5 + self.labelLeftInset;
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 |
--------------------------------------------------------------------------------
/App/lib/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 | /** 文字距离圈圈、箭头的距离 */
13 | @property (assign, nonatomic) CGFloat labelLeftInset;
14 | /** 显示刷新状态的label */
15 | @property (weak, nonatomic, readonly) UILabel *stateLabel;
16 |
17 | /** 设置state状态下的文字 */
18 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state;
19 |
20 | /** 隐藏刷新状态的文字 */
21 | @property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden;
22 | @end
23 |
--------------------------------------------------------------------------------
/App/lib/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 mj_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.labelLeftInset = MJRefreshLabelLeftInset;
61 |
62 | // 初始化文字
63 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterIdleText] forState:MJRefreshStateIdle];
64 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterRefreshingText] forState:MJRefreshStateRefreshing];
65 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshAutoFooterNoMoreDataText] forState:MJRefreshStateNoMoreData];
66 |
67 | // 监听label
68 | self.stateLabel.userInteractionEnabled = YES;
69 | [self.stateLabel addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(stateLabelClick)]];
70 | }
71 |
72 | - (void)placeSubviews
73 | {
74 | [super placeSubviews];
75 |
76 | if (self.stateLabel.constraints.count) return;
77 |
78 | // 状态标签
79 | self.stateLabel.frame = self.bounds;
80 | }
81 |
82 | - (void)setState:(MJRefreshState)state
83 | {
84 | MJRefreshCheckState
85 |
86 | if (self.isRefreshingTitleHidden && state == MJRefreshStateRefreshing) {
87 | self.stateLabel.text = nil;
88 | } else {
89 | self.stateLabel.text = self.stateTitles[@(state)];
90 | }
91 | }
92 | @end
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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 | /** 文字距离圈圈、箭头的距离 */
13 | @property (assign, nonatomic) CGFloat labelLeftInset;
14 | /** 显示刷新状态的label */
15 | @property (weak, nonatomic, readonly) UILabel *stateLabel;
16 | /** 设置state状态下的文字 */
17 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state;
18 |
19 | /** 获取state状态下的title */
20 | - (NSString *)titleForState:(MJRefreshState)state;
21 | @end
22 |
--------------------------------------------------------------------------------
/App/lib/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 mj_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.labelLeftInset = MJRefreshLabelLeftInset;
57 |
58 | // 初始化文字
59 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterIdleText] forState:MJRefreshStateIdle];
60 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterPullingText] forState:MJRefreshStatePulling];
61 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterRefreshingText] forState:MJRefreshStateRefreshing];
62 | [self setTitle:[NSBundle mj_localizedStringForKey:MJRefreshBackFooterNoMoreDataText] forState:MJRefreshStateNoMoreData];
63 | }
64 |
65 | - (void)placeSubviews
66 | {
67 | [super placeSubviews];
68 |
69 | if (self.stateLabel.constraints.count) return;
70 |
71 | // 状态标签
72 | self.stateLabel.frame = self.bounds;
73 | }
74 |
75 | - (void)setState:(MJRefreshState)state
76 | {
77 | MJRefreshCheckState
78 |
79 | // 设置状态文字
80 | self.stateLabel.text = self.stateTitles[@(state)];
81 | }
82 | @end
83 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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 | /** 文字距离圈圈、箭头的距离 */
20 | @property (assign, nonatomic) CGFloat labelLeftInset;
21 | /** 显示刷新状态的label */
22 | @property (weak, nonatomic, readonly) UILabel *stateLabel;
23 | /** 设置state状态下的文字 */
24 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state;
25 | @end
26 |
--------------------------------------------------------------------------------
/App/lib/MJRefresh/MJRefresh.bundle/arrow@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/MJRefresh/MJRefresh.bundle/arrow@2x.png
--------------------------------------------------------------------------------
/App/lib/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings
--------------------------------------------------------------------------------
/App/lib/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings
--------------------------------------------------------------------------------
/App/lib/MJRefresh/MJRefresh.bundle/zh-Hant.lproj/Localizable.strings:
--------------------------------------------------------------------------------
1 | "MJRefreshHeaderIdleText" = "下拉可以刷新";
2 | "MJRefreshHeaderPullingText" = "鬆開立即刷新";
3 | "MJRefreshHeaderRefreshingText" = "正在刷新數據中...";
4 |
5 | "MJRefreshAutoFooterIdleText" = "點擊或上拉加載更多";
6 | "MJRefreshAutoFooterRefreshingText" = "正在加載更多的數據...";
7 | "MJRefreshAutoFooterNoMoreDataText" = "已經全部加載完畢";
8 |
9 | "MJRefreshBackFooterIdleText" = "上拉可以加載更多";
10 | "MJRefreshBackFooterPullingText" = "鬆開立即加載更多";
11 | "MJRefreshBackFooterRefreshingText" = "正在加載更多的數據...";
12 | "MJRefreshBackFooterNoMoreDataText" = "已經全部加載完畢";
13 |
14 | "MJRefreshHeaderLastTimeText" = "最後更新:";
15 | "MJRefreshHeaderDateTodayText" = "今天";
16 | "MJRefreshHeaderNoneLastDateText" = "無記錄";
17 |
--------------------------------------------------------------------------------
/App/lib/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"
--------------------------------------------------------------------------------
/App/lib/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 | UIKIT_EXTERN const CGFloat MJRefreshLabelLeftInset;
34 | UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight;
35 | UIKIT_EXTERN const CGFloat MJRefreshFooterHeight;
36 | UIKIT_EXTERN const CGFloat MJRefreshFastAnimationDuration;
37 | UIKIT_EXTERN const CGFloat MJRefreshSlowAnimationDuration;
38 |
39 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentOffset;
40 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentSize;
41 | UIKIT_EXTERN NSString *const MJRefreshKeyPathContentInset;
42 | UIKIT_EXTERN NSString *const MJRefreshKeyPathPanState;
43 |
44 | UIKIT_EXTERN NSString *const MJRefreshHeaderLastUpdatedTimeKey;
45 |
46 | UIKIT_EXTERN NSString *const MJRefreshHeaderIdleText;
47 | UIKIT_EXTERN NSString *const MJRefreshHeaderPullingText;
48 | UIKIT_EXTERN NSString *const MJRefreshHeaderRefreshingText;
49 |
50 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterIdleText;
51 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterRefreshingText;
52 | UIKIT_EXTERN NSString *const MJRefreshAutoFooterNoMoreDataText;
53 |
54 | UIKIT_EXTERN NSString *const MJRefreshBackFooterIdleText;
55 | UIKIT_EXTERN NSString *const MJRefreshBackFooterPullingText;
56 | UIKIT_EXTERN NSString *const MJRefreshBackFooterRefreshingText;
57 | UIKIT_EXTERN NSString *const MJRefreshBackFooterNoMoreDataText;
58 |
59 | UIKIT_EXTERN NSString *const MJRefreshHeaderLastTimeText;
60 | UIKIT_EXTERN NSString *const MJRefreshHeaderDateTodayText;
61 | UIKIT_EXTERN NSString *const MJRefreshHeaderNoneLastDateText;
62 |
63 | // 状态检查
64 | #define MJRefreshCheckState \
65 | MJRefreshState oldState = self.state; \
66 | if (state == oldState) return; \
67 | [super setState:state];
68 |
--------------------------------------------------------------------------------
/App/lib/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 MJRefreshLabelLeftInset = 25;
6 | const CGFloat MJRefreshHeaderHeight = 54.0;
7 | const CGFloat MJRefreshFooterHeight = 44.0;
8 | const CGFloat MJRefreshFastAnimationDuration = 0.25;
9 | const CGFloat MJRefreshSlowAnimationDuration = 0.4;
10 |
11 | NSString *const MJRefreshKeyPathContentOffset = @"contentOffset";
12 | NSString *const MJRefreshKeyPathContentInset = @"contentInset";
13 | NSString *const MJRefreshKeyPathContentSize = @"contentSize";
14 | NSString *const MJRefreshKeyPathPanState = @"state";
15 |
16 | NSString *const MJRefreshHeaderLastUpdatedTimeKey = @"MJRefreshHeaderLastUpdatedTimeKey";
17 |
18 | NSString *const MJRefreshHeaderIdleText = @"MJRefreshHeaderIdleText";
19 | NSString *const MJRefreshHeaderPullingText = @"MJRefreshHeaderPullingText";
20 | NSString *const MJRefreshHeaderRefreshingText = @"MJRefreshHeaderRefreshingText";
21 |
22 | NSString *const MJRefreshAutoFooterIdleText = @"MJRefreshAutoFooterIdleText";
23 | NSString *const MJRefreshAutoFooterRefreshingText = @"MJRefreshAutoFooterRefreshingText";
24 | NSString *const MJRefreshAutoFooterNoMoreDataText = @"MJRefreshAutoFooterNoMoreDataText";
25 |
26 | NSString *const MJRefreshBackFooterIdleText = @"MJRefreshBackFooterIdleText";
27 | NSString *const MJRefreshBackFooterPullingText = @"MJRefreshBackFooterPullingText";
28 | NSString *const MJRefreshBackFooterRefreshingText = @"MJRefreshBackFooterRefreshingText";
29 | NSString *const MJRefreshBackFooterNoMoreDataText = @"MJRefreshBackFooterNoMoreDataText";
30 |
31 | NSString *const MJRefreshHeaderLastTimeText = @"MJRefreshHeaderLastTimeText";
32 | NSString *const MJRefreshHeaderDateTodayText = @"MJRefreshHeaderDateTodayText";
33 | NSString *const MJRefreshHeaderNoneLastDateText = @"MJRefreshHeaderNoneLastDateText";
--------------------------------------------------------------------------------
/App/lib/MJRefresh/NSBundle+MJRefresh.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSBundle+MJRefresh.h
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 16/6/13.
6 | // Copyright © 2016年 小码哥. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface NSBundle (MJRefresh)
12 | + (instancetype)mj_refreshBundle;
13 | + (UIImage *)mj_arrowImage;
14 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value;
15 | + (NSString *)mj_localizedStringForKey:(NSString *)key;
16 | @end
17 |
--------------------------------------------------------------------------------
/App/lib/MJRefresh/NSBundle+MJRefresh.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSBundle+MJRefresh.m
3 | // MJRefreshExample
4 | //
5 | // Created by MJ Lee on 16/6/13.
6 | // Copyright © 2016年 小码哥. All rights reserved.
7 | //
8 |
9 | #import "NSBundle+MJRefresh.h"
10 | #import "MJRefreshComponent.h"
11 |
12 | @implementation NSBundle (MJRefresh)
13 | + (instancetype)mj_refreshBundle
14 | {
15 | static NSBundle *refreshBundle = nil;
16 | if (refreshBundle == nil) {
17 | // 这里不使用mainBundle是为了适配pod 1.x和0.x
18 | refreshBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[MJRefreshComponent class]] pathForResource:@"MJRefresh" ofType:@"bundle"]];
19 | }
20 | return refreshBundle;
21 | }
22 |
23 | + (UIImage *)mj_arrowImage
24 | {
25 | static UIImage *arrowImage = nil;
26 | if (arrowImage == nil) {
27 | arrowImage = [[UIImage imageWithContentsOfFile:[[self mj_refreshBundle] pathForResource:@"arrow@2x" ofType:@"png"]] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
28 | }
29 | return arrowImage;
30 | }
31 |
32 | + (NSString *)mj_localizedStringForKey:(NSString *)key
33 | {
34 | return [self mj_localizedStringForKey:key value:nil];
35 | }
36 |
37 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value
38 | {
39 | static NSBundle *bundle = nil;
40 | if (bundle == nil) {
41 | // (iOS获取的语言字符串比较不稳定)目前框架只处理en、zh-Hans、zh-Hant三种情况,其他按照系统默认处理
42 | NSString *language = [NSLocale preferredLanguages].firstObject;
43 | if ([language hasPrefix:@"en"]) {
44 | language = @"en";
45 | } else if ([language hasPrefix:@"zh"]) {
46 | if ([language rangeOfString:@"Hans"].location != NSNotFound) {
47 | language = @"zh-Hans"; // 简体中文
48 | } else { // zh-Hant\zh-HK\zh-TW
49 | language = @"zh-Hant"; // 繁體中文
50 | }
51 | } else {
52 | language = @"en";
53 | }
54 |
55 | // 从MJRefresh.bundle中查找资源
56 | bundle = [NSBundle bundleWithPath:[[NSBundle mj_refreshBundle] pathForResource:language ofType:@"lproj"]];
57 | }
58 | value = [bundle localizedStringForKey:key value:value table:nil];
59 | return [[NSBundle mainBundle] localizedStringForKey:key value:value table:nil];
60 | }
61 | @end
62 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/MJRefresh/UIView+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 | // UIView+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 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 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/MyPrefixHeader.pch:
--------------------------------------------------------------------------------
1 | //
2 | // MyPrefixHeader.pch
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #ifndef MyPrefixHeader_pch
13 | #define MyPrefixHeader_pch
14 |
15 | #import "MyHelper.h"
16 | #import "Factory.h"
17 | #import "UIView+Addition.h"
18 | #import "Net.h"
19 |
20 | #import "UIImageView+WebCache.h"
21 | #import "AFNetworking.h"
22 | #import "SVProgressHUD.h"
23 | #import "MJRefresh.h"
24 | #import "Networking.h"
25 |
26 | #endif /* MyPrefixHeader_pch */
27 |
--------------------------------------------------------------------------------
/App/lib/Net.h:
--------------------------------------------------------------------------------
1 | //
2 | // Net.h
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/7.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #ifndef Net_h
13 | #define Net_h
14 |
15 | // 发现
16 | #define discovery @"http://baobab.wandoujia.com/api/v3/discovery"
17 | // 类别
18 | #define categate @"http://baobab.wandoujia.com/api/v1/categories.Bak?"
19 | // 每日列表
20 | #define dailyList @"http://baobab.wandoujia.com/api/v1/feed.bak?num=%ld&date=%@"
21 | // 作者
22 | #define Author @"http://baobab.wandoujia.com/api/v3/tabs/pgcs/more?start=0&num=10"
23 | #define AuthorDetail1 @"http://baobab.wandoujia.com/api/v3/pgc/videos?_s=4667dd0eacb22bce6099c0d2c1dd5886&f=iphone&net=wifi&num=20&p_product=EYEPETIZER_IOS&pgcId="
24 | #define AuthorDetail2 @"&start=0&strategy=date&u=8141e05d14a4cabf8464f21683ad382c9df8d55e&v=2.7.0&vc=1305"
25 |
26 | #define AuthorShare1 @"http://baobab.wandoujia.com/api/v3/pgc/videos?_s=fb319be3889af5cbd86dcf3b048e9e8b&f=iphone&net=wifi&num=20&p_product=EYEPETIZER_IOS&pgcId="
27 | #define AuthorShare2 @"&start=0&strategy=shareCount&u=8141e05d14a4cabf8464f21683ad382c9df8d55e&v=2.7.0&vc=1305"
28 |
29 | // 类别内分享排行榜
30 | #define ShareTop1 @"http://baobab.wandoujia.com/api/v3/videos?_s=84dcbd31e142fd912326d4f92f25606f&categoryId="
31 | #define ShareTop2 @"&f=iphone&net=wifi&num=20&p_product=EYEPETIZER_IOS&start=0&strategy=shareCount&u=8141e05d14a4cabf8464f21683ad382c9df8d55e&v=2.7.0&vc=1305"
32 |
33 |
34 | // 专题
35 | #define ZhuanTi1 @"http://baobab.wandoujia.com/api/v3/lightTopics/"
36 | #define ZhuanTi2 @"?_s=a79330319730972fbf185bd61e331e04&f=iphone&net=wifi&p_product=EYEPETIZER_IOS&u=8141e05d14a4cabf8464f21683ad382c9df8d55e&v=2.7.0&vc=1305"
37 |
38 | // 萌宠
39 | #define MengChongUrl @"http://baobab.wandoujia.com/api/v3/videos?_s=5bd6dd795c645502b7ebbc9980c7322e&categoryId=26"
40 |
41 | // PopularUrl
42 | #define PopularUrl @"http://baobab.wandoujia.com/api/v3/ranklist?_s=70fe21a9017cd00bd7390c82ca130cd3&f=iphone&net=wifi&p_product=EYEPETIZER_IOS&strategy=weekly&u=8141e05d14a4cabf8464f21683ad382c9df8d55e&v=2.7.0&vc=1305"
43 |
44 | #define PopularMonth @"http://baobab.wandoujia.com/api/v3/ranklist?_s=ad3563d12d394bbe78b043315f670c2c&f=iphone&net=wifi&p_product=EYEPETIZER_IOS&strategy=monthly&u=8141e05d14a4cabf8464f21683ad382c9df8d55e&v=2.7.0&vc=1305"
45 |
46 | #define PopularAll @"http://baobab.wandoujia.com/api/v3/ranklist?_s=d338bb73d852e2ede36ae280f8189e25&f=iphone&net=wifi&p_product=EYEPETIZER_IOS&strategy=historical&u=8141e05d14a4cabf8464f21683ad382c9df8d55e&v=2.7.0&vc=1305"
47 |
48 | // TopUrl
49 | #define TopUrl @"http://baobab.wandoujia.com/api/v3/specialTopics?_s=44e4ee05b1f5d1efd3e30735e81230b2"
50 |
51 |
52 | #define MyChinFont @"FZLTZCHJW--GB1-0"
53 |
54 | #define MyChinFontTwo @"FZLTXIHJW--GB1-0"
55 |
56 | #define MyEnFont @"Chalkduster"
57 |
58 | #define MyEnFontTwo @"Lobster 1.4"
59 |
60 | #endif /* Net_h */
61 |
--------------------------------------------------------------------------------
/App/lib/Networking.h:
--------------------------------------------------------------------------------
1 | //
2 | // Networking.h
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import
13 | #import "AFNetworking.h"
14 |
15 | @interface Networking : NSObject
16 |
17 | // 请求成功之后回调的 Block
18 | typedef void(^SuccessBlock) (AFHTTPRequestOperation *operation, id responseObject);
19 |
20 | // 请求失败之后回调的 Block
21 | typedef void(^FailBlock) (AFHTTPRequestOperation *operation, NSError *error);
22 |
23 | // 封装Get请求方法
24 | + (void)requestDataByURL:(NSString *)URL Parameters:(NSDictionary *)parameters success:(SuccessBlock)success failBlock:(FailBlock)fail;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/App/lib/Networking.m:
--------------------------------------------------------------------------------
1 | //
2 | // Networking.m
3 | // App
4 | //
5 | // Created by CalvinCheung on 16/9/29.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 | // GitHub地址: https://github.com/CalvinCheungCoder/eyepetizer
9 | // 个人博客: http://www.zhangdinghao.cn
10 | // QQ: 984382258 欢迎一起学习交流
11 |
12 | #import "Networking.h"
13 |
14 | @implementation Networking
15 |
16 | + (AFHTTPRequestOperationManager *)initAFHttpManager {
17 | static AFHTTPRequestOperationManager *manager;
18 | static dispatch_once_t once;
19 | dispatch_once(&once, ^{
20 | manager = [[AFHTTPRequestOperationManager alloc] init];
21 | manager.responseSerializer = [AFJSONResponseSerializer serializer];
22 | manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", @"text/plain", nil];
23 | manager.operationQueue.maxConcurrentOperationCount = 1;
24 | });
25 |
26 | return manager;
27 | }
28 |
29 | +(void)requestDataByURL:(NSString *)URL Parameters:(NSDictionary *)parameters success:(SuccessBlock)success failBlock:(FailBlock)fail{
30 |
31 | AFHTTPRequestOperationManager *manager = [Networking initAFHttpManager];
32 | [manager GET:URL parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
33 | success(operation,responseObject);
34 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
35 | fail(operation,error);
36 | }];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Fabrice Aneche on 06/01/14.
3 | // Copyright (c) 2014 Dailymotion. All rights reserved.
4 | //
5 |
6 | #import
7 |
8 | @interface NSData (ImageContentType)
9 |
10 | /**
11 | * Compute the content type for an image data
12 | *
13 | * @param data the input data
14 | *
15 | * @return the content type as string (i.e. image/jpeg, image/gif)
16 | */
17 | + (NSString *)sd_contentTypeForImageData:(NSData *)data;
18 |
19 | @end
20 |
21 |
22 | @interface NSData (ImageContentTypeDeprecated)
23 |
24 | + (NSString *)contentTypeForImageData:(NSData *)data __deprecated_msg("Use `sd_contentTypeForImageData:`");
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/NSData+ImageContentType.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Fabrice Aneche on 06/01/14.
3 | // Copyright (c) 2014 Dailymotion. All rights reserved.
4 | //
5 |
6 | #import "NSData+ImageContentType.h"
7 |
8 |
9 | @implementation NSData (ImageContentType)
10 |
11 | + (NSString *)sd_contentTypeForImageData:(NSData *)data {
12 | uint8_t c;
13 | [data getBytes:&c length:1];
14 | switch (c) {
15 | case 0xFF:
16 | return @"image/jpeg";
17 | case 0x89:
18 | return @"image/png";
19 | case 0x47:
20 | return @"image/gif";
21 | case 0x49:
22 | case 0x4D:
23 | return @"image/tiff";
24 | case 0x52:
25 | // R as RIFF for WEBP
26 | if ([data length] < 12) {
27 | return nil;
28 | }
29 |
30 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding];
31 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) {
32 | return @"image/webp";
33 | }
34 |
35 | return nil;
36 | }
37 | return nil;
38 | }
39 |
40 | @end
41 |
42 |
43 | @implementation NSData (ImageContentTypeDeprecated)
44 |
45 | + (NSString *)contentTypeForImageData:(NSData *)data {
46 | return [self sd_contentTypeForImageData:data];
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/App/lib/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 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/SDWebImageCompat.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDWebImageCompat.m
3 | // SDWebImage
4 | //
5 | // Created by Olivier Poitrey on 11/12/12.
6 | // Copyright (c) 2012 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | #if !__has_feature(objc_arc)
12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag
13 | #endif
14 |
15 | inline UIImage *SDScaledImageForKey(NSString *key, UIImage *image) {
16 | if (!image) {
17 | return nil;
18 | }
19 |
20 | if ([image.images count] > 0) {
21 | NSMutableArray *scaledImages = [NSMutableArray array];
22 |
23 | for (UIImage *tempImage in image.images) {
24 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)];
25 | }
26 |
27 | return [UIImage animatedImageWithImages:scaledImages duration:image.duration];
28 | }
29 | else {
30 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
31 | CGFloat scale = 1.0;
32 | if (key.length >= 8) {
33 | // Search @2x. at the end of the string, before a 3 to 4 extension length (only if key len is 8 or more @2x. + 4 len ext)
34 | NSRange range = [key rangeOfString:@"@2x." options:0 range:NSMakeRange(key.length - 8, 5)];
35 | if (range.location != NSNotFound) {
36 | scale = 2.0;
37 | }
38 | }
39 |
40 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation];
41 | image = scaledImage;
42 | }
43 | return image;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/SDWebImageDecoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * Created by james on 9/28/11.
6 | *
7 | * For the full copyright and license information, please view the LICENSE
8 | * file that was distributed with this source code.
9 | */
10 |
11 | #import
12 | #import "SDWebImageCompat.h"
13 |
14 | @interface UIImage (ForceDecode)
15 |
16 | + (UIImage *)decodedImageWithImage:(UIImage *)image;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/SDWebImageDecoder.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * Created by james on 9/28/11.
6 | *
7 | * For the full copyright and license information, please view the LICENSE
8 | * file that was distributed with this source code.
9 | */
10 |
11 | #import "SDWebImageDecoder.h"
12 |
13 | @implementation UIImage (ForceDecode)
14 |
15 | + (UIImage *)decodedImageWithImage:(UIImage *)image {
16 | if (image.images) {
17 | // Do not decode animated images
18 | return image;
19 | }
20 |
21 | CGImageRef imageRef = image.CGImage;
22 | CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef));
23 | CGRect imageRect = (CGRect){.origin = CGPointZero, .size = imageSize};
24 |
25 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
26 | CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
27 |
28 | int infoMask = (bitmapInfo & kCGBitmapAlphaInfoMask);
29 | BOOL anyNonAlpha = (infoMask == kCGImageAlphaNone ||
30 | infoMask == kCGImageAlphaNoneSkipFirst ||
31 | infoMask == kCGImageAlphaNoneSkipLast);
32 |
33 | // CGBitmapContextCreate doesn't support kCGImageAlphaNone with RGB.
34 | // https://developer.apple.com/library/mac/#qa/qa1037/_index.html
35 | if (infoMask == kCGImageAlphaNone && CGColorSpaceGetNumberOfComponents(colorSpace) > 1) {
36 | // Unset the old alpha info.
37 | bitmapInfo &= ~kCGBitmapAlphaInfoMask;
38 |
39 | // Set noneSkipFirst.
40 | bitmapInfo |= kCGImageAlphaNoneSkipFirst;
41 | }
42 | // Some PNGs tell us they have alpha but only 3 components. Odd.
43 | else if (!anyNonAlpha && CGColorSpaceGetNumberOfComponents(colorSpace) == 3) {
44 | // Unset the old alpha info.
45 | bitmapInfo &= ~kCGBitmapAlphaInfoMask;
46 | bitmapInfo |= kCGImageAlphaPremultipliedFirst;
47 | }
48 |
49 | // It calculates the bytes-per-row based on the bitsPerComponent and width arguments.
50 | CGContextRef context = CGBitmapContextCreate(NULL,
51 | imageSize.width,
52 | imageSize.height,
53 | CGImageGetBitsPerComponent(imageRef),
54 | 0,
55 | colorSpace,
56 | bitmapInfo);
57 | CGColorSpaceRelease(colorSpace);
58 |
59 | // If failed, return undecompressed image
60 | if (!context) return image;
61 |
62 | CGContextDrawImage(context, imageRect, imageRef);
63 | CGImageRef decompressedImageRef = CGBitmapContextCreateImage(context);
64 |
65 | CGContextRelease(context);
66 |
67 | UIImage *decompressedImage = [UIImage imageWithCGImage:decompressedImageRef scale:image.scale orientation:image.imageOrientation];
68 | CGImageRelease(decompressedImageRef);
69 | return decompressedImage;
70 | }
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/App/lib/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 | * Whether the URL connection should consult the credential storage for authenticating the connection. `YES` by default.
22 | *
23 | * This is the value that is returned in the `NSURLConnectionDelegate` method `-connectionShouldUseCredentialStorage:`.
24 | */
25 | @property (nonatomic, assign) BOOL shouldUseCredentialStorage;
26 |
27 | /**
28 | * The credential used for authentication challenges in `-connection:didReceiveAuthenticationChallenge:`.
29 | *
30 | * This will be overridden by any shared credentials that exist for the username or password of the request URL, if present.
31 | */
32 | @property (nonatomic, strong) NSURLCredential *credential;
33 |
34 | /**
35 | * The SDWebImageDownloaderOptions for the receiver.
36 | */
37 | @property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options;
38 |
39 | /**
40 | * Initializes a `SDWebImageDownloaderOperation` object
41 | *
42 | * @see SDWebImageDownloaderOperation
43 | *
44 | * @param request the URL request
45 | * @param options downloader options
46 | * @param progressBlock the block executed when a new chunk of data arrives.
47 | * @note the progress block is executed on a background queue
48 | * @param completedBlock the block executed when the download is done.
49 | * @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue
50 | * @param cancelBlock the block executed if the download (operation) is cancelled
51 | *
52 | * @return the initialized instance
53 | */
54 | - (id)initWithRequest:(NSURLRequest *)request
55 | options:(SDWebImageDownloaderOptions)options
56 | progress:(SDWebImageDownloaderProgressBlock)progressBlock
57 | completed:(SDWebImageDownloaderCompletedBlock)completedBlock
58 | cancelled:(SDWebImageNoParamsBlock)cancelBlock;
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 |
11 | @protocol SDWebImageOperation
12 |
13 | - (void)cancel;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+GIF.h
3 | // LBGIFImage
4 | //
5 | // Created by Laurin Brandner on 06.01.12.
6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (GIF)
12 |
13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name;
14 |
15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data;
16 |
17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+MultiFormat.h
3 | // SDWebImage
4 | //
5 | // Created by Olivier Poitrey on 07/06/13.
6 | // Copyright (c) 2013 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (MultiFormat)
12 |
13 | + (UIImage *)sd_imageWithData:(NSData *)data;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/UIImage+MultiFormat.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+MultiFormat.m
3 | // SDWebImage
4 | //
5 | // Created by Olivier Poitrey on 07/06/13.
6 | // Copyright (c) 2013 Dailymotion. All rights reserved.
7 | //
8 |
9 | #import "UIImage+MultiFormat.h"
10 | #import "UIImage+GIF.h"
11 | #import "NSData+ImageContentType.h"
12 | #import
13 |
14 | #ifdef SD_WEBP
15 | #import "UIImage+WebP.h"
16 | #endif
17 |
18 | @implementation UIImage (MultiFormat)
19 |
20 | + (UIImage *)sd_imageWithData:(NSData *)data {
21 | UIImage *image;
22 | NSString *imageContentType = [NSData sd_contentTypeForImageData:data];
23 | if ([imageContentType isEqualToString:@"image/gif"]) {
24 | image = [UIImage sd_animatedGIFWithData:data];
25 | }
26 | #ifdef SD_WEBP
27 | else if ([imageContentType isEqualToString:@"image/webp"])
28 | {
29 | image = [UIImage sd_imageWithWebPData:data];
30 | }
31 | #endif
32 | else {
33 | image = [[UIImage alloc] initWithData:data];
34 | UIImageOrientation orientation = [self sd_imageOrientationFromImageData:data];
35 | if (orientation != UIImageOrientationUp) {
36 | image = [UIImage imageWithCGImage:image.CGImage
37 | scale:image.scale
38 | orientation:orientation];
39 | }
40 | }
41 |
42 |
43 | return image;
44 | }
45 |
46 |
47 | +(UIImageOrientation)sd_imageOrientationFromImageData:(NSData *)imageData {
48 | UIImageOrientation result = UIImageOrientationUp;
49 | CGImageSourceRef imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)imageData, NULL);
50 | if (imageSource) {
51 | CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, NULL);
52 | if (properties) {
53 | CFTypeRef val;
54 | int exifOrientation;
55 | val = CFDictionaryGetValue(properties, kCGImagePropertyOrientation);
56 | if (val) {
57 | CFNumberGetValue(val, kCFNumberIntType, &exifOrientation);
58 | result = [self sd_exifOrientationToiOSOrientation:exifOrientation];
59 | } // else - if it's not set it remains at up
60 | CFRelease((CFTypeRef) properties);
61 | } else {
62 | //NSLog(@"NO PROPERTIES, FAIL");
63 | }
64 | CFRelease(imageSource);
65 | }
66 | return result;
67 | }
68 |
69 | #pragma mark EXIF orientation tag converter
70 | // Convert an EXIF image orientation to an iOS one.
71 | // reference see here: http://sylvana.net/jpegcrop/exif_orientation.html
72 | + (UIImageOrientation) sd_exifOrientationToiOSOrientation:(int)exifOrientation {
73 | UIImageOrientation orientation = UIImageOrientationUp;
74 | switch (exifOrientation) {
75 | case 1:
76 | orientation = UIImageOrientationUp;
77 | break;
78 |
79 | case 3:
80 | orientation = UIImageOrientationDown;
81 | break;
82 |
83 | case 8:
84 | orientation = UIImageOrientationLeft;
85 | break;
86 |
87 | case 6:
88 | orientation = UIImageOrientationRight;
89 | break;
90 |
91 | case 2:
92 | orientation = UIImageOrientationUpMirrored;
93 | break;
94 |
95 | case 4:
96 | orientation = UIImageOrientationDownMirrored;
97 | break;
98 |
99 | case 5:
100 | orientation = UIImageOrientationLeftMirrored;
101 | break;
102 |
103 | case 7:
104 | orientation = UIImageOrientationRightMirrored;
105 | break;
106 | default:
107 | break;
108 | }
109 | return orientation;
110 | }
111 |
112 |
113 |
114 | @end
115 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageManager.h"
11 |
12 | @interface UIView (WebCacheOperation)
13 |
14 | /**
15 | * Set the image load operation (storage in a UIView based dictionary)
16 | *
17 | * @param operation the operation
18 | * @param key key for storing the operation
19 | */
20 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key;
21 |
22 | /**
23 | * Cancel all operations for the current UIView and key
24 | *
25 | * @param key key for identifying the operations
26 | */
27 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key;
28 |
29 | /**
30 | * Just remove the operations corresponding to the current UIView and key without cancelling them
31 | *
32 | * @param key key for identifying the operations
33 | */
34 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/App/lib/SDWebImage/UIView+WebCacheOperation.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "UIView+WebCacheOperation.h"
10 | #import "objc/runtime.h"
11 |
12 | static char loadOperationKey;
13 |
14 | @implementation UIView (WebCacheOperation)
15 |
16 | - (NSMutableDictionary *)operationDictionary {
17 | NSMutableDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey);
18 | if (operations) {
19 | return operations;
20 | }
21 | operations = [NSMutableDictionary dictionary];
22 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
23 | return operations;
24 | }
25 |
26 | - (void)sd_setImageLoadOperation:(id)operation forKey:(NSString *)key {
27 | [self sd_cancelImageLoadOperationWithKey:key];
28 | NSMutableDictionary *operationDictionary = [self operationDictionary];
29 | [operationDictionary setObject:operation forKey:key];
30 | }
31 |
32 | - (void)sd_cancelImageLoadOperationWithKey:(NSString *)key {
33 | // Cancel in progress downloader from queue
34 | NSMutableDictionary *operationDictionary = [self operationDictionary];
35 | id operations = [operationDictionary objectForKey:key];
36 | if (operations) {
37 | if ([operations isKindOfClass:[NSArray class]]) {
38 | for (id operation in operations) {
39 | if (operation) {
40 | [operation cancel];
41 | }
42 | }
43 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){
44 | [(id) operations cancel];
45 | }
46 | [operationDictionary removeObjectForKey:key];
47 | }
48 | }
49 |
50 | - (void)sd_removeImageLoadOperationWithKey:(NSString *)key {
51 | NSMutableDictionary *operationDictionary = [self operationDictionary];
52 | [operationDictionary removeObjectForKey:key];
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVIndefiniteAnimatedView.h:
--------------------------------------------------------------------------------
1 | //
2 | // SVIndefiniteAnimatedView.h
3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD
4 | //
5 | // Copyright (c) 2014-2016 Guillaume Campagna. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface SVIndefiniteAnimatedView : UIView
11 |
12 | @property (nonatomic, assign) CGFloat strokeThickness;
13 | @property (nonatomic, assign) CGFloat radius;
14 | @property (nonatomic, strong) UIColor *strokeColor;
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressAnimatedView.h:
--------------------------------------------------------------------------------
1 | //
2 | // SVProgressAnimatedView.h
3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD
4 | //
5 | // Copyright (c) 2016 Tobias Tiemerding. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface SVProgressAnimatedView : UIView
11 |
12 | @property (nonatomic, assign) CGFloat radius;
13 | @property (nonatomic, assign) CGFloat strokeThickness;
14 | @property (nonatomic, strong) UIColor *strokeColor;
15 | @property (nonatomic, assign) CGFloat strokeEnd;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressAnimatedView.m:
--------------------------------------------------------------------------------
1 | //
2 | // SVProgressAnimatedView.m
3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD
4 | //
5 | // Copyright (c) 2016 Tobias Tiemerding. All rights reserved.
6 | //
7 |
8 | #import "SVProgressAnimatedView.h"
9 |
10 | @interface SVProgressAnimatedView ()
11 |
12 | @property (nonatomic, strong) CAShapeLayer *ringAnimatedLayer;
13 |
14 | @end
15 |
16 | @implementation SVProgressAnimatedView
17 |
18 | - (void)willMoveToSuperview:(UIView*)newSuperview {
19 | if (newSuperview) {
20 | [self layoutAnimatedLayer];
21 | } else {
22 | [_ringAnimatedLayer removeFromSuperlayer];
23 | _ringAnimatedLayer = nil;
24 | }
25 | }
26 |
27 | - (void)layoutAnimatedLayer {
28 | CALayer *layer = self.ringAnimatedLayer;
29 | [self.layer addSublayer:layer];
30 |
31 | CGFloat widthDiff = CGRectGetWidth(self.bounds) - CGRectGetWidth(layer.bounds);
32 | CGFloat heightDiff = CGRectGetHeight(self.bounds) - CGRectGetHeight(layer.bounds);
33 | layer.position = CGPointMake(CGRectGetWidth(self.bounds) - CGRectGetWidth(layer.bounds) / 2 - widthDiff / 2, CGRectGetHeight(self.bounds) - CGRectGetHeight(layer.bounds) / 2 - heightDiff / 2);
34 | }
35 |
36 | - (CAShapeLayer*)ringAnimatedLayer {
37 | if(!_ringAnimatedLayer) {
38 | CGPoint arcCenter = CGPointMake(self.radius+self.strokeThickness/2+5, self.radius+self.strokeThickness/2+5);
39 | UIBezierPath* smoothedPath = [UIBezierPath bezierPathWithArcCenter:arcCenter radius:self.radius startAngle:(CGFloat)-M_PI_2 endAngle:(CGFloat) (M_PI + M_PI_2) clockwise:YES];
40 |
41 | _ringAnimatedLayer = [CAShapeLayer layer];
42 | _ringAnimatedLayer.contentsScale = [[UIScreen mainScreen] scale];
43 | _ringAnimatedLayer.frame = CGRectMake(0.0f, 0.0f, arcCenter.x*2, arcCenter.y*2);
44 | _ringAnimatedLayer.fillColor = [UIColor clearColor].CGColor;
45 | _ringAnimatedLayer.strokeColor = self.strokeColor.CGColor;
46 | _ringAnimatedLayer.lineWidth = self.strokeThickness;
47 | _ringAnimatedLayer.lineCap = kCALineCapRound;
48 | _ringAnimatedLayer.lineJoin = kCALineJoinBevel;
49 | _ringAnimatedLayer.path = smoothedPath.CGPath;
50 | }
51 | return _ringAnimatedLayer;
52 | }
53 |
54 | - (void)setFrame:(CGRect)frame {
55 | if(!CGRectEqualToRect(frame, super.frame)) {
56 | [super setFrame:frame];
57 |
58 | if(self.superview) {
59 | [self layoutAnimatedLayer];
60 | }
61 | }
62 |
63 | }
64 |
65 | - (void)setRadius:(CGFloat)radius {
66 | if(radius != _radius) {
67 | _radius = radius;
68 |
69 | [_ringAnimatedLayer removeFromSuperlayer];
70 | _ringAnimatedLayer = nil;
71 |
72 | if(self.superview) {
73 | [self layoutAnimatedLayer];
74 | }
75 | }
76 | }
77 |
78 | - (void)setStrokeColor:(UIColor*)strokeColor {
79 | _strokeColor = strokeColor;
80 | _ringAnimatedLayer.strokeColor = strokeColor.CGColor;
81 | }
82 |
83 | - (void)setStrokeThickness:(CGFloat)strokeThickness {
84 | _strokeThickness = strokeThickness;
85 | _ringAnimatedLayer.lineWidth = _strokeThickness;
86 | }
87 |
88 | - (void)setStrokeEnd:(CGFloat)strokeEnd {
89 | _strokeEnd = strokeEnd;
90 | _ringAnimatedLayer.strokeEnd = _strokeEnd;
91 | }
92 |
93 |
94 | - (CGSize)sizeThatFits:(CGSize)size {
95 | return CGSizeMake((self.radius+self.strokeThickness/2+5)*2, (self.radius+self.strokeThickness/2+5)*2);
96 | }
97 |
98 | @end
99 |
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'SVProgressHUD' target in the 'SVProgressHUD' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #endif
8 |
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/angle-mask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/angle-mask.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/angle-mask@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/angle-mask@2x.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/angle-mask@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/angle-mask@3x.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/error.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/error@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/error@2x.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/error@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/error@3x.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/info.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/info@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/info@2x.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/info@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/info@3x.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/success.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/success@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/success@2x.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVProgressHUD.bundle/success@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/lib/SVProgressHUD/SVProgressHUD.bundle/success@3x.png
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVRadialGradientLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // SVRadialGradientLayer.h
3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD
4 | //
5 | // Copyright (c) 2014-2016 Tobias Tiemerding. All rights reserved.
6 | //
7 |
8 | #import
9 |
10 | @interface SVRadialGradientLayer : CALayer
11 |
12 | @property (nonatomic) CGPoint gradientCenter;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/App/lib/SVProgressHUD/SVRadialGradientLayer.m:
--------------------------------------------------------------------------------
1 | //
2 | // SVRadialGradientLayer.m
3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD
4 | //
5 | // Copyright (c) 2014-2016 Tobias Tiemerding. All rights reserved.
6 | //
7 |
8 | #import "SVRadialGradientLayer.h"
9 |
10 | @implementation SVRadialGradientLayer
11 |
12 | - (void)drawInContext:(CGContextRef)context {
13 | size_t locationsCount = 2;
14 | CGFloat locations[2] = {0.0f, 1.0f};
15 | CGFloat colors[8] = {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.75f};
16 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
17 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount);
18 | CGColorSpaceRelease(colorSpace);
19 |
20 | float radius = MIN(self.bounds.size.width , self.bounds.size.height);
21 | CGContextDrawRadialGradient (context, gradient, self.gradientCenter, 0, self.gradientCenter, radius, kCGGradientDrawsAfterEndLocation);
22 | CGGradientRelease(gradient);
23 | }
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/UIButton+XHEnlarged.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIButton+XHEnlarged.h
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/8/19.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 | #import
10 |
11 | @interface UIButton (XHEnlarged)
12 |
13 | /**
14 | * 扩大button点击区域,4边设置相同值
15 | */
16 | @property (nonatomic, assign) CGFloat enlargedEdge;
17 |
18 | /**
19 | * 扩大button点击区域,4边分别设置
20 | */
21 | - (void)xh_setEnlargedEdgeWithTop:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/UIButton+XHEnlarged.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIButton+XHEnlarged.m
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/8/19.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 | #import "UIButton+XHEnlarged.h"
10 | #import "objc/runtime.h"
11 |
12 | static char topEdgeKey;
13 | static char leftEdgeKey;
14 | static char bottomEdgeKey;
15 | static char rightEdgeKey;
16 |
17 | @implementation UIButton (XHEnlarged)
18 |
19 | - (void)setEnlargedEdge:(CGFloat)enlargedEdge
20 | {
21 | [self xh_setEnlargedEdgeWithTop:enlargedEdge left:enlargedEdge bottom:enlargedEdge right:enlargedEdge];
22 | }
23 | - (void)xh_setEnlargedEdgeWithTop:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right
24 | {
25 | objc_setAssociatedObject(self, &topEdgeKey, [NSNumber numberWithFloat:top], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
26 | objc_setAssociatedObject(self, &leftEdgeKey, [NSNumber numberWithFloat:left], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
27 | objc_setAssociatedObject(self, &bottomEdgeKey, [NSNumber numberWithFloat:bottom], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
28 | objc_setAssociatedObject(self, &rightEdgeKey, [NSNumber numberWithFloat:right], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
29 | }
30 | -(CGFloat)enlargedEdge
31 | {
32 | return [(NSNumber *)objc_getAssociatedObject(self, &topEdgeKey) floatValue];
33 | }
34 | -(CGRect)enlargedRect
35 | {
36 | NSNumber *topEdge = objc_getAssociatedObject(self, &topEdgeKey);
37 | NSNumber *leftEdge = objc_getAssociatedObject(self, &leftEdgeKey);
38 | NSNumber *bottomEdge = objc_getAssociatedObject(self, &bottomEdgeKey);
39 | NSNumber *rightEdge = objc_getAssociatedObject(self, &rightEdgeKey);
40 |
41 | if(topEdge && leftEdge && bottomEdge && rightEdge)
42 | {
43 | CGRect enlargedRect = CGRectMake(self.bounds.origin.x-leftEdge.floatValue, self.bounds.origin.y - topEdge.floatValue, self.bounds.size.width+ leftEdge.floatValue +rightEdge.floatValue, self.bounds.size.height+topEdge.floatValue+bottomEdge.floatValue);
44 | return enlargedRect;
45 | }
46 |
47 | return self.bounds;
48 |
49 | }
50 | -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
51 | {
52 | if(self.alpha <= 0.01 || !self.userInteractionEnabled ||self.hidden)
53 | {
54 | return nil;
55 | }
56 | CGRect enlargedRect = [self enlargedRect];
57 | return CGRectContainsPoint(enlargedRect, point) ? self: nil;
58 | }
59 | @end
60 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/UIImage+XHGIF.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+XHGIF.h
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/6/13.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 |
10 | #import
11 |
12 | @interface UIImage (XHGIF)
13 |
14 | +(UIImage *)xh_animatedGIFWithData:(NSData *)data;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/UIImage+XHGIF.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+XHGIF.m
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/6/13.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 |
10 | #import "UIImage+XHGIF.h"
11 | #import
12 |
13 | @implementation UIImage (XHGIF)
14 |
15 | +(UIImage *)xh_animatedGIFWithData:(NSData *)data{
16 | if (!data) {
17 | return nil;
18 | }
19 |
20 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
21 |
22 | size_t count = CGImageSourceGetCount(source);
23 |
24 | UIImage *animatedImage;
25 |
26 | if (count <= 1) {
27 | animatedImage = [[UIImage alloc] initWithData:data];
28 | }
29 | else {
30 | NSMutableArray *images = [NSMutableArray array];
31 |
32 | NSTimeInterval duration = 0.0f;
33 |
34 | for (size_t i = 0; i < count; i++) {
35 | CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
36 |
37 | duration += [self xh_frameDurationAtIndex:i source:source];
38 |
39 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]];
40 |
41 | CGImageRelease(image);
42 | }
43 |
44 | if (!duration) {
45 | duration = (1.0f / 10.0f) * count;
46 | }
47 |
48 | animatedImage = [UIImage animatedImageWithImages:images duration:duration];
49 | }
50 |
51 | CFRelease(source);
52 |
53 | return animatedImage;
54 | }
55 |
56 | + (float)xh_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source {
57 | float frameDuration = 0.1f;
58 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
59 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
60 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary];
61 |
62 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime];
63 | if (delayTimeUnclampedProp) {
64 | frameDuration = [delayTimeUnclampedProp floatValue];
65 | }
66 | else {
67 |
68 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime];
69 | if (delayTimeProp) {
70 | frameDuration = [delayTimeProp floatValue];
71 | }
72 | }
73 |
74 | if (frameDuration < 0.011f) {
75 | frameDuration = 0.100f;
76 | }
77 |
78 | CFRelease(cfFrameProperties);
79 | return frameDuration;
80 | }
81 |
82 | @end
83 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/UIImageView+XHWebCache.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImageView+XHWebCache.h
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/6/13.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 | #import
10 | #import
11 | #import "XHWebImageDownload.h"
12 |
13 |
14 | @interface UIImageView (XHWebCache)
15 |
16 | /**
17 | * 异步加载网络图片带本地缓存
18 | *
19 | * @param url 图片url
20 | */
21 | - (void)xh_setImageWithURL:(NSURL *)url;
22 |
23 | /**
24 | * 异步加载网络图片/带本地缓存
25 | *
26 | * @param url 图片url
27 | * @param placeholder 默认图片
28 | */
29 | - (void)xh_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder;
30 |
31 | /**
32 | * 异步加载网络图片/带本地缓存
33 | *
34 | * @param url 图片url
35 | * @param placeholder 默认图片
36 | * @param completedBlock 加载完成回调
37 | */
38 | - (void)xh_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(XHWebImageCompletionBlock)completedBlock;
39 |
40 | /**
41 | * 异步加载网络图片/带本地缓存
42 | *
43 | * @param url 图片url
44 | * @param placeholder 默认图片
45 | * @param options 缓存机制
46 | * @param completedBlock 加载完成回调
47 | */
48 | - (void)xh_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(XHWebImageOptions)options completed:(XHWebImageCompletionBlock)completedBlock;
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/UIImageView+XHWebCache.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImageView+XHWebCache.m
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/6/13.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 | #import "UIImageView+XHWebCache.h"
10 |
11 | @implementation UIImageView (XHWebCache)
12 |
13 | - (void)xh_setImageWithURL:(NSURL *)url
14 | {
15 | [self xh_setImageWithURL:url placeholderImage:nil];
16 | }
17 | - (void)xh_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder
18 | {
19 | [self xh_setImageWithURL:url placeholderImage:placeholder completed:nil];
20 | }
21 | - (void)xh_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(XHWebImageCompletionBlock)completedBlock
22 | {
23 | [self xh_setImageWithURL:url placeholderImage:placeholder options:XHWebImageDefault completed:completedBlock];
24 | }
25 | - (void)xh_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(XHWebImageOptions)options completed:(XHWebImageCompletionBlock)completedBlock
26 | {
27 | if(placeholder) self.image = placeholder;
28 | if(url)
29 | {
30 | __weak __typeof(self)wself = self;
31 |
32 | [XHWebImageDownload xh_downLoadImage_asyncWithURL:url options:options completed:^(UIImage *image, NSURL *url) {
33 |
34 | if(!wself) return;
35 |
36 | wself.image = image;
37 | if(image&&completedBlock)
38 | {
39 | completedBlock(image,url);
40 | }
41 | }];
42 | }
43 | }
44 | @end
45 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/XHImageCache.h:
--------------------------------------------------------------------------------
1 | //
2 | // XHImageCache.h
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/6/13.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 | #import
10 | #import
11 |
12 | @interface XHImageCache : NSObject
13 |
14 | /**
15 | * 获取缓存图片
16 | *
17 | * @param url 图片url
18 | *
19 | * @return 图片
20 | */
21 | +(UIImage *)xh_getCacheImageWithURL:(NSURL *)url;
22 |
23 | /**
24 | * 缓存图片
25 | *
26 | * @param data imageData
27 | * @param url 图片url
28 | */
29 | +(void)xh_saveImageData:(NSData *)data imageURL:(NSURL *)url;
30 |
31 | /**
32 | * 获取缓存路径
33 | *
34 | * @return path
35 | */
36 | +(NSString *)xh_cacheImagePath;
37 |
38 | /**
39 | * check路径
40 | *
41 | * @param path 路径
42 | */
43 | +(void)xh_checkDirectory:(NSString *)path;
44 | @end
45 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/XHImageCache.m:
--------------------------------------------------------------------------------
1 | //
2 | // XHImageCache.m
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/6/13.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 | #import "XHImageCache.h"
10 | #import
11 | #import "UIImage+XHGIF.h"
12 |
13 | @implementation XHImageCache
14 |
15 | +(UIImage *)xh_getCacheImageWithURL:(NSURL *)url
16 | {
17 | if(url==nil) return nil;
18 |
19 | NSString *directoryPath = [self xh_cacheImagePath];
20 | NSString *path = [NSString stringWithFormat:@"%@/%@",
21 | directoryPath,[self xh_md5String:url.absoluteString]];
22 |
23 | NSData *data = [NSData dataWithContentsOfFile:path];
24 | return [UIImage xh_animatedGIFWithData:data];
25 | }
26 |
27 | +(void)xh_saveImageData:(NSData *)data imageURL:(NSURL *)url{
28 |
29 | NSString *path = [NSString stringWithFormat:@"%@/%@",[self xh_cacheImagePath],[self xh_md5String:url.absoluteString]];
30 | if (data) {
31 | BOOL isOk = [[NSFileManager defaultManager] createFileAtPath:path contents:data attributes:nil];
32 |
33 | if (!isOk) NSLog(@"cache file error for URL: %@", url);
34 | }
35 | }
36 | + (NSString *)xh_cacheImagePath{
37 |
38 | NSString *path =[NSHomeDirectory() stringByAppendingPathComponent:@"Library/XHLaunchAdCache"];
39 | [self xh_checkDirectory:path];
40 | return path;
41 |
42 | }
43 |
44 | +(void)xh_checkDirectory:(NSString *)path {
45 | NSFileManager *fileManager = [NSFileManager defaultManager];
46 | BOOL isDir;
47 | if (![fileManager fileExistsAtPath:path isDirectory:&isDir]) {
48 | [self xh_createBaseDirectoryAtPath:path];
49 | } else {
50 | if (!isDir) {
51 | NSError *error = nil;
52 | [fileManager removeItemAtPath:path error:&error];
53 | [self xh_createBaseDirectoryAtPath:path];
54 | }
55 | }
56 | }
57 |
58 | + (void)xh_createBaseDirectoryAtPath:(NSString *)path {
59 | __autoreleasing NSError *error = nil;
60 | [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES
61 | attributes:nil error:&error];
62 | if (error) {
63 | NSLog(@"create cache directory failed, error = %@", error);
64 | } else {
65 | NSLog(@"XHLaunchAdCachePath:%@",path);
66 | [self xh_addDoNotBackupAttribute:path];
67 | }
68 | }
69 |
70 | + (void)xh_addDoNotBackupAttribute:(NSString *)path {
71 | NSURL *url = [NSURL fileURLWithPath:path];
72 | NSError *error = nil;
73 | [url setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error];
74 | if (error) {
75 | NSLog(@"error to set do not backup attribute, error = %@", error);
76 | }
77 | }
78 | + (NSString *)xh_md5String:(NSString *)string {
79 |
80 | if(string == nil || [string length] == 0) return nil;
81 |
82 | const char *value = [string UTF8String];
83 |
84 | unsigned char outputBuffer[CC_MD5_DIGEST_LENGTH];
85 | CC_MD5(value, (CC_LONG)strlen(value), outputBuffer);
86 |
87 | NSMutableString *outputString = [[NSMutableString alloc] initWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
88 | for(NSInteger count = 0; count < CC_MD5_DIGEST_LENGTH; count++){
89 | [outputString appendFormat:@"%02x",outputBuffer[count]];
90 | }
91 | return outputString;
92 | }
93 |
94 | @end
95 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/XHLaunchAd.h:
--------------------------------------------------------------------------------
1 | //
2 | // XHLaunchAd.h
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/6/13.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 | // 特性:
10 | // 1.支持全屏/半屏广告.
11 | // 2.支持静态/动态广告.
12 | // 3.兼容iPhone和iPad.
13 | // 4.支持广告点击事件
14 | // 5.自带图片下载,缓存功能.
15 | // 6.支持设置未检测到广告数据,启动页停留时间
16 | // 7.无依赖其他第三方框架.
17 |
18 | #import
19 | #import
20 | #import "UIImageView+XHWebCache.h"
21 |
22 | /**
23 | * 定义一个weakLaunchAd
24 | */
25 | #define WEAKLAUNCHAD __weak __typeof(launchAd) weakLaunchAd = launchAd;
26 |
27 | /**
28 | * 倒计时类型
29 | */
30 | typedef NS_ENUM(NSInteger,SkipType) {
31 |
32 | SkipTypeNone = 1,//无
33 | SkipTypeTime = 2,//倒计时
34 | SkipTypeText = 3,//跳过
35 | SkipTypeTimeText = 4,//倒计时+跳过
36 |
37 | };
38 |
39 | @class XHLaunchAd;
40 |
41 | typedef void(^clickBlock)();
42 | typedef void(^setAdImageBlock)(XHLaunchAd*launchAd);
43 | typedef void(^showFinishBlock)();
44 |
45 | @interface XHLaunchAd : UIViewController
46 |
47 | /**
48 | * 未检测到广告数据,启动页停留时间(默认3s)(最小1s)
49 | * 请在向服务器请求广告数据前,设置此属性
50 | */
51 | @property (nonatomic, assign) NSInteger noDataDuration;
52 |
53 | /**
54 | * 重置广告frame
55 | */
56 | @property (nonatomic, assign) CGRect adFrame;
57 |
58 | /**
59 | * 显示启动广告
60 | *
61 | * @param frame 广告frame
62 | * @param setAdImage 设置AdImage回调
63 | * @param showFinish 广告显示完成回调
64 | */
65 | +(void)showWithAdFrame:(CGRect)frame setAdImage:(setAdImageBlock)setAdImage showFinish:(showFinishBlock)showFinish;
66 |
67 | /**
68 | * 设置广告数据
69 | *
70 | * @param imageUrl 图片url
71 | * @param duration 广告停留时间(小于等于0s,默认按5s处理)
72 | * @param skipType 跳过按钮类型
73 | * @param options 图片缓存机制
74 | * @param completedBlock 异步加载完图片回调
75 | * @param click 广告点击事件回调
76 | */
77 | - (void)setImageUrl:(NSString*)imageUrl duration:(NSInteger)duration skipType:(SkipType)skipType options:(XHWebImageOptions)options completed:(XHWebImageCompletionBlock)completedBlock click:(clickBlock)click;
78 |
79 | /**
80 | * 清除图片本地缓存
81 | */
82 | +(void)clearDiskCache;
83 |
84 | /**
85 | * 获取缓存图片占用总大小(M)
86 | */
87 | +(float)imagesCacheSize;
88 |
89 | @end
90 |
91 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/XHWebImageDownload.h:
--------------------------------------------------------------------------------
1 | //
2 | // XHWebImageDownload.h
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/6/13.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 | #import
10 | #import
11 |
12 | typedef NS_OPTIONS(NSUInteger, XHWebImageOptions) {
13 |
14 | /**
15 | * 有缓存,读取缓存,不重新加载,没缓存先加载,并缓存
16 | */
17 | XHWebImageDefault = 1 << 0,
18 |
19 | /**
20 | * 只加载,不缓存
21 | */
22 | XHWebImageOnlyLoad = 1 << 1,
23 |
24 | /**
25 | * 先读缓存,再加载刷新图片和缓存
26 | */
27 | XHWebImageRefreshCached = 1 << 2
28 |
29 | };
30 |
31 | typedef void(^XHWebImageCompletionBlock)(UIImage *image,NSURL *url);
32 |
33 | @interface XHWebImageDownload : NSObject
34 |
35 | /**
36 | * 异步下载图片
37 | *
38 | * @param url 图片URL
39 | * @param options 缓存机制
40 | * @param completedBlock 下载完成回调
41 | */
42 | +(void)xh_downLoadImage_asyncWithURL:(NSURL *)url options:(XHWebImageOptions)options completed:(XHWebImageCompletionBlock)completedBlock;
43 |
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/App/lib/XHLaunchAd/XHWebImageDownload.m:
--------------------------------------------------------------------------------
1 | //
2 | // XHWebImageDownload.m
3 | // XHLaunchAdExample
4 | //
5 | // Created by xiaohui on 16/6/13.
6 | // Copyright © 2016年 qiantou. All rights reserved.
7 | // 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
8 |
9 | #import "XHWebImageDownload.h"
10 | #import "XHImageCache.h"
11 | #import "UIImage+XHGIF.h"
12 |
13 | @implementation XHWebImageDownload
14 | +(void)xh_downLoadImage_asyncWithURL:(NSURL *)url options:(XHWebImageOptions)options completed:(XHWebImageCompletionBlock)completedBlock
15 | {
16 | if(!options) options = XHWebImageDefault;
17 | if(options&XHWebImageOnlyLoad)
18 | {
19 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
20 |
21 | UIImage *image = [self xh_downLoadImageWithURL:url];
22 |
23 | dispatch_async(dispatch_get_main_queue(), ^{
24 |
25 | if(completedBlock)
26 | {
27 | completedBlock(image,url);
28 | }
29 | });
30 | });
31 |
32 | return;
33 | }
34 | UIImage *image0 = [XHImageCache xh_getCacheImageWithURL:url];
35 | if(image0&&completedBlock)
36 | {
37 | completedBlock(image0,url);
38 |
39 | if(options&XHWebImageDefault) return;
40 | }
41 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
42 |
43 | UIImage *image = [self xh_downLoadImageAndCacheWithURL:url];
44 |
45 | dispatch_async(dispatch_get_main_queue(), ^{
46 |
47 | if(completedBlock)
48 | {
49 | completedBlock(image,url);
50 | }
51 | });
52 |
53 | });
54 | }
55 |
56 | +(UIImage *)xh_downLoadImageWithURL:(NSURL *)url{
57 |
58 | if(url==nil) return nil;
59 | NSData *data = [NSData dataWithContentsOfURL:url];
60 | return [UIImage xh_animatedGIFWithData:data];
61 |
62 | }
63 | +(UIImage *)xh_downLoadImageAndCacheWithURL:(NSURL *)url
64 | {
65 | if(url==nil) return nil;
66 | NSData *data = [NSData dataWithContentsOfURL:url];
67 | [XHImageCache xh_saveImageData:data imageURL:url];
68 | return [UIImage xh_animatedGIFWithData:data];
69 | }
70 | @end
71 |
--------------------------------------------------------------------------------
/App/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // App
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. 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 |
--------------------------------------------------------------------------------
/App/res/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/.DS_Store
--------------------------------------------------------------------------------
/App/res/FZLTXIHJW--GB1-0.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/FZLTXIHJW--GB1-0.TTF
--------------------------------------------------------------------------------
/App/res/FZLTZCHJW--GB1-0.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/FZLTZCHJW--GB1-0.TTF
--------------------------------------------------------------------------------
/App/res/Lobster.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/Lobster.ttf
--------------------------------------------------------------------------------
/App/res/Login_BKG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/Login_BKG.png
--------------------------------------------------------------------------------
/App/res/Splash_BKG.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/Splash_BKG.jpg
--------------------------------------------------------------------------------
/App/res/V+.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/V+.png
--------------------------------------------------------------------------------
/App/res/V-.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/V-.png
--------------------------------------------------------------------------------
/App/res/audio_AD_close@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/audio_AD_close@2x.png
--------------------------------------------------------------------------------
/App/res/audio_AD_close@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/audio_AD_close@3x.png
--------------------------------------------------------------------------------
/App/res/backImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/backImage@2x.png
--------------------------------------------------------------------------------
/App/res/backImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/backImage@3x.png
--------------------------------------------------------------------------------
/App/res/btn_HD_disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_HD_disabled.png
--------------------------------------------------------------------------------
/App/res/btn_HD_disabled@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_HD_disabled@2x.png
--------------------------------------------------------------------------------
/App/res/btn_HD_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_HD_normal.png
--------------------------------------------------------------------------------
/App/res/btn_HD_normal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_HD_normal@2x.png
--------------------------------------------------------------------------------
/App/res/btn_airplay_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_airplay_normal.png
--------------------------------------------------------------------------------
/App/res/btn_back_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_back_normal.png
--------------------------------------------------------------------------------
/App/res/btn_back_normal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_back_normal@2x.png
--------------------------------------------------------------------------------
/App/res/btn_backdown_normal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_backdown_normal@2x.png
--------------------------------------------------------------------------------
/App/res/btn_download_disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_download_disabled.png
--------------------------------------------------------------------------------
/App/res/btn_download_disabled@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_download_disabled@2x.png
--------------------------------------------------------------------------------
/App/res/btn_download_normal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_download_normal@2x.png
--------------------------------------------------------------------------------
/App/res/btn_next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_next.png
--------------------------------------------------------------------------------
/App/res/btn_next@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_next@2x.png
--------------------------------------------------------------------------------
/App/res/btn_next@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_next@3x.png
--------------------------------------------------------------------------------
/App/res/btn_next_iPad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_next_iPad.png
--------------------------------------------------------------------------------
/App/res/btn_next_iPad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_next_iPad@2x.png
--------------------------------------------------------------------------------
/App/res/btn_pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_pause.png
--------------------------------------------------------------------------------
/App/res/btn_pause@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_pause@2x.png
--------------------------------------------------------------------------------
/App/res/btn_pause@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_pause@3x.png
--------------------------------------------------------------------------------
/App/res/btn_pause_iPad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_pause_iPad.png
--------------------------------------------------------------------------------
/App/res/btn_pause_iPad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_pause_iPad@2x.png
--------------------------------------------------------------------------------
/App/res/btn_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_play.png
--------------------------------------------------------------------------------
/App/res/btn_play@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_play@2x.png
--------------------------------------------------------------------------------
/App/res/btn_play@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_play@3x.png
--------------------------------------------------------------------------------
/App/res/btn_play_iPad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_play_iPad.png
--------------------------------------------------------------------------------
/App/res/btn_play_iPad@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/btn_play_iPad@2x.png
--------------------------------------------------------------------------------
/App/res/collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/collect.png
--------------------------------------------------------------------------------
/App/res/collectSelete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/collectSelete.png
--------------------------------------------------------------------------------
/App/res/icon_share_n@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/icon_share_n@2x.png
--------------------------------------------------------------------------------
/App/res/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/play.png
--------------------------------------------------------------------------------
/App/res/player_handle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/player_handle.png
--------------------------------------------------------------------------------
/App/res/player_handle@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/player_handle@2x.png
--------------------------------------------------------------------------------
/App/res/shareView_friend@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/shareView_friend@2x.png
--------------------------------------------------------------------------------
/App/res/shareView_qq@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/shareView_qq@2x.png
--------------------------------------------------------------------------------
/App/res/shareView_qzone@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/shareView_qzone@2x.png
--------------------------------------------------------------------------------
/App/res/shareView_wb@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/shareView_wb@2x.png
--------------------------------------------------------------------------------
/App/res/shareView_wx@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/shareView_wx@2x.png
--------------------------------------------------------------------------------
/App/res/share_copyLink@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/share_copyLink@2x.png
--------------------------------------------------------------------------------
/App/res/share_qq@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/share_qq@2x.png
--------------------------------------------------------------------------------
/App/res/share_qq_zone@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/share_qq_zone@2x.png
--------------------------------------------------------------------------------
/App/res/share_sina_n@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/share_sina_n@2x.png
--------------------------------------------------------------------------------
/App/res/share_weixin@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/share_weixin@2x.png
--------------------------------------------------------------------------------
/App/res/share_weixin_friends@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/share_weixin_friends@2x.png
--------------------------------------------------------------------------------
/App/res/toolbar_more_n_p@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/toolbar_more_n_p@3x.png
--------------------------------------------------------------------------------
/App/res/upload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/upload.png
--------------------------------------------------------------------------------
/App/res/uploadSelete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/uploadSelete.png
--------------------------------------------------------------------------------
/App/res/white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/App/res/white.png
--------------------------------------------------------------------------------
/AppTests/AppTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppTests.m
3 | // AppTests
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation AppTests
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 |
--------------------------------------------------------------------------------
/AppTests/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 |
--------------------------------------------------------------------------------
/AppUITests/AppUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppUITests.m
3 | // AppUITests
4 | //
5 | // Created by 张丁豪 on 16/9/5.
6 | // Copyright © 2016年 张丁豪. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation AppUITests
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 |
--------------------------------------------------------------------------------
/AppUITests/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 |
--------------------------------------------------------------------------------
/AuthorDetail.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/AuthorDetail.gif
--------------------------------------------------------------------------------
/CustomerNav.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/CustomerNav.gif
--------------------------------------------------------------------------------
/Play.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/Play.gif
--------------------------------------------------------------------------------
/Share.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/Share.gif
--------------------------------------------------------------------------------
/Views.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CalvinCheungCoder/eyepetizer/919928b1ff966509f7d24633e0affdbc9af6772e/Views.gif
--------------------------------------------------------------------------------