Browse Source

no message

HF_Q 4 years ago
parent
commit
d91bb1de12
91 changed files with 5193 additions and 995 deletions
  1. 20 13
      Pods/ZFPlayer/README.md
  2. 67 38
      Pods/ZFPlayer/ZFPlayer/Classes/AVPlayer/ZFAVPlayerManager.m
  3. 10 19
      Pods/ZFPlayer/ZFPlayer/Classes/ControlView/UIImageView+ZFCache.m
  4. 3 0
      Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFLandScapeControlView.h
  5. 14 4
      Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFLandScapeControlView.m
  6. 5 3
      Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPlayerControlView.h
  7. 33 37
      Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPlayerControlView.m
  8. 3 0
      Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPortraitControlView.h
  9. 11 4
      Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPortraitControlView.m
  10. 0 5
      Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFSpeedLoadingView.m
  11. 0 5
      Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFVolumeBrightnessView.m
  12. 54 13
      Pods/ZFPlayer/ZFPlayer/Classes/Core/UIScrollView+ZFPlayer.h
  13. 183 135
      Pods/ZFPlayer/ZFPlayer/Classes/Core/UIScrollView+ZFPlayer.m
  14. 11 17
      Pods/ZFPlayer/ZFPlayer/Classes/Core/UIViewController+ZFPlayerRotation.m
  15. 35 48
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFKVOController.m
  16. 63 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFLandscapeViewController.h
  17. 125 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFLandscapeViewController.m
  18. 36 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFLandscapeWindow.h
  19. 75 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFLandscapeWindow.m
  20. 68 29
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFOrientationObserver.h
  21. 342 255
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFOrientationObserver.m
  22. 47 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPersentInteractiveTransition.h
  23. 296 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPersentInteractiveTransition.m
  24. 1 52
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayer.h
  25. 130 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerConst.h
  26. 142 23
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerController.h
  27. 269 112
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerController.m
  28. 1 1
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerGestureControl.m
  29. 1 1
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerLogManager.m
  30. 11 29
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerMediaPlayback.h
  31. 0 1
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerNotification.h
  32. 13 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerView.h
  33. 88 23
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerView.m
  34. 60 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPortraitViewController.h
  35. 231 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPortraitViewController.m
  36. 49 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPresentTransition.h
  37. 156 0
      Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPresentTransition.m
  38. 60 0
      smartRhino.xcodeproj/project.pbxproj
  39. BIN
      smartRhino.xcworkspace/xcuserdata/niuzhen.xcuserdatad/UserInterfaceState.xcuserstate
  40. 9 1
      smartRhino/AppConfig.h
  41. 6 1
      smartRhino/AppDelegate.m
  42. 3 1
      smartRhino/FwzAppConfig.h
  43. 2 2
      smartRhino/PhbAppConfig.h
  44. 2 0
      smartRhino/Project/Other/Third/Calender/NSDate+Extension.h
  45. 6 0
      smartRhino/Project/Other/Third/Calender/NSDate+Extension.m
  46. 3 1
      smartRhino/Project/Other/Third/JSONModel/JSONModel/JSONModel.m
  47. 32 29
      smartRhino/Project/Other/Third/YYKit/Model/NSObject+YYModel.h
  48. 2 0
      smartRhino/Project/Other/Util/StoryboardManager/StoryboardManager.h
  49. 8 0
      smartRhino/Project/Other/Util/StoryboardManager/StoryboardManager.m
  50. 1 2
      smartRhino/Project/VCModel/ChatMessage/Controller/ChatMsgNotice/Controller/MoveViewController.m
  51. 3 0
      smartRhino/Project/VCModel/Home/Model/HomeSubItemModel.h
  52. 22 0
      smartRhino/Project/VCModel/Home/Model/IndexAllModel.h
  53. 13 0
      smartRhino/Project/VCModel/Home/Model/IndexAllModel.m
  54. 2 2
      smartRhino/Project/VCModel/Home/OtherHomeVC/MyTDTopic/VC/TopicBook/MyTDTopicBookVC.m
  55. 6 0
      smartRhino/Project/VCModel/Home/VC/BookStore/VC/BookWCDetailVC.m
  56. 2 0
      smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeSubCell.h
  57. 12 0
      smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeSubCell.m
  58. 6 6
      smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeSubCell.xib
  59. 8 4
      smartRhino/Project/VCModel/Home/VC/BookStore/View/BookSubArticeCell.xib
  60. 17 0
      smartRhino/Project/VCModel/Home/VC/IndexSearchVC.h
  61. 220 0
      smartRhino/Project/VCModel/Home/VC/IndexSearchVC.m
  62. 18 0
      smartRhino/Project/VCModel/Home/VC/SubVC/IndexAllVC.h
  63. 188 0
      smartRhino/Project/VCModel/Home/VC/SubVC/IndexAllVC.m
  64. 19 0
      smartRhino/Project/VCModel/Home/VC/SubVC/IndexMoreVC.h
  65. 251 0
      smartRhino/Project/VCModel/Home/VC/SubVC/IndexMoreVC.m
  66. 19 0
      smartRhino/Project/VCModel/Home/VC/SubVC/IndexSubVC.h
  67. 252 0
      smartRhino/Project/VCModel/Home/VC/SubVC/IndexSubVC.m
  68. 8 4
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeGoodBookCell.xib
  69. 1 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeMusicCell.h
  70. 12 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeMusicCell.m
  71. 17 17
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeMusicCell.xib
  72. 9 1
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeSchoolCell.h
  73. 27 2
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeSchoolCell.m
  74. 106 5
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeSchoolCell.xib
  75. 18 14
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeTableViewCell.xib
  76. 2 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeTeacherCell.h
  77. 9 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeTeacherCell.m
  78. 4 3
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeTeacherCell.xib
  79. 2 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeWeiCousreCell.h
  80. 31 5
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeWeiCousreCell.m
  81. 14 10
      smartRhino/Project/VCModel/Home/VC/View/Cell/HomeWeiCousreCell.xib
  82. 28 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/IndexAllCell.h
  83. 187 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/IndexAllCell.m
  84. 104 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/IndexAllCell.xib
  85. 27 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/IndexGoodBookCell.h
  86. 53 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/IndexGoodBookCell.m
  87. 182 0
      smartRhino/Project/VCModel/Home/VC/View/Cell/IndexGoodBookCell.xib
  88. 55 0
      smartRhino/Project/VCModel/Home/VC/View/SegmentViewController.h
  89. 231 0
      smartRhino/Project/VCModel/Home/VC/View/SegmentViewController.m
  90. 203 0
      smartRhino/Project/VCModel/Home/home.storyboard
  91. 18 18
      smartRhino/Project/VCModel/common/View/CommonListCell.xib

+ 20 - 13
Pods/ZFPlayer/README.md

@@ -14,18 +14,20 @@
 
 [中文说明](https://www.jianshu.com/p/90e55deb4d51)
 
+[ZFPlayer 4.x迁移指南](https://github.com/renzifeng/ZFPlayer/wiki/ZFPlayer-4.x%E8%BF%81%E7%A7%BB%E6%8C%87%E5%8D%97)
+
+
 Before this, you used ZFPlayer, are you worried about encapsulating avplayer instead of using or modifying the source code to support other players, the control layer is not easy to customize, and so on? In order to solve these problems, I have wrote this player template, for player SDK you can conform the `ZFPlayerMediaPlayback` protocol, for control view you can conform the `ZFPlayerMediaControl` protocol, can custom the player and control view.
 
-在3.X之前,是不是在烦恼播放器SDK自定义、控制层自定义等问题。作者公司多个项目分别使用不同播放器SDK以及每个项目控制层都不一样,但是为了统一管理、统一调用,我特意写了这个播放器壳子。播放器SDK只要遵守`ZFPlayerMediaPlayback`协议,控制层只要遵守`ZFPlayerMediaControl`协议,完全可以实现自定义播放器和控制层。
 
 ![ZFPlayer思维导图](https://upload-images.jianshu.io/upload_images/635942-e99d76498cb01afb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
 
-## Requirements
+## 🔨 Requirements
 
 - iOS 7+
 - Xcode 8+
 
-## Installation
+## 📲 Installation
 
 ZFPlayer is available through [CocoaPods](https://cocoapods.org). To install it,use player template simply add the following line to your Podfile:
 
@@ -43,7 +45,6 @@ Use AVPlayer simply add the following line to your Podfile:
 ```objc
 pod 'ZFPlayer/AVPlayer', '~> 3.0'
 ```
-如果使用AVPlayer边下边播可以参考使用[KTVHTTPCache](https://github.com/ChangbaDevs/KTVHTTPCache)
 
 Use ijkplayer simply add the following line to your Podfile:
 
@@ -59,7 +60,10 @@ pod 'ZFPlayer/KSYMediaPlayer', '~> 3.0'
 ```
 [KSYMediaPlayer SDK](https://github.com/ksvc/KSYMediaPlayer_iOS) support cocoapods
 
-## Usage introduce
+
+边下边播可以参考使用[KTVHTTPCache](https://github.com/ChangbaDevs/KTVHTTPCache)
+
+## 🐒 Usage
 
 ####  ZFPlayerController
 Main classes,normal style initialization and list style initialization (tableView, collection,scrollView)
@@ -96,12 +100,12 @@ player.controlView = controlView;
 ```
 
 
-## Picture demonstration
+## 📷 Screenshots
 
 ![Picture effect](https://upload-images.jianshu.io/upload_images/635942-1b0e23b7f5eabd9e.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
 
 
-## Author
+## 👨🏻‍💻 Author
 
 - Weibo: [@任子丰](https://weibo.com/zifeng1300)
 - Email: zifeng1300@gmail.com
@@ -109,23 +113,26 @@ player.controlView = controlView;
 
 ![](https://upload-images.jianshu.io/upload_images/635942-a9fbbb2710de8eff.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
 
-## Contributors
+## ❤️ Contributors
 
 林界:https://github.com/GeekLee609
 
 
-## 寻求志同道合的小伙伴
+## 🙋🏻‍♂️🙋🏻‍♀️寻求志同道合的小伙伴
 
-- 因本人工作忙,没有太多时间去维护ZFPlayer,在此向广大框架使用者说声:非常抱歉!😞
-- 现寻求志同道合的小伙伴一起维护此框架,有兴趣的小伙伴可以[发邮件](zifeng1300@gmail.com)给我,非常感谢😊
+- 现寻求志同道合的小伙伴一起维护此框架,有兴趣的小伙伴可以[发邮件](zifeng1300@gmail.com)给我,非常感谢!
 - 如果一切OK,我将开放框架维护权限(github、pod等)
-- 目前已经找到1位小伙伴 
 
-## 打赏作者
+## 💰 打赏作者
 
 如果ZFPlayer在开发中有帮助到你、如果你需要技术支持或者你需要定制功能,都可以拼命打赏我!
 
 ![支付.jpg](https://upload-images.jianshu.io/upload_images/635942-b9b836cfbb7a5e44.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
 
 
+## 👮🏻 License
+
+ZFPlayer is available under the MIT license. See the LICENSE file for more info.
+
+
 

+ 67 - 38
Pods/ZFPlayer/ZFPlayer/Classes/AVPlayer/ZFAVPlayerManager.m

@@ -25,13 +25,16 @@
 #import "ZFAVPlayerManager.h"
 #import <UIKit/UIKit.h>
 #if __has_include(<ZFPlayer/ZFPlayer.h>)
-#import <ZFPlayer/ZFPlayer.h>
+#import <ZFPlayer/ZFKVOController.h>
+#import <ZFPlayer/ZFPlayerConst.h>
 #import <ZFPlayer/ZFReachabilityManager.h>
 #else
-#import "ZFPlayer.h"
+#import "ZFKVOController.h"
+#import "ZFPlayerConst.h"
 #import "ZFReachabilityManager.h"
 #endif
 
+
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored"-Wdeprecated-declarations"
 
@@ -44,7 +47,7 @@ static NSString *const kPlaybackBufferEmpty      = @"playbackBufferEmpty";
 static NSString *const kPlaybackLikelyToKeepUp   = @"playbackLikelyToKeepUp";
 static NSString *const kPresentationSize         = @"presentationSize";
 
-@interface ZFPlayerPresentView : ZFPlayerView
+@interface ZFPlayerPresentView : UIView
 
 @property (nonatomic, strong) AVPlayer *player;
 /// default is AVLayerVideoGravityResizeAspect.
@@ -62,14 +65,6 @@ static NSString *const kPresentationSize         = @"presentationSize";
     return (AVPlayerLayer *)self.layer;
 }
 
-- (instancetype)initWithFrame:(CGRect)frame {
-    self = [super initWithFrame:frame];
-    if (self) {
-        self.backgroundColor = [UIColor blackColor];
-    }
-    return self;
-}
-
 - (void)setPlayer:(AVPlayer *)player {
     if (player == _player) return;
     self.avLayer.player = player;
@@ -94,6 +89,7 @@ static NSString *const kPresentationSize         = @"presentationSize";
 @property (nonatomic, strong) AVPlayerLayer *playerLayer;
 @property (nonatomic, assign) BOOL isBuffering;
 @property (nonatomic, assign) BOOL isReadyToPlay;
+@property (nonatomic, strong) AVAssetImageGenerator *imageGenerator;
 
 @end
 
@@ -174,8 +170,11 @@ static NSString *const kPresentationSize         = @"presentationSize";
     self.loadState = ZFPlayerLoadStateUnknown;
     self.playState = ZFPlayerPlayStatePlayStopped;
     if (self.player.rate != 0) [self.player pause];
+    [_playerItem cancelPendingSeeks];
+    [_asset cancelLoading];
     [self.player removeTimeObserver:_timeObserver];
     [self.player replaceCurrentItemWithPlayerItem:nil];
+    self.presentationSize = CGSizeZero;
     _timeObserver = nil;
     [[NSNotificationCenter defaultCenter] removeObserver:_itemEndObserver name:AVPlayerItemDidPlayToEndTimeNotification object:self.playerItem];
     _itemEndObserver = nil;
@@ -191,15 +190,18 @@ static NSString *const kPresentationSize         = @"presentationSize";
 }
 
 - (void)replay {
-    @weakify(self)
+    @zf_weakify(self)
     [self seekToTime:0 completionHandler:^(BOOL finished) {
-        @strongify(self)
-        [self play];
+        @zf_strongify(self)
+        if (finished) {
+            [self play];
+        }
     }];
 }
 
 - (void)seekToTime:(NSTimeInterval)time completionHandler:(void (^ __nullable)(BOOL finished))completionHandler {
     if (self.totalTime > 0) {
+        [_player.currentItem cancelPendingSeeks];
         CMTime seekTime = CMTimeMake(time, 1);
         [_player seekToTime:seekTime toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero completionHandler:completionHandler];
     } else {
@@ -208,24 +210,33 @@ static NSString *const kPresentationSize         = @"presentationSize";
 }
 
 - (UIImage *)thumbnailImageAtCurrentTime {
-    AVAssetImageGenerator *imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:_asset];
-    CMTime expectedTime = _playerItem.currentTime;
+    CMTime expectedTime = self.playerItem.currentTime;
     CGImageRef cgImage = NULL;
     
-    imageGenerator.requestedTimeToleranceBefore = kCMTimeZero;
-    imageGenerator.requestedTimeToleranceAfter = kCMTimeZero;
-    cgImage = [imageGenerator copyCGImageAtTime:expectedTime actualTime:NULL error:NULL];
-    
+    self.imageGenerator.requestedTimeToleranceBefore = kCMTimeZero;
+    self.imageGenerator.requestedTimeToleranceAfter = kCMTimeZero;
+    cgImage = [self.imageGenerator copyCGImageAtTime:expectedTime actualTime:NULL error:NULL];
+
     if (!cgImage) {
-        imageGenerator.requestedTimeToleranceBefore = kCMTimePositiveInfinity;
-        imageGenerator.requestedTimeToleranceAfter = kCMTimePositiveInfinity;
-        cgImage = [imageGenerator copyCGImageAtTime:expectedTime actualTime:NULL error:NULL];
+        self.imageGenerator.requestedTimeToleranceBefore = kCMTimePositiveInfinity;
+        self.imageGenerator.requestedTimeToleranceAfter = kCMTimePositiveInfinity;
+        cgImage = [self.imageGenerator copyCGImageAtTime:expectedTime actualTime:NULL error:NULL];
     }
     
     UIImage *image = [UIImage imageWithCGImage:cgImage];
     return image;
 }
 
+- (void)thumbnailImageAtCurrentTime:(void(^)(UIImage *))handler {
+    CMTime expectedTime = self.playerItem.currentTime;
+    [self.imageGenerator generateCGImagesAsynchronouslyForTimes:@[[NSValue valueWithCMTime:expectedTime]] completionHandler:^(CMTime requestedTime, CGImageRef  _Nullable image, CMTime actualTime, AVAssetImageGeneratorResult result, NSError * _Nullable error) {
+        if (handler) {
+            UIImage *finalImage = [UIImage imageWithCGImage:image];
+            handler(finalImage);
+        }
+    }];
+}
+
 #pragma mark - private method
 
 /// Calculate buffer progress
@@ -255,17 +266,20 @@ static NSString *const kPresentationSize         = @"presentationSize";
     _asset = [AVURLAsset URLAssetWithURL:self.assetURL options:self.requestHeader];
     _playerItem = [AVPlayerItem playerItemWithAsset:_asset];
     _player = [AVPlayer playerWithPlayerItem:_playerItem];
+    _imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:_asset];
+
     [self enableAudioTracks:YES inPlayerItem:_playerItem];
     
-    ZFPlayerPresentView *presentView = (ZFPlayerPresentView *)self.view;
+    ZFPlayerPresentView *presentView = [[ZFPlayerPresentView alloc] init];
     presentView.player = _player;
+    self.view.playerView = presentView;
+
     self.scalingMode = _scalingMode;
     if (@available(iOS 9.0, *)) {
         _playerItem.canUseNetworkResourcesForLiveStreamingWhilePaused = NO;
     }
     if (@available(iOS 10.0, *)) {
         _playerItem.preferredForwardBufferDuration = 5;
-        _player.automaticallyWaitsToMinimizeStalling = NO;
     }
     [self itemObserving];
 }
@@ -329,9 +343,9 @@ static NSString *const kPresentationSize         = @"presentationSize";
                               context:nil];
     
     CMTime interval = CMTimeMakeWithSeconds(self.timeRefreshInterval > 0 ? self.timeRefreshInterval : 0.1, NSEC_PER_SEC);
-    @weakify(self)
+    @zf_weakify(self)
     _timeObserver = [self.player addPeriodicTimeObserverForInterval:interval queue:dispatch_get_main_queue() usingBlock:^(CMTime time) {
-        @strongify(self)
+        @zf_strongify(self)
         if (!self) return;
         NSArray *loadedRanges = self.playerItem.seekableTimeRanges;
         if (self.isPlaying && self.loadState == ZFPlayerLoadStateStalled) self.player.rate = self.rate;
@@ -341,7 +355,7 @@ static NSString *const kPresentationSize         = @"presentationSize";
     }];
     
     _itemEndObserver = [[NSNotificationCenter defaultCenter] addObserverForName:AVPlayerItemDidPlayToEndTimeNotification object:self.playerItem queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {
-        @strongify(self)
+        @zf_strongify(self)
         if (!self) return;
         self.playState = ZFPlayerPlayStatePlayStopped;
         if (self.playerDidToEnd) self.playerDidToEnd(self);
@@ -358,18 +372,26 @@ static NSString *const kPresentationSize         = @"presentationSize";
                     if (self.playerReadyToPlay) self.playerReadyToPlay(self, self.assetURL);
                 }
                 if (self.seekTime) {
-                    [self seekToTime:self.seekTime completionHandler:nil];
+                    if (self.shouldAutoPlay) [self.player pause];
+                    @zf_weakify(self)
+                    [self seekToTime:self.seekTime completionHandler:^(BOOL finished) {
+                        @zf_strongify(self)
+                        if (finished) {
+                            if (self.shouldAutoPlay) [self play];
+                        }
+                    }];
                     self.seekTime = 0;
+                } else {
+                    if (self.shouldAutoPlay) [self play];
                 }
-                if (self.isPlaying) [self play];
                 self.player.muted = self.muted;
                 NSArray *loadedRanges = self.playerItem.seekableTimeRanges;
                 if (loadedRanges.count > 0) {
-                    /// Fix https://github.com/renzifeng/ZFPlayer/issues/475
                     if (self.playerPlayTimeChanged) self.playerPlayTimeChanged(self, self.currentTime, self.totalTime);
                 }
             } else if (self.player.currentItem.status == AVPlayerItemStatusFailed) {
                 self.playState = ZFPlayerPlayStatePlayFailed;
+                self->_isPlaying = NO;
                 NSError *error = self.player.currentItem.error;
                 if (self.playerPlayFailed) self.playerPlayFailed(self, error);
             }
@@ -390,10 +412,7 @@ static NSString *const kPresentationSize         = @"presentationSize";
             self->_bufferTime = bufferTime;
             if (self.playerBufferTimeChanged) self.playerBufferTimeChanged(self, bufferTime);
         } else if ([keyPath isEqualToString:kPresentationSize]) {
-            self->_presentationSize = self.playerItem.presentationSize;
-            if (self.presentationSizeChanged) {
-                self.presentationSizeChanged(self, self->_presentationSize);
-            }
+            self.presentationSize = self.playerItem.presentationSize;
         } else {
             [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
         }
@@ -402,9 +421,10 @@ static NSString *const kPresentationSize         = @"presentationSize";
 
 #pragma mark - getter
 
-- (UIView *)view {
+- (ZFPlayerView *)view {
     if (!_view) {
-        _view = [[ZFPlayerPresentView alloc] init];
+        ZFPlayerView *view = [[ZFPlayerView alloc] init];
+        _view = view;
     }
     return _view;
 }
@@ -461,7 +481,8 @@ static NSString *const kPresentationSize         = @"presentationSize";
 
 - (void)setScalingMode:(ZFPlayerScalingMode)scalingMode {
     _scalingMode = scalingMode;
-    ZFPlayerPresentView *presentView = (ZFPlayerPresentView *)self.view;
+    ZFPlayerPresentView *presentView = (ZFPlayerPresentView *)self.view.playerView;
+    self.view.scalingMode = scalingMode;
     switch (scalingMode) {
         case ZFPlayerScalingModeNone:
             presentView.videoGravity = AVLayerVideoGravityResizeAspect;
@@ -485,6 +506,14 @@ static NSString *const kPresentationSize         = @"presentationSize";
     self.player.volume = volume;
 }
 
+- (void)setPresentationSize:(CGSize)presentationSize {
+    _presentationSize = presentationSize;
+    self.view.presentationSize = presentationSize;
+    if (self.presentationSizeChanged) {
+        self.presentationSizeChanged(self, self.presentationSize);
+    }
+}
+
 @end
 
 #pragma clang diagnostic pop

+ 10 - 19
Pods/ZFPlayer/ZFPlayer/Classes/ControlView/UIImageView+ZFCache.m

@@ -98,7 +98,7 @@
 
 @implementation NSString (md5)
 
-+ (NSString *)zf_keyForRequest:(NSURLRequest *)request{
++ (NSString *)zf_keyForRequest:(NSURLRequest *)request {
     return request.URL.absoluteString;
 }
 
@@ -159,8 +159,7 @@
     if ([[NSFileManager defaultManager] fileExistsAtPath:directoryPath isDirectory:nil]) {
         dispatch_queue_t ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL);
         dispatch_async(ioQueue, ^{
-            NSError *error = nil;
-            [[NSFileManager defaultManager] removeItemAtPath:directoryPath error:&error];
+            [[NSFileManager defaultManager] removeItemAtPath:directoryPath error:nil];
             [[NSFileManager defaultManager] createDirectoryAtPath:directoryPath
                                       withIntermediateDirectories:YES
                                                        attributes:nil
@@ -227,47 +226,39 @@
 
 #pragma mark - getter
 
-- (ZFImageBlock)completion
-{
+- (ZFImageBlock)completion {
     return objc_getAssociatedObject(self, _cmd);
 }
 
-- (ZFImageDownloader *)imageDownloader
-{
+- (ZFImageDownloader *)imageDownloader {
     return objc_getAssociatedObject(self, _cmd);
 }
 
-- (NSUInteger)attemptToReloadTimesForFailedURL
-{
+- (NSUInteger)attemptToReloadTimesForFailedURL {
     NSUInteger count = [objc_getAssociatedObject(self, _cmd) integerValue];
     if (count == 0) {  count = 2; }
     return count;
 }
 
-- (BOOL)shouldAutoClipImageToViewSize
-{
+- (BOOL)shouldAutoClipImageToViewSize {
     return [objc_getAssociatedObject(self, _cmd) boolValue];
 }
 
 #pragma mark - setter
 
-- (void)setCompletion:(ZFImageBlock)completion
-{
+- (void)setCompletion:(ZFImageBlock)completion {
     objc_setAssociatedObject(self, @selector(completion), completion, OBJC_ASSOCIATION_COPY_NONATOMIC);
 }
 
-- (void)setImageDownloader:(ZFImageDownloader *)imageDownloader
-{
+- (void)setImageDownloader:(ZFImageDownloader *)imageDownloader {
     objc_setAssociatedObject(self, @selector(imageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
 }
 
-- (void)setAttemptToReloadTimesForFailedURL:(NSUInteger)attemptToReloadTimesForFailedURL
-{
+- (void)setAttemptToReloadTimesForFailedURL:(NSUInteger)attemptToReloadTimesForFailedURL {
     objc_setAssociatedObject(self, @selector(attemptToReloadTimesForFailedURL), @(attemptToReloadTimesForFailedURL), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
 }
 
-- (void)setShouldAutoClipImageToViewSize:(BOOL)shouldAutoClipImageToViewSize
-{
+- (void)setShouldAutoClipImageToViewSize:(BOOL)shouldAutoClipImageToViewSize {
     objc_setAssociatedObject(self, @selector(shouldAutoClipImageToViewSize), @(shouldAutoClipImageToViewSize), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
 }
 

+ 3 - 0
Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFLandScapeControlView.h

@@ -76,6 +76,9 @@ NS_ASSUME_NONNULL_BEGIN
 /// 如果是暂停状态,seek完是否播放,默认YES
 @property (nonatomic, assign) BOOL seekToPlay;
 
+/// 全屏模式
+@property (nonatomic, assign) ZFFullScreenMode fullScreenMode;
+
 /// 重置控制层
 - (void)resetControlView;
 

+ 14 - 4
Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFLandScapeControlView.m

@@ -26,9 +26,9 @@
 #import "UIView+ZFFrame.h"
 #import "ZFUtilities.h"
 #if __has_include(<ZFPlayer/ZFPlayer.h>)
-#import <ZFPlayer/ZFPlayer.h>
+#import <ZFPlayer/ZFPlayerConst.h>
 #else
-#import "ZFPlayer.h"
+#import "ZFPlayerConst.h"
 #endif
 
 @interface ZFLandScapeControlView () <ZFSliderViewDelegate>
@@ -161,7 +161,9 @@
     if (!self.isShow) {
         self.topToolView.zf_y = -self.topToolView.zf_height;
         self.bottomToolView.zf_y = self.zf_height;
+        self.lockBtn.zf_left = iPhoneX ? -82: -47;
     } else {
+        self.lockBtn.zf_left = iPhoneX ? 50: 18;
         if (self.player.isLockedScreen) {
             self.topToolView.zf_y = -self.topToolView.zf_height;
             self.bottomToolView.zf_y = self.zf_height;
@@ -226,9 +228,9 @@
     if (self.player.totalTime > 0) {
         self.slider.isdragging = YES;
         if (self.sliderValueChanging) self.sliderValueChanging(value, self.slider.isForward);
-        @weakify(self)
+        @zf_weakify(self)
         [self.player seekToTime:self.player.totalTime*value completionHandler:^(BOOL finished) {
-            @strongify(self)
+            @zf_strongify(self)
             if (finished) {
                 self.slider.isdragging = NO;
                 if (self.sliderValueChanged) self.sliderValueChanged(value);
@@ -361,6 +363,14 @@
     }];
 }
 
+#pragma mark - setter
+
+- (void)setFullScreenMode:(ZFFullScreenMode)fullScreenMode {
+    _fullScreenMode = fullScreenMode;
+    self.player.orientationObserver.fullScreenMode = fullScreenMode;
+    self.lockBtn.hidden = fullScreenMode == ZFFullScreenModePortrait;
+}
+
 #pragma mark - getter
 
 - (UIView *)topToolView {

+ 5 - 3
Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPlayerControlView.h

@@ -80,9 +80,6 @@
 /// 视频之外区域是否高斯模糊显示,默认YES.
 @property (nonatomic, assign) BOOL effectViewShow;
 
-/// 直接进入全屏模式,只支持全屏模式
-@property (nonatomic, assign) BOOL fullScreenOnly;
-
 /// 如果是暂停状态,seek完是否播放,默认YES
 @property (nonatomic, assign) BOOL seekToPlay;
 
@@ -113,6 +110,9 @@
 /// 是否自定义禁止pan手势,默认 NO.
 @property (nonatomic, assign) BOOL customDisablePanMovingDirection;
 
+/// 全屏模式
+@property (nonatomic, assign) ZFFullScreenMode fullScreenMode;
+
 /**
  设置标题、封面、全屏模式
 
@@ -141,6 +141,8 @@
  */
 - (void)showTitle:(NSString *)title coverImage:(UIImage *)image fullScreenMode:(ZFFullScreenMode)fullScreenMode;
 
+//- (void)showFullScreen
+
 /**
  重置控制层
  */

+ 33 - 37
Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPlayerControlView.m

@@ -32,11 +32,12 @@
 #import <MediaPlayer/MediaPlayer.h>
 #import "ZFVolumeBrightnessView.h"
 #if __has_include(<ZFPlayer/ZFPlayer.h>)
-#import <ZFPlayer/ZFPlayer.h>
+#import <ZFPlayer/ZFPlayerConst.h>
 #else
-#import "ZFPlayer.h"
+#import "ZFPlayerConst.h"
 #endif
 
+
 @interface ZFPlayerControlView () <ZFSliderViewDelegate>
 /// 竖屏控制层的View
 @property (nonatomic, strong) ZFPortraitControlView *portraitControlView;
@@ -56,8 +57,6 @@
 @property (nonatomic, strong) UIButton *failBtn;
 /// 底部播放进度
 @property (nonatomic, strong) ZFSliderView *bottomPgrogress;
-/// 封面图
-@property (nonatomic, strong) UIImageView *coverImageView;
 /// 是否显示了控制层
 @property (nonatomic, assign, getter=isShowing) BOOL showing;
 /// 是否播放结束
@@ -109,7 +108,7 @@
     CGFloat min_h = 0;
     CGFloat min_view_w = self.zf_width;
     CGFloat min_view_h = self.zf_height;
-    
+
     self.portraitControlView.frame = self.bounds;
     self.landScapeControlView.frame = self.bounds;
     self.floatControlView.frame = self.bounds;
@@ -188,9 +187,9 @@
 - (void)autoFadeOutControlView {
     self.controlViewAppeared = YES;
     [self cancelAutoFadeOutControlView];
-    @weakify(self)
+    @zf_weakify(self)
     self.afterBlock = dispatch_block_create(0, ^{
-        @strongify(self)
+        @zf_strongify(self)
         [self hideControlViewWithAnimated:YES];
     });
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.autoHiddenTimeInterval * NSEC_PER_SEC)), dispatch_get_main_queue(),self.afterBlock);
@@ -291,7 +290,8 @@
     [self setNeedsDisplay];
     [self.portraitControlView showTitle:title fullScreenMode:fullScreenMode];
     [self.landScapeControlView showTitle:title fullScreenMode:fullScreenMode];
-    [self.coverImageView setImageWithURLString:coverUrl placeholder:placeholder];
+    /// 这里直接设置播放器视图里的coverImageView
+    [self.player.currentPlayerManager.view.coverImageView setImageWithURLString:coverUrl placeholder:placeholder];
     [self.bgImgView setImageWithURLString:coverUrl placeholder:placeholder];
     if (self.prepareShowControlView) {
         [self showControlViewWithAnimated:NO];
@@ -404,16 +404,18 @@
 
 /// 滑动结束手势事件
 - (void)gestureEndedPan:(ZFPlayerGestureControl *)gestureControl panDirection:(ZFPanDirection)direction panLocation:(ZFPanLocation)location {
-    @weakify(self)
+    @zf_weakify(self)
     if (direction == ZFPanDirectionH && self.sumTime >= 0 && self.player.totalTime > 0) {
         [self.player seekToTime:self.sumTime completionHandler:^(BOOL finished) {
-            @strongify(self)
-            /// 左右滑动调节播放进度
-            [self.portraitControlView sliderChangeEnded];
-            [self.landScapeControlView sliderChangeEnded];
-            self.bottomPgrogress.isdragging = NO;
-            if (self.controlViewAppeared) {
-                [self autoFadeOutControlView];
+            if (finished) {
+                @zf_strongify(self)
+                /// 左右滑动调节播放进度
+                [self.portraitControlView sliderChangeEnded];
+                [self.landScapeControlView sliderChangeEnded];
+                self.bottomPgrogress.isdragging = NO;
+                if (self.controlViewAppeared) {
+                    [self autoFadeOutControlView];
+                }
             }
         }];
         if (self.seekToPlay) {
@@ -625,13 +627,9 @@
     /// 解决播放时候黑屏闪一下问题
     [player.currentPlayerManager.view insertSubview:self.bgImgView atIndex:0];
     [self.bgImgView addSubview:self.effectView];
-    [player.currentPlayerManager.view insertSubview:self.coverImageView atIndex:1];
-    self.coverImageView.frame = player.currentPlayerManager.view.bounds;
-    self.coverImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     self.bgImgView.frame = player.currentPlayerManager.view.bounds;
     self.bgImgView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     self.effectView.frame = self.bgImgView.bounds;
-    self.coverImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
 }
 
 - (void)setSeekToPlay:(BOOL)seekToPlay {
@@ -649,6 +647,13 @@
     }
 }
 
+- (void)setFullScreenMode:(ZFFullScreenMode)fullScreenMode {
+    _fullScreenMode = fullScreenMode;
+    self.portraitControlView.fullScreenMode = fullScreenMode;
+    self.landScapeControlView.fullScreenMode = fullScreenMode;
+    self.player.orientationObserver.fullScreenMode = fullScreenMode;
+}
+
 #pragma mark - getter
 
 - (UIImageView *)bgImgView {
@@ -675,10 +680,10 @@
 
 - (ZFPortraitControlView *)portraitControlView {
     if (!_portraitControlView) {
-        @weakify(self)
+        @zf_weakify(self)
         _portraitControlView = [[ZFPortraitControlView alloc] init];
         _portraitControlView.sliderValueChanging = ^(CGFloat value, BOOL forward) {
-            @strongify(self)
+            @zf_strongify(self)
             NSString *draggedTime = [ZFUtilities convertTimeSecond:self.player.totalTime*value];
             /// 更新滑杆和时间
             [self.landScapeControlView sliderValueChanged:value currentTimeString:draggedTime];
@@ -688,7 +693,7 @@
             [self cancelAutoFadeOutControlView];
         };
         _portraitControlView.sliderValueChanged = ^(CGFloat value) {
-            @strongify(self)
+            @zf_strongify(self)
             [self.landScapeControlView sliderChangeEnded];
             self.fastProgressView.value = value;
             self.bottomPgrogress.isdragging = NO;
@@ -701,10 +706,10 @@
 
 - (ZFLandScapeControlView *)landScapeControlView {
     if (!_landScapeControlView) {
-        @weakify(self)
+        @zf_weakify(self)
         _landScapeControlView = [[ZFLandScapeControlView alloc] init];
         _landScapeControlView.sliderValueChanging = ^(CGFloat value, BOOL forward) {
-            @strongify(self)
+            @zf_strongify(self)
             NSString *draggedTime = [ZFUtilities convertTimeSecond:self.player.totalTime*value];
             /// 更新滑杆和时间
             [self.portraitControlView sliderValueChanged:value currentTimeString:draggedTime];
@@ -714,7 +719,7 @@
             [self cancelAutoFadeOutControlView];
         };
         _landScapeControlView.sliderValueChanged = ^(CGFloat value) {
-            @strongify(self)
+            @zf_strongify(self)
             [self.portraitControlView sliderChangeEnded];
             self.fastProgressView.value = value;
             self.bottomPgrogress.isdragging = NO;
@@ -797,21 +802,12 @@
     return _bottomPgrogress;
 }
 
-- (UIImageView *)coverImageView {
-    if (!_coverImageView) {
-        _coverImageView = [[UIImageView alloc] init];
-        _coverImageView.userInteractionEnabled = YES;
-        _coverImageView.contentMode = UIViewContentModeScaleAspectFit;
-    }
-    return _coverImageView;
-}
-
 - (ZFSmallFloatControlView *)floatControlView {
     if (!_floatControlView) {
         _floatControlView = [[ZFSmallFloatControlView alloc] init];
-        @weakify(self)
+        @zf_weakify(self)
         _floatControlView.closeClickCallback = ^{
-            @strongify(self)
+            @zf_strongify(self)
             if (self.player.containerType == ZFPlayerContainerTypeCell) {
                 [self.player stopCurrentPlayingCell];
             } else if (self.player.containerType == ZFPlayerContainerTypeView) {

+ 3 - 0
Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPortraitControlView.h

@@ -70,6 +70,9 @@ NS_ASSUME_NONNULL_BEGIN
 /// 如果是暂停状态,seek完是否播放,默认YES
 @property (nonatomic, assign) BOOL seekToPlay;
 
+/// 全屏模式
+@property (nonatomic, assign) ZFFullScreenMode fullScreenMode;
+
 /// 重置控制层
 - (void)resetControlView;
 

+ 11 - 4
Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFPortraitControlView.m

@@ -26,9 +26,9 @@
 #import "UIView+ZFFrame.h"
 #import "ZFUtilities.h"
 #if __has_include(<ZFPlayer/ZFPlayer.h>)
-#import <ZFPlayer/ZFPlayer.h>
+#import <ZFPlayer/ZFPlayerConst.h>
 #else
-#import "ZFPlayer.h"
+#import "ZFPlayerConst.h"
 #endif
 
 @interface ZFPortraitControlView () <ZFSliderViewDelegate>
@@ -185,9 +185,9 @@
     if (self.player.totalTime > 0) {
         self.slider.isdragging = YES;
         if (self.sliderValueChanging) self.sliderValueChanging(value, self.slider.isForward);
-        @weakify(self)
+        @zf_weakify(self)
         [self.player seekToTime:self.player.totalTime*value completionHandler:^(BOOL finished) {
-            @strongify(self)
+            @zf_strongify(self)
             if (finished) {
                 self.slider.isdragging = NO;
                 if (self.sliderValueChanged) self.sliderValueChanged(value);
@@ -298,6 +298,13 @@
     }];
 }
 
+#pragma mark - setter
+
+- (void)setFullScreenMode:(ZFFullScreenMode)fullScreenMode {
+    _fullScreenMode = fullScreenMode;
+    self.player.orientationObserver.fullScreenMode = fullScreenMode;
+}
+
 #pragma mark - getter
 
 - (UIView *)topToolView {

+ 0 - 5
Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFSpeedLoadingView.m

@@ -8,11 +8,6 @@
 #import "ZFSpeedLoadingView.h"
 #import "ZFNetworkSpeedMonitor.h"
 #import "UIView+ZFFrame.h"
-#if __has_include(<ZFPlayer/ZFPlayer.h>)
-#import <ZFPlayer/ZFPlayer.h>
-#else
-#import "ZFPlayer.h"
-#endif
 
 @interface ZFSpeedLoadingView ()
 

+ 0 - 5
Pods/ZFPlayer/ZFPlayer/Classes/ControlView/ZFVolumeBrightnessView.m

@@ -25,11 +25,6 @@
 #import "ZFVolumeBrightnessView.h"
 #import <MediaPlayer/MediaPlayer.h>
 #import "ZFUtilities.h"
-#if __has_include(<ZFPlayer/ZFPlayer.h>)
-#import <ZFPlayer/ZFPlayer.h>
-#else
-#import "ZFPlayer.h"
-#endif
 
 @interface ZFVolumeBrightnessView ()
 

+ 54 - 13
Pods/ZFPlayer/ZFPlayer/Classes/Core/UIScrollView+ZFPlayer.h

@@ -53,6 +53,19 @@ typedef NS_ENUM(NSInteger, ZFPlayerContainerType) {
     ZFPlayerContainerTypeCell
 };
 
+typedef NS_ENUM(NSInteger , ZFPlayerScrollViewScrollPosition) {
+    ZFPlayerScrollViewScrollPositionNone,
+    /// Apply to UITableView and UICollectionViewDirection is vertical scrolling.
+    ZFPlayerScrollViewScrollPositionTop,
+    ZFPlayerScrollViewScrollPositionCenteredVertically,
+    ZFPlayerScrollViewScrollPositionBottom,
+    
+    /// Only apply to UICollectionViewDirection is horizontal scrolling.
+    ZFPlayerScrollViewScrollPositionLeft,
+    ZFPlayerScrollViewScrollPositionCenteredHorizontally,
+    ZFPlayerScrollViewScrollPositionRight
+};
+
 @interface UIScrollView (ZFPlayer)
 
 /// When the ZFPlayerScrollViewDirection is ZFPlayerScrollViewDirectionVertical,the property has value.
@@ -66,7 +79,7 @@ typedef NS_ENUM(NSInteger, ZFPlayerContainerType) {
 
 /// The scroll direction of scrollView while scrolling.
 /// When the ZFPlayerScrollViewDirection is ZFPlayerScrollViewDirectionVertical,this value can only be ZFPlayerScrollDirectionUp or ZFPlayerScrollDirectionDown.
-/// When the ZFPlayerScrollViewDirection is ZFPlayerScrollViewDirectionVertical,this value can only be ZFPlayerScrollDirectionLeft or ZFPlayerScrollDirectionRight.
+/// When the ZFPlayerScrollViewDirection is ZFPlayerScrollViewDirectionHorizontal,this value can only be ZFPlayerScrollDirectionLeft or ZFPlayerScrollDirectionRight.
 @property (nonatomic, readonly) ZFPlayerScrollDirection zf_scrollDirection;
 
 /// Get the cell according to indexPath.
@@ -75,16 +88,31 @@ typedef NS_ENUM(NSInteger, ZFPlayerContainerType) {
 /// Get the indexPath for cell.
 - (NSIndexPath *)zf_getIndexPathForCell:(UIView *)cell;
 
-/// Scroll to indexPath with animations.
-- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath completionHandler:(void (^ __nullable)(void))completionHandler;
-
-/// add in 3.2.4 version.
-/// Scroll to indexPath with animations.
-- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated completionHandler:(void (^ __nullable)(void))completionHandler;
-
-/// add in 3.2.8 version.
-/// Scroll to indexPath with animations duration.
-- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath animateWithDuration:(NSTimeInterval)duration completionHandler:(void (^ __nullable)(void))completionHandler;
+/**
+Scroll to indexPath with position.
+ 
+@param indexPath scroll the  indexPath.
+@param scrollPosition  scrollView scroll position.
+@param animated animate.
+@param completionHandler  Scroll completion callback.
+*/
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath
+                 atScrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                         animated:(BOOL)animated
+                completionHandler:(void (^ __nullable)(void))completionHandler;
+
+/**
+Scroll to indexPath with position.
+ 
+@param indexPath scroll the  indexPath.
+@param scrollPosition  scrollView scroll position.
+@param duration animate duration.
+@param completionHandler  Scroll completion callback.
+*/
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath
+                 atScrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                  animateDuration:(NSTimeInterval)duration
+                completionHandler:(void (^ __nullable)(void))completionHandler;
 
 ///------------------------------------
 /// The following method must be implemented in UIScrollViewDelegate.
@@ -177,11 +205,9 @@ typedef NS_ENUM(NSInteger, ZFPlayerContainerType) {
 /// The video contrainerView in normal model.
 @property (nonatomic, strong) UIView *zf_containerView;
 
-
 /// The video contrainerView type.
 @property (nonatomic, assign) ZFPlayerContainerType zf_containerType;
 
-
 /// Filter the cell that should be played when the scroll is stopped (to play when the scroll is stopped).
 - (void)zf_filterShouldPlayCellWhileScrolled:(void (^ __nullable)(NSIndexPath *indexPath))handler;
 
@@ -198,6 +224,21 @@ typedef NS_ENUM(NSInteger, ZFPlayerContainerType) {
 /// The block invoked When the player should play.
 @property (nonatomic, copy, nullable) void(^zf_shouldPlayIndexPathCallback)(NSIndexPath *indexPath) __attribute__((deprecated("use `ZFPlayerController.zf_playerShouldPlayInScrollView` instead.")));
 
+
+/// Scroll to indexPath position  `ZFPlayerScrollViewScrollPositionTop` with animations.
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath
+                completionHandler:(void (^ __nullable)(void))completionHandler __attribute__((deprecated("use `zf_scrollToRowAtIndexPath:atScrollPosition:animated:completionHandler:` instead.")));
+
+/// Scroll to indexPath position  `ZFPlayerScrollViewScrollPositionTop` with animations.
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath
+                         animated:(BOOL)animated
+                completionHandler:(void (^ __nullable)(void))completionHandler __attribute__((deprecated("use `zf_scrollToRowAtIndexPath:atScrollPosition:animated:completionHandler:` instead.")));
+
+/// Scroll to indexPath position  `ZFPlayerScrollViewScrollPositionTop` with animations.
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath
+              animateWithDuration:(NSTimeInterval)duration
+                completionHandler:(void (^ __nullable)(void))completionHandler __attribute__((deprecated("use `zf_scrollToRowAtIndexPath:atScrollPosition:animateDuration:completionHandler:` instead.")));
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 183 - 135
Pods/ZFPlayer/ZFPlayer/Classes/Core/UIScrollView+ZFPlayer.m

@@ -25,7 +25,7 @@
 #import "UIScrollView+ZFPlayer.h"
 #import <objc/runtime.h>
 #import "ZFReachabilityManager.h"
-#import "ZFPlayer.h"
+#import "ZFPlayerConst.h"
 
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored"-Wdeprecated-declarations"
@@ -40,42 +40,149 @@
 
 @implementation UIScrollView (ZFPlayer)
 
-+ (void)load {
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        SEL selectors[] = {
-            @selector(setContentOffset:)
-        };
-        
-        for (NSInteger index = 0; index < sizeof(selectors) / sizeof(SEL); ++index) {
-            SEL originalSelector = selectors[index];
-            SEL swizzledSelector = NSSelectorFromString([@"zf_" stringByAppendingString:NSStringFromSelector(originalSelector)]);
-            Method originalMethod = class_getInstanceMethod(self, originalSelector);
-            Method swizzledMethod = class_getInstanceMethod(self, swizzledSelector);
-            if (class_addMethod(self, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) {
-                class_replaceMethod(self, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
-            } else {
-                method_exchangeImplementations(originalMethod, swizzledMethod);
+#pragma mark - public method
+
+- (UIView *)zf_getCellForIndexPath:(NSIndexPath *)indexPath {
+    if ([self _isTableView]) {
+        UITableView *tableView = (UITableView *)self;
+        UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
+        return cell;
+    } else if ([self _isCollectionView]) {
+        UICollectionView *collectionView = (UICollectionView *)self;
+        UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
+        return cell;
+    }
+    return nil;
+}
+
+- (NSIndexPath *)zf_getIndexPathForCell:(UIView *)cell {
+    if ([self _isTableView]) {
+        UITableView *tableView = (UITableView *)self;
+        NSIndexPath *indexPath = [tableView indexPathForCell:(UITableViewCell *)cell];
+        return indexPath;
+    } else if ([self _isCollectionView]) {
+        UICollectionView *collectionView = (UICollectionView *)self;
+        NSIndexPath *indexPath = [collectionView indexPathForCell:(UICollectionViewCell *)cell];
+        return indexPath;
+    }
+    return nil;
+}
+
+/**
+Scroll to indexPath with position.
+ 
+@param indexPath scroll the  indexPath.
+@param scrollPosition  scrollView scroll position.
+@param animated animate.
+@param completionHandler  Scroll completion callback.
+*/
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath
+                 atScrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                         animated:(BOOL)animated
+                completionHandler:(void (^ __nullable)(void))completionHandler {
+    [self zf_scrollToRowAtIndexPath:indexPath atScrollPosition:scrollPosition animateDuration:animated ? 0.4 : 0.0 completionHandler:completionHandler];
+}
+
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath
+                 atScrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                  animateDuration:(NSTimeInterval)duration
+                completionHandler:(void (^ __nullable)(void))completionHandler {
+    BOOL animated = duration > 0.0;
+    if ([self _isTableView]) {
+        UITableView *tableView = (UITableView *)self;
+        UITableViewScrollPosition tableScrollPosition = UITableViewScrollPositionNone;
+        if (scrollPosition <= ZFPlayerScrollViewScrollPositionBottom) {
+            tableScrollPosition = (UITableViewScrollPosition)scrollPosition;
+        }
+        [tableView scrollToRowAtIndexPath:indexPath atScrollPosition:tableScrollPosition animated:animated];
+    } else if ([self _isCollectionView]) {
+        UICollectionView *collectionView = (UICollectionView *)self;
+        if (self.zf_scrollViewDirection == ZFPlayerScrollViewDirectionVertical) {
+            UICollectionViewScrollPosition collectionScrollPosition = UICollectionViewScrollPositionNone;
+            switch (scrollPosition) {
+                case ZFPlayerScrollViewScrollPositionNone:
+                    collectionScrollPosition = UICollectionViewScrollPositionNone;
+                    break;
+                case ZFPlayerScrollViewScrollPositionTop:
+                    collectionScrollPosition = UICollectionViewScrollPositionTop;
+                    break;
+                case ZFPlayerScrollViewScrollPositionCenteredVertically:
+                    collectionScrollPosition = UICollectionViewScrollPositionCenteredVertically;
+                    break;
+                case ZFPlayerScrollViewScrollPositionBottom:
+                    collectionScrollPosition = UICollectionViewScrollPositionBottom;
+                    break;
+                default:
+                    break;
             }
+            [collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:collectionScrollPosition animated:animated];
+        } else if (self.zf_scrollViewDirection == ZFPlayerScrollViewDirectionHorizontal) {
+            UICollectionViewScrollPosition collectionScrollPosition = UICollectionViewScrollPositionNone;
+            switch (scrollPosition) {
+                case ZFPlayerScrollViewScrollPositionNone:
+                    collectionScrollPosition = UICollectionViewScrollPositionNone;
+                    break;
+                case ZFPlayerScrollViewScrollPositionLeft:
+                    collectionScrollPosition = UICollectionViewScrollPositionLeft;
+                    break;
+                case ZFPlayerScrollViewScrollPositionCenteredHorizontally:
+                    collectionScrollPosition = UICollectionViewScrollPositionCenteredHorizontally;
+                    break;
+                case ZFPlayerScrollViewScrollPositionRight:
+                    collectionScrollPosition = UICollectionViewScrollPositionRight;
+                    break;
+                default:
+                    break;
+            }
+            [collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:collectionScrollPosition animated:animated];
         }
+    }
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        if (completionHandler) completionHandler();
     });
 }
 
-- (void)zf_setContentOffset:(CGPoint)contentOffset {
+- (void)zf_scrollViewDidEndDecelerating {
+    BOOL scrollToScrollStop = !self.tracking && !self.dragging && !self.decelerating;
+    if (scrollToScrollStop) {
+        [self _scrollViewDidStopScroll];
+    }
+}
+
+- (void)zf_scrollViewDidEndDraggingWillDecelerate:(BOOL)decelerate {
+    if (!decelerate) {
+        BOOL dragToDragStop = self.tracking && !self.dragging && !self.decelerating;
+        if (dragToDragStop) {
+            [self _scrollViewDidStopScroll];
+        }
+    }
+}
+
+- (void)zf_scrollViewDidScrollToTop {
+    [self _scrollViewDidStopScroll];
+}
+
+- (void)zf_scrollViewDidScroll {
     if (self.zf_scrollViewDirection == ZFPlayerScrollViewDirectionVertical) {
         [self _findCorrectCellWhenScrollViewDirectionVertical:nil];
+        [self _scrollViewScrollingDirectionVertical];
     } else {
         [self _findCorrectCellWhenScrollViewDirectionHorizontal:nil];
+        [self _scrollViewScrollingDirectionHorizontal];
     }
-    [self zf_setContentOffset:contentOffset];
+}
+
+- (void)zf_scrollViewWillBeginDragging {
+    [self _scrollViewBeginDragging];
 }
 
 #pragma mark - private method
 
 - (void)_scrollViewDidStopScroll {
-    @weakify(self)
+    self.zf_scrollDirection = ZFPlayerScrollDirectionNone;
+    @zf_weakify(self)
     [self zf_filterShouldPlayCellWhileScrolled:^(NSIndexPath * _Nonnull indexPath) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.zf_scrollViewDidStopScrollCallback) self.zf_scrollViewDidStopScrollCallback(indexPath);
         if (self.zf_scrollViewDidEndScrollingCallback) self.zf_scrollViewDidEndScrollingCallback(indexPath);
     }];
@@ -304,6 +411,16 @@
     if (!self.zf_shouldAutoPlay) return;
     if (self.zf_containerType == ZFPlayerContainerTypeView) return;
 
+    if (!self.zf_stopWhileNotVisible) {
+        /// If you have a cell that is playing, stop the traversal.
+        if (self.zf_playingIndexPath) {
+            NSIndexPath *finalIndexPath = self.zf_playingIndexPath;
+            if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(finalIndexPath);
+            if (handler) handler(finalIndexPath);
+            self.zf_shouldPlayIndexPath = finalIndexPath;
+            return;
+        }
+    }
     NSArray *visiableCells = nil;
     NSIndexPath *indexPath = nil;
     if ([self _isTableView]) {
@@ -314,7 +431,7 @@
         if (self.contentOffset.y <= 0 && (!self.zf_playingIndexPath || [indexPath compare:self.zf_playingIndexPath] == NSOrderedSame)) {
             UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
             UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-            if (playerView) {
+            if (playerView && !playerView.hidden && playerView.alpha > 0.01) {
                 if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(indexPath);
                 if (handler) handler(indexPath);
                 self.zf_shouldPlayIndexPath = indexPath;
@@ -327,7 +444,7 @@
         if (self.contentOffset.y + self.frame.size.height >= self.contentSize.height && (!self.zf_playingIndexPath || [indexPath compare:self.zf_playingIndexPath] == NSOrderedSame)) {
             UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
             UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-            if (playerView) {
+            if (playerView && !playerView.hidden && playerView.alpha > 0.01) {
                 if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(indexPath);
                 if (handler) handler(indexPath);
                 self.zf_shouldPlayIndexPath = indexPath;
@@ -352,7 +469,7 @@
         if (self.contentOffset.y <= 0 && (!self.zf_playingIndexPath || [indexPath compare:self.zf_playingIndexPath] == NSOrderedSame)) {
             UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
             UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-            if (playerView) {
+            if (playerView && !playerView.hidden && playerView.alpha > 0.01) {
                 if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(indexPath);
                 if (handler) handler(indexPath);
                 self.zf_shouldPlayIndexPath = indexPath;
@@ -365,7 +482,7 @@
         if (self.contentOffset.y + self.frame.size.height >= self.contentSize.height && (!self.zf_playingIndexPath || [indexPath compare:self.zf_playingIndexPath] == NSOrderedSame)) {
             UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
             UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-            if (playerView) {
+            if (playerView && !playerView.hidden && playerView.alpha > 0.01) {
                 if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(indexPath);
                 if (handler) handler(indexPath);
                 self.zf_shouldPlayIndexPath = indexPath;
@@ -387,11 +504,11 @@
     __block NSIndexPath *finalIndexPath = nil;
     /// The final distance from the center line.
     __block CGFloat finalSpace = 0;
-    @weakify(self)
+    @zf_weakify(self)
     [cells enumerateObjectsUsingBlock:^(UIView *cell, NSUInteger idx, BOOL * _Nonnull stop) {
-        @strongify(self)
+        @zf_strongify(self)
         UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-        if (!playerView) return;
+        if (!playerView || playerView.hidden || playerView.alpha <= 0.01) return;
         CGRect rect1 = [playerView convertRect:playerView.frame toView:self];
         CGRect rect = [self convertRect:rect1 toView:self.superview];
         /// playerView top to scrollView top space.
@@ -403,13 +520,6 @@
         
         /// Play when the video playback section is visible.
         if ((topSpacing >= -(1 - self.zf_playerApperaPercent) * CGRectGetHeight(rect)) && (bottomSpacing >= -(1 - self.zf_playerApperaPercent) * CGRectGetHeight(rect))) {
-            /// If you have a cell that is playing, stop the traversal.
-            if (self.zf_playingIndexPath) {
-                indexPath = self.zf_playingIndexPath;
-                finalIndexPath = indexPath;
-                *stop = YES;
-                return;
-            }
             if (!finalIndexPath || centerSpacing < finalSpace) {
                 finalIndexPath = indexPath;
                 finalSpace = centerSpacing;
@@ -430,6 +540,16 @@
 - (void)_findCorrectCellWhenScrollViewDirectionHorizontal:(void (^ __nullable)(NSIndexPath *indexPath))handler {
     if (!self.zf_shouldAutoPlay) return;
     if (self.zf_containerType == ZFPlayerContainerTypeView) return;
+    if (!self.zf_stopWhileNotVisible) {
+        /// If you have a cell that is playing, stop the traversal.
+        if (self.zf_playingIndexPath) {
+            NSIndexPath *finalIndexPath = self.zf_playingIndexPath;
+            if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(finalIndexPath);
+            if (handler) handler(finalIndexPath);
+            self.zf_shouldPlayIndexPath = finalIndexPath;
+            return;
+        }
+    }
     
     NSArray *visiableCells = nil;
     NSIndexPath *indexPath = nil;
@@ -441,7 +561,7 @@
         if (self.contentOffset.x <= 0 && (!self.zf_playingIndexPath || [indexPath compare:self.zf_playingIndexPath] == NSOrderedSame)) {
             UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
             UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-            if (playerView) {
+            if (playerView && !playerView.hidden && playerView.alpha > 0.01) {
                 if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(indexPath);
                 if (handler) handler(indexPath);
                 self.zf_shouldPlayIndexPath = indexPath;
@@ -454,7 +574,7 @@
         if (self.contentOffset.x + self.frame.size.width >= self.contentSize.width && (!self.zf_playingIndexPath || [indexPath compare:self.zf_playingIndexPath] == NSOrderedSame)) {
             UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
             UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-            if (playerView) {
+            if (playerView && !playerView.hidden && playerView.alpha > 0.01) {
                 if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(indexPath);
                 if (handler) handler(indexPath);
                 self.zf_shouldPlayIndexPath = indexPath;
@@ -479,7 +599,7 @@
         if (self.contentOffset.x <= 0 && (!self.zf_playingIndexPath || [indexPath compare:self.zf_playingIndexPath] == NSOrderedSame)) {
             UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
             UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-            if (playerView) {
+            if (playerView && !playerView.hidden && playerView.alpha > 0.01) {
                 if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(indexPath);
                 if (handler) handler(indexPath);
                 self.zf_shouldPlayIndexPath = indexPath;
@@ -492,7 +612,7 @@
         if (self.contentOffset.x + self.frame.size.width >= self.contentSize.width && (!self.zf_playingIndexPath || [indexPath compare:self.zf_playingIndexPath] == NSOrderedSame)) {
             UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
             UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-            if (playerView) {
+            if (playerView && !playerView.hidden && playerView.alpha > 0.01) {
                 if (self.zf_scrollViewDidScrollCallback) self.zf_scrollViewDidScrollCallback(indexPath);
                 if (handler) handler(indexPath);
                 self.zf_shouldPlayIndexPath = indexPath;
@@ -514,11 +634,11 @@
     __block NSIndexPath *finalIndexPath = nil;
     /// The final distance from the center line.
     __block CGFloat finalSpace = 0;
-    @weakify(self)
+    @zf_weakify(self)
     [cells enumerateObjectsUsingBlock:^(UIView *cell, NSUInteger idx, BOOL * _Nonnull stop) {
-        @strongify(self)
+        @zf_strongify(self)
         UIView *playerView = [cell viewWithTag:self.zf_containerViewTag];
-        if (!playerView) return;
+        if (!playerView || playerView.hidden || playerView.alpha <= 0.01) return;
         CGRect rect1 = [playerView convertRect:playerView.frame toView:self];
         CGRect rect = [self convertRect:rect1 toView:self.superview];
         /// playerView left to scrollView top space.
@@ -530,13 +650,6 @@
         
         /// Play when the video playback section is visible.
         if ((leftSpacing >= -(1 - self.zf_playerApperaPercent) * CGRectGetWidth(rect)) && (rightSpacing >= -(1 - self.zf_playerApperaPercent) * CGRectGetWidth(rect))) {
-            /// If you have a cell that is playing, stop the traversal.
-            if (self.zf_playingIndexPath) {
-                indexPath = self.zf_playingIndexPath;
-                finalIndexPath = indexPath;
-                *stop = YES;
-                return;
-            }
             if (!finalIndexPath || centerSpacing < finalSpace) {
                 finalIndexPath = indexPath;
                 finalSpace = centerSpacing;
@@ -559,89 +672,6 @@
     return [self isKindOfClass:[UICollectionView class]];
 }
 
-#pragma mark - public method
-
-- (UIView *)zf_getCellForIndexPath:(NSIndexPath *)indexPath {
-    if ([self _isTableView]) {
-        UITableView *tableView = (UITableView *)self;
-        UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
-        return cell;
-    } else if ([self _isCollectionView]) {
-        UICollectionView *collectionView = (UICollectionView *)self;
-        UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
-        return cell;
-    }
-    return nil;
-}
-
-- (NSIndexPath *)zf_getIndexPathForCell:(UIView *)cell {
-    if ([self _isTableView]) {
-        UITableView *tableView = (UITableView *)self;
-        NSIndexPath *indexPath = [tableView indexPathForCell:(UITableViewCell *)cell];
-        return indexPath;
-    } else if ([self _isCollectionView]) {
-        UICollectionView *collectionView = (UICollectionView *)self;
-        NSIndexPath *indexPath = [collectionView indexPathForCell:(UICollectionViewCell *)cell];
-        return indexPath;
-    }
-    return nil;
-}
-
-- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath completionHandler:(void (^ __nullable)(void))completionHandler {
-    [self zf_scrollToRowAtIndexPath:indexPath animated:YES completionHandler:completionHandler];
-}
-
-- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated completionHandler:(void (^ __nullable)(void))completionHandler {
-    [self zf_scrollToRowAtIndexPath:indexPath animateWithDuration:animated ? 0.4 : 0.0 completionHandler:completionHandler];
-}
-
-/// Scroll to indexPath with animations duration.
-- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath animateWithDuration:(NSTimeInterval)duration completionHandler:(void (^ __nullable)(void))completionHandler {
-    BOOL animated = duration > 0.0;
-    if ([self _isTableView]) {
-        UITableView *tableView = (UITableView *)self;
-        [tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:animated];
-    } else if ([self _isCollectionView]) {
-        UICollectionView *collectionView = (UICollectionView *)self;
-        [collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionTop animated:animated];
-    }
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        if (completionHandler) completionHandler();
-    });
-}
-
-- (void)zf_scrollViewDidEndDecelerating {
-    BOOL scrollToScrollStop = !self.tracking && !self.dragging && !self.decelerating;
-    if (scrollToScrollStop) {
-        [self _scrollViewDidStopScroll];
-    }
-}
-
-- (void)zf_scrollViewDidEndDraggingWillDecelerate:(BOOL)decelerate {
-    if (!decelerate) {
-        BOOL dragToDragStop = self.tracking && !self.dragging && !self.decelerating;
-        if (dragToDragStop) {
-            [self _scrollViewDidStopScroll];
-        }
-    }
-}
-
-- (void)zf_scrollViewDidScrollToTop {
-    [self _scrollViewDidStopScroll];
-}
-
-- (void)zf_scrollViewDidScroll {
-    if (self.zf_scrollViewDirection == ZFPlayerScrollViewDirectionVertical) {
-        [self _scrollViewScrollingDirectionVertical];
-    } else {
-        [self _scrollViewScrollingDirectionHorizontal];
-    }
-}
-
-- (void)zf_scrollViewWillBeginDragging {
-    [self _scrollViewBeginDragging];
-}
-
 #pragma mark - getter
 
 - (ZFPlayerScrollDirection)zf_scrollDirection {
@@ -692,9 +722,9 @@
 
 - (void)zf_filterShouldPlayCellWhileScrolled:(void (^ __nullable)(NSIndexPath *indexPath))handler {
     if (!self.zf_shouldAutoPlay) return;
-    @weakify(self)
+    @zf_weakify(self)
     [self zf_filterShouldPlayCellWhileScrolling:^(NSIndexPath *indexPath) {
-        @strongify(self)
+        @zf_strongify(self)
         /// 如果当前控制器已经消失,直接return
         if (self.zf_viewControllerDisappear) return;
         if ([ZFReachabilityManager sharedManager].isReachableViaWWAN && !self.zf_WWANAutoPlay) {
@@ -758,7 +788,10 @@
 }
 
 - (BOOL)zf_stopPlay {
-    return [objc_getAssociatedObject(self, _cmd) boolValue];
+    NSNumber *number = objc_getAssociatedObject(self, _cmd);
+    if (number) return number.boolValue;
+    self.zf_stopPlay = YES;
+    return YES;
 }
 
 - (BOOL)zf_stopWhileNotVisible {
@@ -912,6 +945,21 @@
     objc_setAssociatedObject(self, @selector(zf_shouldPlayIndexPathCallback), zf_shouldPlayIndexPathCallback, OBJC_ASSOCIATION_COPY_NONATOMIC);
 }
 
+#pragma mark - method
+
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath completionHandler:(void (^ __nullable)(void))completionHandler {
+    [self zf_scrollToRowAtIndexPath:indexPath animated:YES completionHandler:completionHandler];
+}
+
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated completionHandler:(void (^ __nullable)(void))completionHandler {
+    [self zf_scrollToRowAtIndexPath:indexPath animateWithDuration:animated ? 0.4 : 0.0 completionHandler:completionHandler];
+}
+
+/// Scroll to indexPath with animations duration.
+- (void)zf_scrollToRowAtIndexPath:(NSIndexPath *)indexPath animateWithDuration:(NSTimeInterval)duration completionHandler:(void (^ __nullable)(void))completionHandler {
+    [self zf_scrollToRowAtIndexPath:indexPath atScrollPosition:ZFPlayerScrollViewScrollPositionTop animateDuration:duration completionHandler:completionHandler];
+}
+
 @end
 
 #pragma clang diagnostic pop

+ 11 - 17
Pods/ZFPlayer/ZFPlayer/Classes/Core/UIViewController+ZFPlayerRotation.m

@@ -26,7 +26,7 @@
 
 @implementation UITabBarController (ZFPlayerRotation)
 
-+ (void)load {
++ (void)initialize {
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         SEL selectors[] = {
@@ -60,37 +60,31 @@
 
 // Whether automatic screen rotation is supported.
 - (BOOL)shouldAutorotate {
-    UIViewController *vc = self.viewControllers[self.selectedIndex];
-    if ([vc isKindOfClass:[UINavigationController class]]) {
-        UINavigationController *nav = (UINavigationController *)vc;
-        return [nav.topViewController shouldAutorotate];
-    } else {
-        return [vc shouldAutorotate];
-    }
+    return [[self viewControllerRotation] shouldAutorotate];
 }
 
 // Which screen directions are supported.
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
-    UIViewController *vc = self.viewControllers[self.selectedIndex];
-    if ([vc isKindOfClass:[UINavigationController class]]) {
-        UINavigationController *nav = (UINavigationController *)vc;
-        return [nav.topViewController supportedInterfaceOrientations];
-    } else {
-        return [vc supportedInterfaceOrientations];
-    }
+    return [[self viewControllerRotation] supportedInterfaceOrientations];
 }
 
 // The default screen direction (the current ViewController must be represented by a modal UIViewController (which is not valid with modal navigation) to call this method).
 - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
+    return [[self viewControllerRotation] preferredInterfaceOrientationForPresentation];
+}
+
+//  Return ViewController which decide rotation,if selected in UITabBarController is UINavigationController,return topViewController
+- (UIViewController *)viewControllerRotation {
     UIViewController *vc = self.viewControllers[self.selectedIndex];
     if ([vc isKindOfClass:[UINavigationController class]]) {
         UINavigationController *nav = (UINavigationController *)vc;
-        return [nav.topViewController preferredInterfaceOrientationForPresentation];
+        return nav.topViewController;
     } else {
-        return [vc preferredInterfaceOrientationForPresentation];
+        return vc;
     }
 }
 
+
 @end
 
 @implementation UINavigationController (ZFPlayerRotation)

+ 35 - 48
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFKVOController.m

@@ -26,13 +26,11 @@
 
 @interface ZFKVOEntry : NSObject
 @property (nonatomic, weak)   NSObject *observer;
-@property (nonatomic, strong) NSString *keyPath;
+@property (nonatomic, copy) NSString *keyPath;
 
 @end
 
 @implementation ZFKVOEntry
-@synthesize observer;
-@synthesize keyPath;
 
 @end
 
@@ -57,61 +55,56 @@
                forKeyPath:(NSString *)keyPath
                   options:(NSKeyValueObservingOptions)options
                   context:(void *)context {
-    NSObject *target = _target;
-    if (target == nil) return;
+    if (_target == nil) return;
     
-    BOOL removed = [self removeEntryOfObserver:observer forKeyPath:keyPath];
-    if (removed) {
+    NSInteger indexEntry = [self indexEntryOfObserver:observer forKeyPath:keyPath];
+    if (indexEntry != NSNotFound) {
         // duplicated register
         NSLog(@"duplicated observer");
-    }
-    
-    @try {
-        [target addObserver:observer
-                 forKeyPath:keyPath
-                    options:options
-                    context:context];
-        
-        ZFKVOEntry *entry = [[ZFKVOEntry alloc] init];
-        entry.observer = observer;
-        entry.keyPath  = keyPath;
-        [_observerArray addObject:entry];
-    } @catch (NSException *e) {
-        NSLog(@"ZFKVO: failed to add observer for %@\n", keyPath);
+    } else {
+        @try {
+            [_target addObserver:observer
+                     forKeyPath:keyPath
+                        options:options
+                        context:context];
+            
+            ZFKVOEntry *entry = [[ZFKVOEntry alloc] init];
+            entry.observer = observer;
+            entry.keyPath  = keyPath;
+            [_observerArray addObject:entry];
+        } @catch (NSException *e) {
+            NSLog(@"ZFKVO: failed to add observer for %@\n", keyPath);
+        }
     }
 }
 
 - (void)safelyRemoveObserver:(NSObject *)observer
                   forKeyPath:(NSString *)keyPath {
-    NSObject *target = _target;
-    if (target == nil) return;
+    if (_target == nil) return;
     
-    BOOL removed = [self removeEntryOfObserver:observer forKeyPath:keyPath];
-    if (removed) {
+    NSInteger indexEntry = [self indexEntryOfObserver:observer forKeyPath:keyPath];
+    if (indexEntry == NSNotFound) {
         // duplicated register
         NSLog(@"duplicated observer");
-    }
-    
-    @try {
-        if (removed) {
-            [target removeObserver:observer
-                        forKeyPath:keyPath];
+    } else {
+        [_observerArray removeObjectAtIndex:indexEntry];
+        @try {
+            [_target removeObserver:observer
+                            forKeyPath:keyPath];
+        } @catch (NSException *e) {
+            NSLog(@"ZFKVO: failed to remove observer for %@\n", keyPath);
         }
-    } @catch (NSException *e) {
-        NSLog(@"ZFKVO: failed to remove observer for %@\n", keyPath);
     }
 }
 
 - (void)safelyRemoveAllObservers {
-    __block NSObject *target = _target;
-    if (target == nil) return;
-    [_observerArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
-        ZFKVOEntry *entry = obj;
+    if (_target == nil) return;
+    [_observerArray enumerateObjectsUsingBlock:^(ZFKVOEntry *entry, NSUInteger idx, BOOL *stop) {
         if (entry == nil) return;
         NSObject *observer = entry.observer;
         if (observer == nil) return;
         @try {
-            [target removeObserver:observer
+            [_target removeObserver:observer
                         forKeyPath:entry.keyPath];
         } @catch (NSException *e) {
             NSLog(@"ZFKVO: failed to remove observer for %@\n", entry.keyPath);
@@ -121,23 +114,17 @@
     [_observerArray removeAllObjects];
 }
 
-- (BOOL)removeEntryOfObserver:(NSObject *)observer
+- (NSInteger)indexEntryOfObserver:(NSObject *)observer
                    forKeyPath:(NSString *)keyPath {
-    __block NSInteger foundIndex = -1;
-    [_observerArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
-        ZFKVOEntry *entry = (ZFKVOEntry *)obj;
+    __block NSInteger foundIndex = NSNotFound;
+    [_observerArray enumerateObjectsUsingBlock:^(ZFKVOEntry *entry, NSUInteger idx, BOOL *stop) {
         if (entry.observer == observer &&
             [entry.keyPath isEqualToString:keyPath]) {
             foundIndex = idx;
             *stop = YES;
         }
     }];
-    
-    if (foundIndex >= 0) {
-        [_observerArray removeObjectAtIndex:foundIndex];
-        return YES;
-    }
-    return NO;
+    return foundIndex;
 }
 
 @end

+ 63 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFLandscapeViewController.h

@@ -0,0 +1,63 @@
+//
+//  ZFFullscreenViewController.h
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <UIKit/UIKit.h>
+@class ZFLandscapeViewController;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@protocol ZFLandscapeViewControllerDelegate <NSObject>
+
+- (BOOL)ls_shouldAutorotate;
+- (void)ls_willRotateToOrientation:(UIInterfaceOrientation)orientation;
+- (void)ls_didRotateFromOrientation:(UIInterfaceOrientation)orientation;
+- (CGRect)ls_targetRect;
+
+@end
+
+@interface ZFLandscapeViewController : UIViewController
+
+@property (nonatomic, weak) UIView *contentView;
+
+@property (nonatomic, weak) UIView *containerView;
+
+@property (nonatomic, assign) CGRect targetRect;
+
+@property (nonatomic, weak, nullable) id<ZFLandscapeViewControllerDelegate> delegate;
+
+@property (nonatomic, readonly) BOOL isFullscreen;
+
+@property (nonatomic, assign) BOOL disableAnimations;
+
+@property (nonatomic, assign) BOOL statusBarHidden;
+/// default is  UIStatusBarStyleLightContent.
+@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;
+/// defalut is UIStatusBarAnimationSlide.
+@property (nonatomic, assign) UIStatusBarAnimation statusBarAnimation;
+
+@property (nonatomic, copy) void(^rotatingCompleted)(void);
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 125 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFLandscapeViewController.m

@@ -0,0 +1,125 @@
+//
+//  ZFFullScreenViewController.m
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "ZFLandscapeViewController.h"
+
+@interface ZFLandscapeViewController ()
+
+@property (nonatomic, assign) UIInterfaceOrientation currentOrientation;
+@property (nonatomic, getter=isRotating) BOOL rotating;
+
+@end
+
+@implementation ZFLandscapeViewController
+
+- (instancetype)init {
+    self = [super init];
+    if (self) {
+        _currentOrientation = UIInterfaceOrientationPortrait;
+        _statusBarStyle = UIStatusBarStyleLightContent;
+        _statusBarAnimation = UIStatusBarAnimationSlide;
+    }
+    return self;
+}
+
+- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
+    self.rotating = YES;
+    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
+    if (!UIDeviceOrientationIsValidInterfaceOrientation([UIDevice currentDevice].orientation)) {
+        return;
+    }
+    UIInterfaceOrientation newOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation;
+    UIInterfaceOrientation oldOrientation = _currentOrientation;
+    if (UIInterfaceOrientationIsLandscape(newOrientation)) {
+        if (self.contentView.superview != self.view) {
+            [self.view addSubview:self.contentView];
+        }
+    }
+    
+    if (oldOrientation == UIInterfaceOrientationPortrait) {
+        self.contentView.frame = [self.delegate ls_targetRect];
+        [self.contentView layoutIfNeeded];
+    }
+    self.currentOrientation = newOrientation;
+    
+    [self.delegate ls_willRotateToOrientation:self.currentOrientation];
+    BOOL isFullscreen = size.width > size.height;
+    [CATransaction begin];
+    [CATransaction setDisableActions:self.disableAnimations];
+    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
+        if (isFullscreen) {
+            self.contentView.frame = CGRectMake(0, 0, size.width, size.height);
+        } else {
+            self.contentView.frame = [self.delegate ls_targetRect];
+        }
+        [self.contentView layoutIfNeeded];
+    } completion:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
+        [CATransaction commit];
+        self.disableAnimations = NO;
+        [self.delegate ls_didRotateFromOrientation:self.currentOrientation];
+        self.rotating = NO;
+    }];
+}
+
+- (BOOL)isFullscreen {
+    return UIInterfaceOrientationIsLandscape(_currentOrientation);
+}
+
+- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
+    return UIInterfaceOrientationPortrait;
+}
+
+- (BOOL)shouldAutorotate {
+    return [self.delegate ls_shouldAutorotate];
+}
+
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
+    UIInterfaceOrientation currentOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation;
+    if (UIInterfaceOrientationIsLandscape(currentOrientation)) {
+        return UIInterfaceOrientationMaskLandscape;
+    }
+    return UIInterfaceOrientationMaskAll;
+}
+
+- (BOOL)prefersStatusBarHidden {
+    return self.statusBarHidden;
+}
+
+- (UIStatusBarStyle)preferredStatusBarStyle {
+    return self.statusBarStyle;
+}
+
+- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation {
+    return self.statusBarAnimation;
+}
+
+- (void)setRotating:(BOOL)rotating {
+    _rotating = rotating;
+    if (!rotating && self.rotatingCompleted) {
+        self.rotatingCompleted();
+    }
+}
+
+@end
+

+ 36 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFLandscapeWindow.h

@@ -0,0 +1,36 @@
+//
+//  ZFLandScaprWindow.h
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <UIKit/UIKit.h>
+#import "ZFLandscapeViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ZFLandscapeWindow : UIWindow
+
+@property (nonatomic, strong, readonly) ZFLandscapeViewController *landscapeViewController;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 75 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFLandscapeWindow.m

@@ -0,0 +1,75 @@
+//
+//  ZFLandScaprWindow.m
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "ZFLandscapeWindow.h"
+
+@implementation ZFLandscapeWindow
+@dynamic rootViewController;
+
+- (void)setBackgroundColor:(nullable UIColor *)backgroundColor {}
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    self = [super initWithFrame:frame];
+    if (self) {
+        self.windowLevel = UIWindowLevelNormal;
+        _landscapeViewController = [[ZFLandscapeViewController alloc] init];
+        self.rootViewController = _landscapeViewController;
+        if (@available(iOS 13.0, *)) {
+            if (self.windowScene == nil) {
+                self.windowScene = UIApplication.sharedApplication.keyWindow.windowScene;
+            }
+        }
+        self.hidden = YES;
+    }
+    return self;
+}
+
+- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *_Nullable)event {
+    return YES;
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    static CGRect bounds;
+    if (!CGRectEqualToRect(bounds, self.bounds)) {
+        UIView *superview = self;
+        if (@available(iOS 13.0, *)) {
+            superview = self.subviews.firstObject;
+        }
+        [UIView performWithoutAnimation:^{
+            for (UIView *view in superview.subviews) {
+                if (view != self.rootViewController.view && [view isMemberOfClass:UIView.class]) {
+                    view.backgroundColor = UIColor.clearColor;
+                    for (UIView *subview in view.subviews) {
+                        subview.backgroundColor = UIColor.clearColor;
+                    }
+                }
+            }
+        }];
+    }
+    bounds = self.bounds;
+    self.rootViewController.view.frame = bounds;
+}
+
+@end

+ 68 - 29
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFOrientationObserver.h

@@ -23,6 +23,7 @@
 // THE SOFTWARE.
 
 #import <UIKit/UIKit.h>
+#import "ZFPlayerView.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -33,11 +34,16 @@ typedef NS_ENUM(NSUInteger, ZFFullScreenMode) {
     ZFFullScreenModePortrait    // Portrait full screen Model
 };
 
-/// Full screen mode on the view
+/// Portrait full screen mode.
+typedef NS_ENUM(NSUInteger, ZFPortraitFullScreenMode) {
+    ZFPortraitFullScreenModeScaleToFill,    // Full fill
+    ZFPortraitFullScreenModeScaleAspectFit  // contents scaled to fit with fixed aspect. remainder is transparent
+};
+
+/// Player view mode
 typedef NS_ENUM(NSUInteger, ZFRotateType) {
     ZFRotateTypeNormal,         // Normal
-    ZFRotateTypeCell,           // Cell
-    ZFRotateTypeCellOther       // Cell mode add to other view
+    ZFRotateTypeCell            // Cell
 };
 
 /**
@@ -49,24 +55,38 @@ typedef NS_OPTIONS(NSUInteger, ZFInterfaceOrientationMask) {
     ZFInterfaceOrientationMaskLandscapeRight = (1 << 2),
     ZFInterfaceOrientationMaskPortraitUpsideDown = (1 << 3),
     ZFInterfaceOrientationMaskLandscape = (ZFInterfaceOrientationMaskLandscapeLeft | ZFInterfaceOrientationMaskLandscapeRight),
-    ZFInterfaceOrientationMaskAll = (ZFInterfaceOrientationMaskPortrait | ZFInterfaceOrientationMaskLandscapeLeft | ZFInterfaceOrientationMaskLandscapeRight | ZFInterfaceOrientationMaskPortraitUpsideDown),
-    ZFInterfaceOrientationMaskAllButUpsideDown = (ZFInterfaceOrientationMaskPortrait | ZFInterfaceOrientationMaskLandscapeLeft | ZFInterfaceOrientationMaskLandscapeRight),
+    ZFInterfaceOrientationMaskAll = (ZFInterfaceOrientationMaskPortrait | ZFInterfaceOrientationMaskLandscape | ZFInterfaceOrientationMaskPortraitUpsideDown),
+    ZFInterfaceOrientationMaskAllButUpsideDown = (ZFInterfaceOrientationMaskPortrait | ZFInterfaceOrientationMaskLandscape),
 };
 
+/// This enumeration lists some of the gesture types that the player has by default.
+typedef NS_OPTIONS(NSUInteger, ZFDisablePortraitGestureTypes) {
+    ZFDisablePortraitGestureTypesNone         = 0,
+    ZFDisablePortraitGestureTypesTap          = 1 << 0,
+    ZFDisablePortraitGestureTypesPan          = 1 << 1,
+    ZFDisablePortraitGestureTypesAll          = (ZFDisablePortraitGestureTypesTap | ZFDisablePortraitGestureTypesPan)
+};
+
+@protocol ZFPortraitOrientationDelegate <NSObject>
+
+- (void)zf_orientationWillChange:(BOOL)isFullScreen;
+
+- (void)zf_orientationDidChanged:(BOOL)isFullScreen;
+
+- (void)zf_interationState:(BOOL)isDragging;
+
+@end
+
 @interface ZFOrientationObserver : NSObject
 
 /// update the rotateView and containerView.
-- (void)updateRotateView:(UIView *)rotateView
+- (void)updateRotateView:(ZFPlayerView *)rotateView
            containerView:(UIView *)containerView;
 
 /// list play
-- (void)cellModelRotateView:(UIView *)rotateView
-           rotateViewAtCell:(UIView *)cell
-              playerViewTag:(NSInteger)playerViewTag;
-
-/// cell other view rotation
-- (void)cellOtherModelRotateView:(UIView *)rotateView
-                   containerView:(UIView *)containerView;
+- (void)updateRotateView:(ZFPlayerView *)rotateView
+        rotateViewAtCell:(UIView *)cell
+           playerViewTag:(NSInteger)playerViewTag;
 
 /// Container view of a full screen state player.
 @property (nonatomic, strong) UIView *fullScreenContainerView;
@@ -74,15 +94,6 @@ typedef NS_OPTIONS(NSUInteger, ZFInterfaceOrientationMask) {
 /// Container view of a small screen state player.
 @property (nonatomic, weak) UIView *containerView;
 
-/// If the full screen.
-@property (nonatomic, readonly, getter=isFullScreen) BOOL fullScreen;
-
-/// Use device orientation, default NO.
-@property (nonatomic, assign) BOOL forceDeviceOrientation;
-
-/// Lock screen orientation
-@property (nonatomic, getter=isLockedScreen) BOOL lockedScreen;
-
 /// The block invoked When player will rotate.
 @property (nonatomic, copy, nullable) void(^orientationWillChange)(ZFOrientationObserver *observer, BOOL isFullScreen);
 
@@ -92,11 +103,30 @@ typedef NS_OPTIONS(NSUInteger, ZFInterfaceOrientationMask) {
 /// Full screen mode, the default landscape into full screen
 @property (nonatomic) ZFFullScreenMode fullScreenMode;
 
+@property (nonatomic, assign) ZFPortraitFullScreenMode portraitFullScreenMode;
+
 /// rotate duration, default is 0.30
-@property (nonatomic) float duration;
+@property (nonatomic) NSTimeInterval duration;
+
+/// If the full screen.
+@property (nonatomic, readonly, getter=isFullScreen) BOOL fullScreen;
+
+/// Lock screen orientation
+@property (nonatomic, getter=isLockedScreen) BOOL lockedScreen;
+
+/// The fullscreen statusbar hidden.
+@property (nonatomic, assign) BOOL fullScreenStatusBarHidden;
 
-/// The statusbar hidden.
-@property (nonatomic, getter=isStatusBarHidden) BOOL statusBarHidden;
+/// default is  UIStatusBarStyleLightContent.
+@property (nonatomic, assign) UIStatusBarStyle fullScreenStatusBarStyle;
+
+/// defalut is UIStatusBarAnimationSlide.
+@property (nonatomic, assign) UIStatusBarAnimation fullScreenStatusBarAnimation;
+
+@property (nonatomic, assign) CGSize presentationSize;
+
+/// default is ZFDisablePortraitGestureTypesAll.
+@property (nonatomic, assign) ZFDisablePortraitGestureTypes disablePortraitGestureTypes;
 
 /// The current orientation of the player.
 /// Default is UIInterfaceOrientationPortrait.
@@ -104,7 +134,7 @@ typedef NS_OPTIONS(NSUInteger, ZFInterfaceOrientationMask) {
 
 /// Whether allow the video orientation rotate.
 /// default is YES.
-@property (nonatomic) BOOL allowOrentitaionRotation;
+@property (nonatomic, assign) BOOL allowOrientationRotation;
 
 /// The support Interface Orientation,default is ZFInterfaceOrientationMaskAllButUpsideDown
 @property (nonatomic, assign) ZFInterfaceOrientationMask supportInterfaceOrientation;
@@ -116,13 +146,22 @@ typedef NS_OPTIONS(NSUInteger, ZFInterfaceOrientationMask) {
 - (void)removeDeviceOrientationObserver;
 
 /// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
-- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated;
+- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated;
+
+/// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
+- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated completion:(void(^ __nullable)(void))completion;
 
 /// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModePortrait.
 - (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated;
 
-/// Exit the fullScreen.
-- (void)exitFullScreenWithAnimated:(BOOL)animated;
+/// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModePortrait.
+- (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void(^ __nullable)(void))completion;
+
+/// FullScreen mode is determined by ZFFullScreenMode.
+- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated;
+
+/// FullScreen mode is determined by ZFFullScreenMode.
+- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void (^ _Nullable)(void))completion;
 
 @end
 

+ 342 - 255
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFOrientationObserver.m

@@ -23,35 +23,10 @@
 // THE SOFTWARE.
 
 #import "ZFOrientationObserver.h"
-#import "ZFPlayer.h"
-
-#define SysVersion [[UIDevice currentDevice] systemVersion].floatValue
-
-@interface ZFFullViewController : UIViewController
-
-@property (nonatomic, assign) UIInterfaceOrientationMask interfaceOrientationMask;
-
-@end
-
-@implementation ZFFullViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    self.view.backgroundColor = [UIColor whiteColor];
-}
-
-- (BOOL)shouldAutorotate {
-    return YES;
-}
-
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
-    if (self.interfaceOrientationMask) {
-        return self.interfaceOrientationMask;
-    }
-    return UIInterfaceOrientationMaskLandscape;
-}
-
-@end
+#import "ZFLandscapeWindow.h"
+#import "ZFPortraitViewController.h"
+#import "ZFPlayerConst.h"
+#import <objc/runtime.h>
 
 @interface UIWindow (CurrentViewController)
 
@@ -66,12 +41,28 @@
 @implementation UIWindow (CurrentViewController)
 
 + (UIViewController*)zf_currentViewController; {
-    UIWindow *window = [[UIApplication sharedApplication].delegate window];
+    __block UIWindow *window;
+    if (@available(iOS 13, *)) {
+        [[UIApplication sharedApplication].connectedScenes enumerateObjectsUsingBlock:^(UIScene * _Nonnull scene, BOOL * _Nonnull scenesStop) {
+            if ([scene isKindOfClass: [UIWindowScene class]]) {
+                UIWindowScene * windowScene = (UIWindowScene *)scene;
+                [windowScene.windows enumerateObjectsUsingBlock:^(UIWindow * _Nonnull windowTemp, NSUInteger idx, BOOL * _Nonnull windowStop) {
+                    if (windowTemp.isKeyWindow) {
+                        window = windowTemp;
+                        *windowStop = YES;
+                        *scenesStop = YES;
+                    }
+                }];
+            }
+        }];
+    } else {
+        window = [[UIApplication sharedApplication].delegate window];
+    }
     UIViewController *topViewController = [window rootViewController];
     while (true) {
         if (topViewController.presentedViewController) {
             topViewController = topViewController.presentedViewController;
-        } else if ([topViewController isKindOfClass:[UINavigationController class]] && [(UINavigationController*)topViewController topViewController]) {
+        } else if ([topViewController isKindOfClass:[UINavigationController class]] && [(UINavigationController *)topViewController topViewController]) {
             topViewController = [(UINavigationController *)topViewController topViewController];
         } else if ([topViewController isKindOfClass:[UITabBarController class]]) {
             UITabBarController *tab = (UITabBarController *)topViewController;
@@ -85,9 +76,9 @@
 
 @end
 
-@interface ZFOrientationObserver ()
+@interface ZFOrientationObserver () <ZFLandscapeViewControllerDelegate>
 
-@property (nonatomic, weak) UIView *view;
+@property (nonatomic, weak) ZFPlayerView *view;
 
 @property (nonatomic, assign, getter=isFullScreen) BOOL fullScreen;
 
@@ -95,15 +86,26 @@
 
 @property (nonatomic, assign) NSInteger playerViewTag;
 
-@property (nonatomic, assign) ZFRotateType roateType;
+@property (nonatomic, assign) ZFRotateType rotateType;
+
+@property (nonatomic, strong) UIWindow *previousKeyWindow;
 
-@property (nonatomic, strong) UIView *blackView;
+@property (nonatomic, strong) ZFLandscapeWindow *window;
 
-@property (nonatomic, strong) UIWindow *customWindow;
+@property (nonatomic, readonly, getter=isRotating) BOOL rotating;
+
+@property (nonatomic, strong) ZFPortraitViewController *portraitViewController;
+
+/// current device orientation observer is activie.
+@property (nonatomic, assign) BOOL activeDeviceObserver;
+
+/// Force Rotaion, default NO.
+@property (nonatomic, assign) BOOL forceRotaion;
 
 @end
 
 @implementation ZFOrientationObserver
+@synthesize presentationSize = _presentationSize;
 
 - (instancetype)init {
     self = [super init];
@@ -111,45 +113,45 @@
         _duration = 0.30;
         _fullScreenMode = ZFFullScreenModeLandscape;
         _supportInterfaceOrientation = ZFInterfaceOrientationMaskAllButUpsideDown;
-        _allowOrentitaionRotation = YES;
-        _roateType = ZFRotateTypeNormal;
+        _allowOrientationRotation = YES;
+        _rotateType = ZFRotateTypeNormal;
         _currentOrientation = UIInterfaceOrientationPortrait;
+        _portraitFullScreenMode = ZFPortraitFullScreenModeScaleToFill;
+        _disablePortraitGestureTypes = ZFDisablePortraitGestureTypesAll;
     }
     return self;
 }
 
-- (void)updateRotateView:(UIView *)rotateView
+- (void)updateRotateView:(ZFPlayerView *)rotateView
            containerView:(UIView *)containerView {
+    self.rotateType = ZFRotateTypeNormal;
     self.view = rotateView;
     self.containerView = containerView;
 }
 
-- (void)cellModelRotateView:(UIView *)rotateView rotateViewAtCell:(UIView *)cell playerViewTag:(NSInteger)playerViewTag {
-    self.roateType = ZFRotateTypeCell;
+- (void)updateRotateView:(ZFPlayerView *)rotateView rotateViewAtCell:(UIView *)cell playerViewTag:(NSInteger)playerViewTag {
+    self.rotateType = ZFRotateTypeCell;
     self.view = rotateView;
     self.cell = cell;
     self.playerViewTag = playerViewTag;
 }
 
-- (void)cellOtherModelRotateView:(UIView *)rotateView containerView:(UIView *)containerView {
-    self.roateType = ZFRotateTypeCellOther;
-    self.view = rotateView;
-    self.containerView = containerView;
-}
-
 - (void)dealloc {
     [self removeDeviceOrientationObserver];
-    [self.blackView removeFromSuperview];
 }
 
 - (void)addDeviceOrientationObserver {
-    if (![UIDevice currentDevice].generatesDeviceOrientationNotifications) {
-        [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
+    if (self.allowOrientationRotation) {
+        self.activeDeviceObserver = YES;
+        if (![UIDevice currentDevice].generatesDeviceOrientationNotifications) {
+            [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
+        }
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleDeviceOrientationChange) name:UIDeviceOrientationDidChangeNotification object:nil];
     }
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleDeviceOrientationChange) name:UIDeviceOrientationDidChangeNotification object:nil];
 }
 
 - (void)removeDeviceOrientationObserver {
+    self.activeDeviceObserver = NO;
     if (![UIDevice currentDevice].generatesDeviceOrientationNotifications) {
         [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
     }
@@ -157,34 +159,33 @@
 }
 
 - (void)handleDeviceOrientationChange {
-    if (self.fullScreenMode == ZFFullScreenModePortrait || !self.allowOrentitaionRotation) return;
-
-    UIInterfaceOrientation currentOrientation = UIInterfaceOrientationUnknown;
-    if (UIDeviceOrientationIsValidInterfaceOrientation([UIDevice currentDevice].orientation)) {
-        currentOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation;
-    } else {
+    if (self.fullScreenMode == ZFFullScreenModePortrait || !self.allowOrientationRotation) return;
+    if (!UIDeviceOrientationIsValidInterfaceOrientation([UIDevice currentDevice].orientation)) {
         return;
     }
+    UIInterfaceOrientation currentOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation;
 
     // Determine that if the current direction is the same as the direction you want to rotate, do nothing
-    if (currentOrientation == _currentOrientation && !self.forceDeviceOrientation) return;
+    if (currentOrientation == _currentOrientation) return;
+    _currentOrientation = currentOrientation;
+    if (_currentOrientation == UIInterfaceOrientationPortraitUpsideDown) return;
     
     switch (currentOrientation) {
         case UIInterfaceOrientationPortrait: {
-            if ([self isSupportedPortrait]) {
-                [self enterLandscapeFullScreen:UIInterfaceOrientationPortrait animated:YES];
+            if ([self _isSupportedPortrait]) {
+                [self rotateToOrientation:UIInterfaceOrientationPortrait animated:YES];
             }
         }
             break;
         case UIInterfaceOrientationLandscapeLeft: {
-            if ([self isSupportedLandscapeLeft]) {
-                [self enterLandscapeFullScreen:UIInterfaceOrientationLandscapeLeft animated:YES];
+            if ([self _isSupportedLandscapeLeft]) {
+                [self rotateToOrientation:UIInterfaceOrientationLandscapeLeft animated:YES];
             }
         }
             break;
         case UIInterfaceOrientationLandscapeRight: {
-            if ([self isSupportedLandscapeRight]) {
-                [self enterLandscapeFullScreen:UIInterfaceOrientationLandscapeRight animated:YES];
+            if ([self _isSupportedLandscapeRight]) {
+                [self rotateToOrientation:UIInterfaceOrientationLandscapeRight animated:YES];
             }
         }
             break;
@@ -192,114 +193,6 @@
     }
 }
 
-- (void)forceDeviceOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
-    UIView *superview = nil;
-    if (UIInterfaceOrientationIsLandscape(orientation)) {
-        /// It's not set from the other side of the screen to this side
-        if (!self.isFullScreen) {
-            self.view.frame = [self.view convertRect:self.view.frame toView:superview];
-        }
-        self.fullScreen = YES;
-        superview = self.fullScreenContainerView;
-    } else {
-        if (!self.fullScreen) return;
-        self.fullScreen = NO;
-        if (self.roateType == ZFRotateTypeCell) superview = [self.cell viewWithTag:self.playerViewTag];
-        else superview = self.containerView;
-        if (self.blackView.superview != nil) [self.blackView removeFromSuperview];
-    }
-    if (self.orientationWillChange) self.orientationWillChange(self, self.isFullScreen);
-    [UIViewController attemptRotationToDeviceOrientation];
-
-    [superview addSubview:self.view];
-    if (animated) {
-        [UIView animateWithDuration:self.duration animations:^{
-            self.view.frame = superview.bounds;
-            [self.view layoutIfNeeded];
-            [self interfaceOrientation:orientation];
-        } completion:^(BOOL finished) {
-            if (self.fullScreen) {
-                [superview insertSubview:self.blackView belowSubview:self.view];
-                self.blackView.frame = superview.bounds;
-            }
-            if (self.orientationDidChanged) self.orientationDidChanged(self, self.isFullScreen);
-        }];
-    } else {
-        self.view.frame = superview.bounds;
-        [self.view layoutIfNeeded];
-        [UIView animateWithDuration:0 animations:^{
-            [self interfaceOrientation:orientation];
-        }];
-        if (self.fullScreen) {
-            [superview insertSubview:self.blackView belowSubview:self.view];
-            self.blackView.frame = superview.bounds;
-        }
-        if (self.orientationDidChanged) self.orientationDidChanged(self, self.isFullScreen);
-    }
-}
-
-- (void)normalOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
-    UIView *superview = nil;
-    CGRect frame;
-    if (UIInterfaceOrientationIsLandscape(orientation)) {
-        superview = self.fullScreenContainerView;
-        /// It's not set from the other side of the screen to this side
-        if (!self.isFullScreen) {
-            self.view.frame = [self.view convertRect:self.view.frame toView:superview];
-        }
-        [superview addSubview:self.view];
-        self.fullScreen = YES;
-        if (self.orientationWillChange) self.orientationWillChange(self, self.isFullScreen);
-        
-        ZFFullViewController *fullVC = [[ZFFullViewController alloc] init];
-        if (orientation == UIInterfaceOrientationLandscapeLeft) {
-            fullVC.interfaceOrientationMask = UIInterfaceOrientationMaskLandscapeLeft;
-        } else {
-            fullVC.interfaceOrientationMask = UIInterfaceOrientationMaskLandscapeRight;
-        }
-        self.customWindow.rootViewController = fullVC;
-    } else {
-        self.fullScreen = NO;
-        if (self.orientationWillChange) self.orientationWillChange(self, self.isFullScreen);
-        ZFFullViewController *fullVC = [[ZFFullViewController alloc] init];
-        fullVC.interfaceOrientationMask = UIInterfaceOrientationMaskPortrait;
-        self.customWindow.rootViewController = fullVC;
-        
-        if (self.roateType == ZFRotateTypeCell) superview = [self.cell viewWithTag:self.playerViewTag];
-        else superview = self.containerView;
-        if (self.blackView.superview != nil) [self.blackView removeFromSuperview];
-    }
-    frame = [superview convertRect:superview.bounds toView:self.fullScreenContainerView];
-    
-    if (animated) {
-        [UIView animateWithDuration:self.duration animations:^{
-            self.view.transform = [self getTransformRotationAngle:orientation];
-            [UIView animateWithDuration:self.duration animations:^{
-                self.view.frame = frame;
-                [self.view layoutIfNeeded];
-            }];
-        } completion:^(BOOL finished) {
-            [superview addSubview:self.view];
-            self.view.frame = superview.bounds;
-            if (self.fullScreen) {
-                [superview insertSubview:self.blackView belowSubview:self.view];
-                self.blackView.frame = superview.bounds;
-            }
-            if (self.orientationDidChanged) self.orientationDidChanged(self, self.isFullScreen);
-        }];
-    } else {
-        self.view.transform = [self getTransformRotationAngle:orientation];
-        [superview addSubview:self.view];
-        self.view.frame = superview.bounds;
-        [self.view layoutIfNeeded];
-        if (self.fullScreen) {
-            [superview insertSubview:self.blackView belowSubview:self.view];
-            self.blackView.frame = superview.bounds;
-        }
-        if (self.orientationDidChanged) self.orientationDidChanged(self, self.isFullScreen);
-    }
-}
-
 - (void)interfaceOrientation:(UIInterfaceOrientation)orientation {
     if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
         SEL selector = NSSelectorFromString(@"setOrientation:");
@@ -312,122 +205,241 @@
     }
 }
 
-/// Gets the rotation Angle of the transformation.
-- (CGAffineTransform)getTransformRotationAngle:(UIInterfaceOrientation)orientation {
-    if (orientation == UIInterfaceOrientationPortrait) {
-        return CGAffineTransformIdentity;
-    } else if (orientation == UIInterfaceOrientationLandscapeLeft) {
-        return CGAffineTransformMakeRotation(-M_PI_2);
-    } else if(orientation == UIInterfaceOrientationLandscapeRight) {
-        return CGAffineTransformMakeRotation(M_PI_2);
-    }
-    return CGAffineTransformIdentity;
-}
-
 #pragma mark - public
 
-- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
+- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
+    [self rotateToOrientation:orientation animated:animated completion:nil];
+}
+
+- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated completion:(void(^ __nullable)(void))completion {
     if (self.fullScreenMode == ZFFullScreenModePortrait) return;
     _currentOrientation = orientation;
-    if (self.forceDeviceOrientation) {
-        [self forceDeviceOrientation:orientation animated:animated];
+    self.forceRotaion = YES;
+    if (UIInterfaceOrientationIsLandscape(orientation)) {
+        if (!self.fullScreen) {
+            UIView *containerView = nil;
+            if (self.rotateType == ZFRotateTypeCell) {
+                containerView = [self.cell viewWithTag:self.playerViewTag];
+            } else {
+                containerView = self.containerView;
+            }
+            CGRect targetRect = [self.view convertRect:self.view.frame toView:containerView.window];
+            
+            if (!self.window) {
+                self.window = [ZFLandscapeWindow new];
+                self.window.landscapeViewController.delegate = self;
+                if (@available(iOS 9.0, *)) {
+                    [self.window.rootViewController loadViewIfNeeded];
+                } else {
+                    [self.window.rootViewController view];
+                }
+            }
+            
+            self.window.landscapeViewController.targetRect = targetRect;
+            self.window.landscapeViewController.contentView = self.view;
+            self.window.landscapeViewController.containerView = self.containerView;
+            self.fullScreen = YES;
+        }
+        if (self.orientationWillChange) self.orientationWillChange(self, self.isFullScreen);
     } else {
-        [self normalOrientation:orientation animated:animated];
+        self.fullScreen = NO;
     }
+    self.window.landscapeViewController.disableAnimations = !animated;
+    @zf_weakify(self)
+    self.window.landscapeViewController.rotatingCompleted = ^{
+        @zf_strongify(self)
+        self.forceRotaion = NO;
+        if (completion) completion();
+    };
+    
+    [self interfaceOrientation:UIInterfaceOrientationUnknown];
+    [self interfaceOrientation:orientation];
 }
 
 - (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated {
-    if (self.fullScreenMode == ZFFullScreenModeLandscape) return;
-    UIView *superview = nil;
+    [self enterPortraitFullScreen:fullScreen animated:animated completion:nil];
+}
+
+- (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void(^ __nullable)(void))completion {
+    self.fullScreen = fullScreen;
     if (fullScreen) {
-        superview = self.fullScreenContainerView;
-        self.view.frame = [self.view convertRect:self.view.frame toView:superview];
-        [superview addSubview:self.view];
-        self.fullScreen = YES;
-    } else {
-        if (self.roateType == ZFRotateTypeCell) {
-            superview = [self.cell viewWithTag:self.playerViewTag];
-        } else {
-            superview = self.containerView;
+        self.portraitViewController.contentView = self.view;
+        self.portraitViewController.containerView = self.containerView;
+        self.portraitViewController.duration = self.duration;
+        if (self.portraitFullScreenMode == ZFPortraitFullScreenModeScaleAspectFit) {
+            self.portraitViewController.presentationSize = self.presentationSize;
+        } else if (self.portraitFullScreenMode == ZFPortraitFullScreenModeScaleToFill) {
+            self.portraitViewController.presentationSize = CGSizeMake(ZFPlayerScreenWidth, ZFPlayerScreenHeight);
         }
-        self.fullScreen = NO;
-    }
-    if (self.orientationWillChange) self.orientationWillChange(self, self.isFullScreen);
-    CGRect frame = [superview convertRect:superview.bounds toView:self.fullScreenContainerView];
-    if (animated) {
-        [UIView animateWithDuration:self.duration animations:^{
-            self.view.frame = frame;
-            [self.view layoutIfNeeded];
-        } completion:^(BOOL finished) {
-            [superview addSubview:self.view];
-            self.view.frame = superview.bounds;
-            if (self.orientationDidChanged) self.orientationDidChanged(self, self.isFullScreen);
+        self.portraitViewController.fullScreenAnimation = animated;
+        [[UIWindow zf_currentViewController] presentViewController:self.portraitViewController animated:animated completion:^{
+            if (completion) completion();
         }];
     } else {
-        [superview addSubview:self.view];
-        self.view.frame = superview.bounds;
-        [self.view layoutIfNeeded];
-        if (self.orientationDidChanged) self.orientationDidChanged(self, self.isFullScreen);
+        self.portraitViewController.fullScreenAnimation = animated;
+        [self.portraitViewController dismissViewControllerAnimated:animated completion:^{
+            if (completion) completion();
+        }];
     }
 }
 
-- (void)exitFullScreenWithAnimated:(BOOL)animated {
-    if (self.fullScreenMode == ZFFullScreenModeLandscape) {
-        [self enterLandscapeFullScreen:UIInterfaceOrientationPortrait animated:animated];
-    } else if (self.fullScreenMode == ZFFullScreenModePortrait) {
-        [self enterPortraitFullScreen:NO animated:animated];
+- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated {
+    [self enterFullScreen:fullScreen animated:animated];
+}
+
+- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void (^ _Nullable)(void))completion {
+    if (self.fullScreenMode == ZFFullScreenModePortrait) {
+        [self enterPortraitFullScreen:fullScreen animated:animated completion:completion];
+    } else {
+        UIInterfaceOrientation orientation = UIInterfaceOrientationUnknown;
+        orientation = fullScreen? UIInterfaceOrientationLandscapeRight : UIInterfaceOrientationPortrait;
+        [self rotateToOrientation:orientation animated:animated completion:completion];
     }
 }
 
 #pragma mark - private
 
 /// is support portrait
-- (BOOL)isSupportedPortrait {
+- (BOOL)_isSupportedPortrait {
     return self.supportInterfaceOrientation & ZFInterfaceOrientationMaskPortrait;
 }
 
 /// is support landscapeLeft
-- (BOOL)isSupportedLandscapeLeft {
+- (BOOL)_isSupportedLandscapeLeft {
     return self.supportInterfaceOrientation & ZFInterfaceOrientationMaskLandscapeLeft;
 }
 
 /// is support landscapeRight
-- (BOOL)isSupportedLandscapeRight {
+- (BOOL)_isSupportedLandscapeRight {
     return self.supportInterfaceOrientation & ZFInterfaceOrientationMaskLandscapeRight;
 }
 
-#pragma mark - getter
+- (void)_fixNavigationBarLayout {
+    UINavigationController *nav = [self _lookupResponderForClass:UINavigationController.class];
+    [nav viewDidAppear:NO];
+    [nav.navigationBar layoutSubviews];
+}
 
-- (UIView *)blackView {
-    if (!_blackView) {
-        _blackView = [UIView new];
-        _blackView.backgroundColor = [UIColor blackColor];
+- (__kindof UIResponder *_Nullable)_lookupResponderForClass:(Class)cls {
+    __kindof UIResponder *_Nullable next = self.containerView.nextResponder;
+    while ( next != nil && [next isKindOfClass:cls] == NO ) {
+        next = next.nextResponder;
     }
-    return _blackView;
+    return next;
 }
 
-- (UIWindow *)customWindow {
-    if (!_customWindow) {
-        if (@available(iOS 13.0, *)) {
-            UIWindowScene *windowScene = nil;
-            for (UIScene *scene in [UIApplication sharedApplication].connectedScenes) {
-                if (scene.activationState == UISceneActivationStateForegroundActive) {
-                    windowScene = (UIWindowScene *)scene;
-                }
-                if (!windowScene && [UIApplication sharedApplication].connectedScenes.count == 1) {
-                    windowScene = (UIWindowScene *)scene;
-                }
-            }
-            if (windowScene) {
-                _customWindow = [[UIWindow alloc] initWithWindowScene:windowScene];
-            } else {
-                _customWindow = [[UIWindow alloc] initWithFrame:CGRectZero];
-            }
+- (BOOL)_isSupported:(UIInterfaceOrientation)orientation {
+    switch (orientation) {
+        case UIInterfaceOrientationPortrait:
+            return self.supportInterfaceOrientation & ZFInterfaceOrientationMaskPortrait;
+        case UIInterfaceOrientationLandscapeLeft:
+            return self.supportInterfaceOrientation & ZFInterfaceOrientationMaskLandscapeLeft;
+        case UIInterfaceOrientationLandscapeRight:
+            return self.supportInterfaceOrientation & ZFInterfaceOrientationMaskLandscapeRight;
+        default:
+            return NO;
+    }
+    return NO;
+}
+
+- (void)_rotationToLandscapeOrientation:(UIInterfaceOrientation)orientation {
+    if (UIInterfaceOrientationIsLandscape(orientation)) {
+        UIWindow *keyWindow = UIApplication.sharedApplication.keyWindow;
+        if (keyWindow != self.window && self.previousKeyWindow != keyWindow) {
+            self.previousKeyWindow = UIApplication.sharedApplication.keyWindow;
+        }
+        if (!self.window.isKeyWindow) {
+            self.window.hidden = NO;
+            [self.window makeKeyAndVisible];
+        }
+    }
+}
+
+#pragma mark - ZFLandscapeViewControllerDelegate
+
+- (BOOL)ls_shouldAutorotate {
+    if (self.fullScreenMode == ZFFullScreenModePortrait) {
+        return NO;
+    }
+    
+    UIInterfaceOrientation currentOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation;
+    if (![self _isSupported:currentOrientation]) {
+        return NO;
+    }
+    
+    if (self.forceRotaion) {
+        [self _rotationToLandscapeOrientation:currentOrientation];
+        return YES;
+    }
+    
+    if (!self.activeDeviceObserver) {
+        return NO;
+    }
+    
+    [self _rotationToLandscapeOrientation:currentOrientation];
+    return YES;
+}
+
+- (void)ls_willRotateToOrientation:(UIInterfaceOrientation)orientation {
+    if (UIInterfaceOrientationIsPortrait(orientation)) {
+        [self performSelector:@selector(_fixNavigationBarLayout) onThread:NSThread.mainThread withObject:@(NO) waitUntilDone:NO];
+    }
+    self.fullScreen = UIInterfaceOrientationIsLandscape(orientation);
+    if (self.orientationWillChange) self.orientationWillChange(self, self.isFullScreen);
+}
+
+- (void)ls_didRotateFromOrientation:(UIInterfaceOrientation)orientation {
+    if (self.orientationDidChanged) self.orientationDidChanged(self, self.isFullScreen);
+    if (!self.isFullScreen) {
+        UIView *containerView = nil;
+        if (self.rotateType == ZFRotateTypeCell) {
+            containerView = [self.cell viewWithTag:self.playerViewTag];
         } else {
-            _customWindow = [[UIWindow alloc] initWithFrame:CGRectZero];
+            containerView = self.containerView;
         }
+        [containerView addSubview:self.view];
+        self.view.frame = containerView.bounds;
+        UIWindow *previousKeyWindow = self.previousKeyWindow ?: UIApplication.sharedApplication.windows.firstObject;
+        [previousKeyWindow makeKeyAndVisible];
+        self.previousKeyWindow = nil;
+        self.window.hidden = YES;
     }
-    return _customWindow;
+}
+
+- (CGRect)ls_targetRect {
+    UIView *containerView = nil;
+    if (self.rotateType == ZFRotateTypeCell) {
+        containerView = [self.cell viewWithTag:self.playerViewTag];
+    } else {
+        containerView = self.containerView;
+    }
+    CGRect targetRect = [containerView convertRect:containerView.bounds toView:containerView.window];
+    return targetRect;
+}
+
+#pragma mark - getter
+
+- (ZFPortraitViewController *)portraitViewController {
+    if (!_portraitViewController) {
+        @zf_weakify(self)
+        _portraitViewController = [[ZFPortraitViewController alloc] init];
+        if (@available(iOS 9.0, *)) {
+            [_portraitViewController loadViewIfNeeded];
+        } else {
+            [_portraitViewController view];
+        }
+        _portraitViewController.orientationWillChange = ^(BOOL isFullScreen) {
+            @zf_strongify(self)
+            self.fullScreen = isFullScreen;
+            if (self.orientationWillChange) self.orientationWillChange(self, isFullScreen);
+        };
+        _portraitViewController.orientationDidChanged = ^(BOOL isFullScreen) {
+            @zf_strongify(self)
+            self.fullScreen = isFullScreen;
+            if (self.orientationDidChanged) self.orientationDidChanged(self, isFullScreen);
+        };
+    }
+    return _portraitViewController;
 }
 
 #pragma mark - setter
@@ -442,21 +454,96 @@
 }
 
 - (UIView *)fullScreenContainerView {
-    if (!_fullScreenContainerView) {
-        _fullScreenContainerView = [UIApplication sharedApplication].keyWindow;
+    if (self.fullScreenMode == ZFFullScreenModeLandscape) {
+        return self.window.landscapeViewController.view;
+    } else if (self.fullScreenMode == ZFFullScreenModePortrait) {
+        return self.portraitViewController.view;
     }
-    return _fullScreenContainerView;
+    return nil;
 }
 
 - (void)setFullScreen:(BOOL)fullScreen {
     _fullScreen = fullScreen;
-    [[UIWindow zf_currentViewController] setNeedsStatusBarAppearanceUpdate];
+    [self.window.landscapeViewController setNeedsStatusBarAppearanceUpdate];
     [UIViewController attemptRotationToDeviceOrientation];
 }
 
-- (void)setStatusBarHidden:(BOOL)statusBarHidden {
-    _statusBarHidden = statusBarHidden;
-    [[UIWindow zf_currentViewController] setNeedsStatusBarAppearanceUpdate];
+- (void)setFullScreenStatusBarHidden:(BOOL)fullScreenStatusBarHidden {
+    _fullScreenStatusBarHidden = fullScreenStatusBarHidden;
+    if (self.fullScreenMode == ZFFullScreenModePortrait) {
+        self.portraitViewController.statusBarHidden = fullScreenStatusBarHidden;
+        [self.portraitViewController setNeedsStatusBarAppearanceUpdate];
+    } else if (self.fullScreenMode == ZFFullScreenModeLandscape) {
+        self.window.landscapeViewController.statusBarHidden = fullScreenStatusBarHidden;
+        [self.window.landscapeViewController setNeedsStatusBarAppearanceUpdate];
+    }
+}
+
+- (void)setFullScreenStatusBarStyle:(UIStatusBarStyle)fullScreenStatusBarStyle {
+    _fullScreenStatusBarStyle = fullScreenStatusBarStyle;
+    if (self.fullScreenMode == ZFFullScreenModePortrait) {
+        self.portraitViewController.statusBarStyle = fullScreenStatusBarStyle;
+        [self.portraitViewController setNeedsStatusBarAppearanceUpdate];
+    } else if (self.fullScreenMode == ZFFullScreenModeLandscape) {
+        self.window.landscapeViewController.statusBarStyle = fullScreenStatusBarStyle;
+        [self.window.landscapeViewController setNeedsStatusBarAppearanceUpdate];
+    }
+}
+
+- (void)setFullScreenStatusBarAnimation:(UIStatusBarAnimation)fullScreenStatusBarAnimation {
+    _fullScreenStatusBarAnimation = fullScreenStatusBarAnimation;
+    if (self.fullScreenMode == ZFFullScreenModePortrait) {
+        self.portraitViewController.statusBarAnimation = fullScreenStatusBarAnimation;
+        [self.portraitViewController setNeedsStatusBarAppearanceUpdate];
+    } else if (self.fullScreenMode == ZFFullScreenModeLandscape) {
+        self.window.landscapeViewController.statusBarAnimation = fullScreenStatusBarAnimation;
+        [self.window.landscapeViewController setNeedsStatusBarAppearanceUpdate];
+    }
+}
+
+- (void)setDisablePortraitGestureTypes:(ZFDisablePortraitGestureTypes)disablePortraitGestureTypes {
+    _disablePortraitGestureTypes = disablePortraitGestureTypes;
+    self.portraitViewController.disablePortraitGestureTypes = disablePortraitGestureTypes;
+}
+
+- (void)setPresentationSize:(CGSize)presentationSize {
+    _presentationSize = presentationSize;
+    if (self.fullScreenMode == ZFFullScreenModePortrait && self.portraitFullScreenMode == ZFPortraitFullScreenModeScaleAspectFit) {
+        self.portraitViewController.presentationSize = presentationSize;
+    }
+}
+
+- (void)setView:(ZFPlayerView *)view {
+    if (view == _view) {
+        return;
+    }
+    _view = view;
+    if (self.fullScreenMode == ZFFullScreenModeLandscape && self.window) {
+        self.window.landscapeViewController.contentView = view;
+    } else if (self.fullScreenMode == ZFFullScreenModePortrait) {
+        self.portraitViewController.contentView = view;
+    }
+}
+
+- (void)setContainerView:(UIView *)containerView {
+    if (containerView == _containerView) {
+        return;
+    }
+    _containerView = containerView;
+    if (self.fullScreenMode == ZFFullScreenModeLandscape) {
+        self.window.landscapeViewController.containerView = containerView;
+    } else if (self.fullScreenMode == ZFFullScreenModePortrait) {
+        self.portraitViewController.containerView = containerView;
+    }
+}
+
+- (void)setAllowOrientationRotation:(BOOL)allowOrientationRotation {
+    _allowOrientationRotation = allowOrientationRotation;
+    if (allowOrientationRotation) {
+        [self addDeviceOrientationObserver];
+    } else {
+        [self removeDeviceOrientationObserver];
+    }
 }
 
 @end

+ 47 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPersentInteractiveTransition.h

@@ -0,0 +1,47 @@
+//
+//  ZFPersentInteractiveTransition.h
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+#import <UIKit/UIKit.h>
+#import "ZFOrientationObserver.h"
+
+@interface ZFPersentInteractiveTransition : UIPercentDrivenInteractiveTransition
+
+@property (nonatomic, weak) id<ZFPortraitOrientationDelegate> delagate;
+
+@property (nonatomic, assign) BOOL interation;
+
+/// default is ZFDisablePortraitGestureTypesNone.
+@property (nonatomic, assign) ZFDisablePortraitGestureTypes disablePortraitGestureTypes;
+
+@property (nonatomic, assign) BOOL fullScreenAnimation;
+
+@property (nonatomic, assign) CGRect contentFullScreenRect;
+
+@property (nonatomic, weak) UIViewController *viewController;
+
+- (void)updateContentView:(UIView *)contenView
+            containerView:(UIView *)containerView;
+
+@end

+ 296 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPersentInteractiveTransition.m

@@ -0,0 +1,296 @@
+//
+//  ZFPersentInteractiveTransition.m
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "ZFPersentInteractiveTransition.h"
+
+@interface ZFPersentInteractiveTransition () <UIGestureRecognizerDelegate>
+
+@property (nonatomic, weak) id<UIViewControllerContextTransitioning> transitionContext;
+@property (nonatomic, strong) UIView *bgView;
+@property (nonatomic, assign) CGPoint transitionImgViewCenter;
+@property (nonatomic, strong) UIView *contentView;
+@property (nonatomic, strong) UIView *containerView;
+@property (nonatomic, assign) CGFloat scrollViewZoomScale;
+@property (nonatomic, assign) CGSize scrollViewContentSize;
+@property (nonatomic, assign) CGPoint scrollViewContentOffset;
+@property (nonatomic, strong) UIPanGestureRecognizer *panGesture;
+@property (nonatomic, strong) UITapGestureRecognizer *tapGesture;
+@property (nonatomic, assign) BOOL isDragging;
+
+@end
+
+@implementation ZFPersentInteractiveTransition
+
+- (void)updateContentView:(UIView *)contenView
+            containerView:(UIView *)containerView {
+    self.contentView = contenView;
+    self.containerView = containerView;
+}
+
+- (void)removeGestureToView:(UIView *)view {
+    [view removeGestureRecognizer:self.tapGesture];
+    [view removeGestureRecognizer:self.panGesture];
+}
+
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
+    if ([otherGestureRecognizer.view isKindOfClass:[UICollectionView class]]) {
+        return NO;
+    }
+    if ([otherGestureRecognizer.view isKindOfClass:[UIScrollView class]]) {
+        UIScrollView *scrollView = (UIScrollView *)otherGestureRecognizer.view;
+        if (scrollView.contentOffset.y <= 0 && !scrollView.zooming) {
+            return YES;
+        }
+    }
+    if ([otherGestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] || [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
+        return NO;
+    }
+    return YES;
+}
+
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
+    ZFDisablePortraitGestureTypes type = ZFDisablePortraitGestureTypesNone;
+    if (gestureRecognizer == self.tapGesture) type = ZFDisablePortraitGestureTypesTap;
+    else if (gestureRecognizer == self.panGesture) type = ZFDisablePortraitGestureTypesPan;
+    else return NO;
+
+    switch (type) {
+        case ZFDisablePortraitGestureTypesTap: {
+            if (self.disablePortraitGestureTypes & ZFDisablePortraitGestureTypesTap) {
+                return NO;
+            }
+        }
+            break;
+        case ZFDisablePortraitGestureTypesPan: {
+            if (self.disablePortraitGestureTypes & ZFDisablePortraitGestureTypesPan) {
+                return NO;
+            }
+        }
+            break;
+        default:
+            break;
+    }
+    return YES;
+}
+
+- (void)tapGestureAction {
+    [self.viewController dismissViewControllerAnimated:self.fullScreenAnimation completion:nil];
+}
+
+- (void)gestureRecognizeDidUpdate:(UIPanGestureRecognizer *)gestureRecognizer {
+    CGFloat scale = 0;
+    CGPoint translation = [gestureRecognizer translationInView:gestureRecognizer.view];
+    scale = translation.y / ((gestureRecognizer.view.frame.size.height - 50) / 2);
+
+    if (scale > 1.f) {
+        scale = 1.f;
+    }
+    switch (gestureRecognizer.state) {
+        case UIGestureRecognizerStateBegan: {
+            if (scale < 0) return;
+            self.interation = YES;
+            [self.viewController dismissViewControllerAnimated:self.fullScreenAnimation completion:nil];
+        }
+            break;
+        case UIGestureRecognizerStateChanged: {
+            if (self.interation) {
+                if (scale < 0.f) {
+                    scale = 0.f;
+                }
+                CGFloat imageViewScale = 1 - scale * 0.5;
+                if (imageViewScale < 0.4) {
+                    imageViewScale = 0.4;
+                }
+                self.contentView.center = CGPointMake(self.transitionImgViewCenter.x + translation.x, self.transitionImgViewCenter.y + translation.y);
+                self.contentView.transform = CGAffineTransformMakeScale(imageViewScale, imageViewScale);
+                [self updateInterPercent:imageViewScale];
+                [self updateInteractiveTransition:scale];
+            }
+        }
+            break;
+        case UIGestureRecognizerStateEnded: {
+            if (self.interation) {
+                if (scale < 0.f) {
+                    scale = 0.f;
+                }
+                self.interation = NO;
+                if (scale < 0.15f) {
+                    [self cancelInteractiveTransition];
+                    [self interPercentCancel];
+                } else {
+                    [self finishInteractiveTransition];
+                    [self interPercentFinish];
+                }
+            }
+        }
+            break;
+        default: {
+            if (self.interation) {
+                self.interation = NO;
+                [self cancelInteractiveTransition];
+                [self interPercentCancel];
+            }
+        }
+            break;
+    }
+}
+
+- (void)beginInterPercent {
+    id<UIViewControllerContextTransitioning> transitionContext = self.transitionContext;
+    UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
+    UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+    if ([toVC isKindOfClass:[UINavigationController class]]) {
+        UINavigationController *nav = (UINavigationController *)toVC;
+        toVC = nav.viewControllers.lastObject;
+    } else if ([toVC isKindOfClass:[UITabBarController class]]) {
+        UITabBarController *tabBar = (UITabBarController *)toVC;
+        if ([tabBar.selectedViewController isKindOfClass:[UINavigationController class]]) {
+            UINavigationController *nav = (UINavigationController *)tabBar.selectedViewController;
+            toVC = nav.viewControllers.lastObject;
+        } else {
+            toVC = tabBar.selectedViewController;
+        }
+    }
+    
+    UIView *containerView = [transitionContext containerView];
+    CGRect tempImageViewFrame = [fromVC.view convertRect:self.contentView.frame toView:toVC.view];
+    
+    self.bgView = [[UIView alloc] initWithFrame:containerView.bounds];
+    self.contentView.frame = tempImageViewFrame;
+    self.transitionImgViewCenter = self.contentView.center;
+    
+    [containerView addSubview:self.bgView];
+    [containerView addSubview:self.contentView];
+    [containerView addSubview:fromVC.view];
+    
+    self.bgView.backgroundColor = [UIColor blackColor];
+    fromVC.view.backgroundColor = [UIColor clearColor];
+}
+
+- (void)updateInterPercent:(CGFloat)scale {
+    UIViewController *fromVC = [self.transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
+    fromVC.view.alpha = scale;
+    self.bgView.alpha = scale;
+}
+
+- (void)interPercentCancel {
+    id<UIViewControllerContextTransitioning> transitionContext = self.transitionContext;
+    UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
+    [UIView animateWithDuration:0.2f animations:^{
+        fromVC.view.alpha = 1;
+        self.contentView.transform = CGAffineTransformIdentity;
+        self.contentView.center = self.transitionImgViewCenter;
+        self.bgView.alpha = 1;
+    } completion:^(BOOL finished) {
+        fromVC.view.backgroundColor = [UIColor blackColor];
+        self.contentView.layer.anchorPoint = CGPointMake(0.5f, 0.5f);
+        self.contentView.frame = self.contentFullScreenRect;
+        if (self.scrollViewContentOffset.y < 0) {
+            self.scrollViewContentOffset = CGPointMake(self.scrollViewContentOffset.x, 0);
+        }
+        [self.viewController.view addSubview:self.contentView];
+        [self.bgView removeFromSuperview];
+        self.bgView = nil;
+        [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
+    }];
+}
+
+- (void)interPercentFinish {
+    id<UIViewControllerContextTransitioning> transitionContext = self.transitionContext;
+    UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
+    UIViewController *toVC = [self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+    if ([toVC isKindOfClass:[UINavigationController class]]) {
+        UINavigationController *nav = (UINavigationController *)toVC;
+        toVC = nav.viewControllers.lastObject;
+    } else if ([toVC isKindOfClass:[UITabBarController class]]) {
+        UITabBarController *tabBar = (UITabBarController *)toVC;
+        if ([tabBar.selectedViewController isKindOfClass:[UINavigationController class]]) {
+            UINavigationController *nav = (UINavigationController *)tabBar.selectedViewController;
+            toVC = nav.viewControllers.lastObject;
+        } else {
+            toVC = tabBar.selectedViewController;
+        }
+    }
+    CGRect tempImageViewFrame = self.contentView.frame;
+    self.contentView.layer.anchorPoint = CGPointMake(0.5, 0.5);
+    self.contentView.transform = CGAffineTransformIdentity;
+    self.contentView.frame = tempImageViewFrame;
+    
+    CGRect toRect = [self.containerView convertRect:self.containerView.bounds toView:self.containerView.window];
+    [self.delagate zf_orientationWillChange:NO];
+    [UIView animateWithDuration:0.3f animations:^{
+        self.contentView.frame = toRect;
+        fromVC.view.alpha = 0;
+        self.bgView.alpha = 0;
+        toVC.navigationController.navigationBar.alpha = 1;
+        [self.contentView layoutIfNeeded];
+    } completion:^(BOOL finished) {
+        [self.containerView addSubview:self.contentView];
+        self.contentView.frame = self.containerView.bounds;
+        [self.contentView layoutIfNeeded];
+        [self.bgView removeFromSuperview];
+        fromVC.view.backgroundColor = [UIColor blackColor];
+        [self.delagate zf_orientationDidChanged:NO];
+        [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
+    }];
+}
+
+- (void)startInteractiveTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
+    self.transitionContext = transitionContext;
+    [self beginInterPercent];
+}
+
+- (void)setInteration:(BOOL)interation {
+    _interation = interation;
+    if ([self.delagate respondsToSelector:@selector(zf_interationState:)]) {
+        [self.delagate zf_interationState:interation];
+    }
+}
+
+- (void)setViewController:(UIViewController *)viewController {
+    _viewController = viewController;
+    [self removeGestureToView:viewController.view];
+    [viewController.view addGestureRecognizer:self.panGesture];
+    [viewController.view addGestureRecognizer:self.tapGesture];
+}
+
+#pragma mark - getter
+
+- (UIPanGestureRecognizer *)panGesture {
+    if (!_panGesture) {
+        _panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(gestureRecognizeDidUpdate:)];
+        _panGesture.delegate = self;
+    }
+    return _panGesture;
+}
+
+- (UITapGestureRecognizer *)tapGesture {
+    if (!_tapGesture) {
+        _tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureAction)];
+        _tapGesture.delegate = self;
+    }
+    return _tapGesture;
+}
+
+@end

+ 1 - 52
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayer.h

@@ -30,60 +30,9 @@ FOUNDATION_EXPORT double ZFPlayerVersionNumber;
 //! Project version string for ZFPlayer.
 FOUNDATION_EXPORT const unsigned char ZFPlayerVersionString[];
 
-/**
- Synthsize a weak or strong reference.
- 
- Example:
- @weakify(self)
- [self doSomething^{
- @strongify(self)
- if (!self) return;
- ...
- }];
- 
- */
-#ifndef weakify
-#if DEBUG
-#if __has_feature(objc_arc)
-#define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
-#else
-#define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
-#endif
-#else
-#if __has_feature(objc_arc)
-#define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
-#else
-#define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
-#endif
-#endif
-#endif
-
-#ifndef strongify
-#if DEBUG
-#if __has_feature(objc_arc)
-#define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
-#else
-#define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object;
-#endif
-#else
-#if __has_feature(objc_arc)
-#define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object;
-#else
-#define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object;
-#endif
-#endif
-#endif
-
-// Screen width
-#define ZFPlayerScreenWidth     [[UIScreen mainScreen] bounds].size.width
-// Screen height
-#define ZFPlayerScreenHeight    [[UIScreen mainScreen] bounds].size.height
-
 #import "ZFPlayerController.h"
-#import "ZFPlayerGestureControl.h"
-#import "ZFPlayerMediaPlayback.h"
 #import "ZFPlayerMediaControl.h"
-#import "ZFOrientationObserver.h"
 #import "ZFKVOController.h"
 #import "UIScrollView+ZFPlayer.h"
 #import "ZFPlayerLogManager.h"
+#import "ZFPlayerConst.h"

+ 130 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerConst.h

@@ -0,0 +1,130 @@
+//
+//  ZFPlayerConst.h
+//  ZFPlayer
+//
+// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+typedef NS_ENUM(NSUInteger, ZFPlayerPlaybackState) {
+    ZFPlayerPlayStateUnknown,
+    ZFPlayerPlayStatePlaying,
+    ZFPlayerPlayStatePaused,
+    ZFPlayerPlayStatePlayFailed,
+    ZFPlayerPlayStatePlayStopped
+};
+
+typedef NS_OPTIONS(NSUInteger, ZFPlayerLoadState) {
+    ZFPlayerLoadStateUnknown        = 0,
+    ZFPlayerLoadStatePrepare        = 1 << 0,
+    ZFPlayerLoadStatePlayable       = 1 << 1,
+    ZFPlayerLoadStatePlaythroughOK  = 1 << 2, // Playback will be automatically started.
+    ZFPlayerLoadStateStalled        = 1 << 3, // Playback will be automatically paused in this state, if started.
+};
+
+typedef NS_ENUM(NSInteger, ZFPlayerScalingMode) {
+    ZFPlayerScalingModeNone,       // No scaling.
+    ZFPlayerScalingModeAspectFit,  // Uniform scale until one dimension fits.
+    ZFPlayerScalingModeAspectFill, // Uniform scale until the movie fills the visible bounds. One dimension may have clipped contents.
+    ZFPlayerScalingModeFill        // Non-uniform scale. Both render dimensions will exactly match the visible bounds.
+};
+
+/**
+ Synthsize a weak or strong reference.
+ 
+ Example:
+ @zf_weakify(self)
+ [self doSomething^{
+ @zf_strongify(self)
+ if (!self) return;
+ ...
+ }];
+ 
+ */
+#ifndef weakify
+#if DEBUG
+#if __has_feature(objc_arc)
+#define zf_weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
+#else
+#define zf_weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
+#endif
+#else
+#if __has_feature(objc_arc)
+#define zf_weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
+#else
+#define zf_weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
+#endif
+#endif
+#endif
+
+#ifndef strongify
+#if DEBUG
+#if __has_feature(objc_arc)
+#define zf_strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
+#else
+#define zf_strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object;
+#endif
+#else
+#if __has_feature(objc_arc)
+#define zf_strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object;
+#else
+#define zf_strongify(object) try{} @finally{} __typeof__(object) object = block##_##object;
+#endif
+#endif
+#endif
+
+// Screen width
+#define ZFPlayerScreenWidth     [[UIScreen mainScreen] bounds].size.width
+// Screen height
+#define ZFPlayerScreenHeight    [[UIScreen mainScreen] bounds].size.height
+
+
+// deprecated
+#ifndef weakify
+#if DEBUG
+#if __has_feature(objc_arc)
+#define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
+#else
+#define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
+#endif
+#else
+#if __has_feature(objc_arc)
+#define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
+#else
+#define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
+#endif
+#endif
+#endif
+
+#ifndef strongify
+#if DEBUG
+#if __has_feature(objc_arc)
+#define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
+#else
+#define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object;
+#endif
+#else
+#if __has_feature(objc_arc)
+#define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object;
+#else
+#define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object;
+#endif
+#endif
+#endif
+

+ 142 - 23
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerController.h

@@ -144,6 +144,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface ZFPlayerController (ZFPlayerPlaybackControl)
 
+/// Resume playback record.default is NO.
+/// Memory storage playback records.
+@property (nonatomic, assign) BOOL resumePlayRecord;
+
 /// 0...1.0
 /// Only affects audio volume for the device instance and not for the player.
 /// You can change device volume or player volume as needed,change the player volume you can conform the `ZFPlayerMediaPlayback` protocol.
@@ -247,19 +251,19 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)replaceCurrentPlayerManager:(id<ZFPlayerMediaPlayback>)manager;
 
 /**
- Add video to the cell.
+ Add video to cell.
  */
 - (void)addPlayerViewToCell;
 
 /**
- Add video to the container view.
+ Add video to container view.
  */
 - (void)addPlayerViewToContainerView:(UIView *)containerView;
 
 /**
- Add to the keyWindow.
+ Add to small float view.
  */
-- (void)addPlayerViewToKeyWindow;
+- (void)addPlayerViewToSmallFloatView;
 
 /**
  Stop the current playing video and remove the playerView.
@@ -278,7 +282,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, readonly) ZFOrientationObserver *orientationObserver;
 
 /// Whether automatic screen rotation is supported.
-/// iOS8.1~iOS8.3 the value is YES, other iOS version the value is NO.
+/// The value is NO.
 /// This property is used for the return value of UIViewController `shouldAutorotate` method.
 @property (nonatomic, readonly) BOOL shouldAutorotate;
 
@@ -296,12 +300,6 @@ NS_ASSUME_NONNULL_BEGIN
 /// Lock the screen orientation.
 @property (nonatomic, getter=isLockedScreen) BOOL lockedScreen;
 
-/// The statusbar hidden.
-@property (nonatomic, getter=isStatusBarHidden) BOOL statusBarHidden;
-
-/// Use device orientation, default NO.
-@property (nonatomic, assign) BOOL forceDeviceOrientation;
-
 /// The current orientation of the player.
 /// Default is UIInterfaceOrientationPortrait.
 @property (nonatomic, readonly) UIInterfaceOrientation currentOrientation;
@@ -312,6 +310,15 @@ NS_ASSUME_NONNULL_BEGIN
 /// The block invoked when player rotated.
 @property (nonatomic, copy, nullable) void(^orientationDidChanged)(ZFPlayerController *player, BOOL isFullScreen);
 
+/// default is  UIStatusBarStyleLightContent.
+@property (nonatomic, assign) UIStatusBarStyle fullScreenStatusBarStyle;
+
+/// defalut is UIStatusBarAnimationSlide.
+@property (nonatomic, assign) UIStatusBarAnimation fullScreenStatusBarAnimation;
+
+/// The fullscreen statusbar hidden.
+@property (nonatomic, getter=isStatusBarHidden) BOOL statusBarHidden;
+
 /**
  Add the device orientation observer.
  */
@@ -325,10 +332,28 @@ NS_ASSUME_NONNULL_BEGIN
 /**
  Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
 
- @param orientation UIInterfaceOrientation
+ @param orientation is UIInterfaceOrientation.
  @param animated is animated.
+*/
+- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated;
+
+/**
+ Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
+
+ @param orientation is UIInterfaceOrientation.
+ @param animated is animated.
+ @param completion rotating completed callback.
+*/
+- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated completion:(void(^ __nullable)(void))completion;
+
+/**
+ Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModePortrait.
+
+ @param fullScreen is fullscreen.
+ @param animated is animated.
+ @param completion rotating completed callback.
  */
-- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated;
+- (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void(^ __nullable)(void))completion;
 
 /**
  Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModePortrait.
@@ -343,6 +368,15 @@ NS_ASSUME_NONNULL_BEGIN
 
  @param fullScreen is fullscreen.
  @param animated is animated.
+ @param completion rotating completed callback.
+ */
+- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void(^ __nullable)(void))completion;
+
+/**
+ FullScreen mode is determined by ZFFullScreenMode.
+
+ @param fullScreen is fullscreen.
+ @param animated is animated.
  */
 - (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated;
 
@@ -436,37 +470,74 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)zf_filterShouldPlayCellWhileScrolling:(void (^ __nullable)(NSIndexPath *indexPath))handler;
 
 /**
+ Play the indexPath of url without scroll postion,  while the `assetURLs` or `sectionAssetURLs` is not NULL.
+ 
+ @param indexPath Play the indexPath of url.
+ */
+- (void)playTheIndexPath:(NSIndexPath *)indexPath;
+
+/**
  Play the indexPath of url, while the `assetURLs` or `sectionAssetURLs` is not NULL.
 
  @param indexPath Play the indexPath of url.
+ @param scrollPosition scroll position.
+ @param animated scroll animation.
  */
-- (void)playTheIndexPath:(NSIndexPath *)indexPath;
+- (void)playTheIndexPath:(NSIndexPath *)indexPath
+          scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                animated:(BOOL)animated;
 
 /**
- Play the indexPath of url ,while the `assetURLs` or `sectionAssetURLs` is not NULL.
+ Play the indexPath of url with scroll postion, while the `assetURLs` or `sectionAssetURLs` is not NULL.
+ 
+ @param indexPath Play the indexPath of url.
+ @param scrollPosition scroll position.
+ @param animated scroll animation.
+ @param completionHandler Scroll completion callback.
+ */
+- (void)playTheIndexPath:(NSIndexPath *)indexPath
+          scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                animated:(BOOL)animated
+       completionHandler:(void (^ __nullable)(void))completionHandler;
+
+
+/**
+ Play the indexPath of url with scroll postion.
  
  @param indexPath Play the indexPath of url
- @param scrollToTop Scroll the current cell to top with animations.
+ @param assetURL The player URL.
  */
-- (void)playTheIndexPath:(NSIndexPath *)indexPath scrollToTop:(BOOL)scrollToTop;
+- (void)playTheIndexPath:(NSIndexPath *)indexPath assetURL:(NSURL *)assetURL;
+
 
 /**
- Play the indexPath of url ,while the `assetURLs` or `sectionAssetURLs` is not NULL.
+ Play the indexPath of url with scroll postion.
  
  @param indexPath Play the indexPath of url
  @param assetURL The player URL.
- @param scrollToTop Scroll the current cell to top with animations.
+ @param scrollPosition  scroll position.
+ @param animated scroll animation.
  */
-- (void)playTheIndexPath:(NSIndexPath *)indexPath assetURL:(NSURL *)assetURL scrollToTop:(BOOL)scrollToTop;
+- (void)playTheIndexPath:(NSIndexPath *)indexPath
+                assetURL:(NSURL *)assetURL
+          scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                animated:(BOOL)animated;
 
 /**
- Play the indexPath of url ,while the `assetURLs` or `sectionAssetURLs` is not NULL.
+ Play the indexPath of url with scroll postion.
  
  @param indexPath Play the indexPath of url
- @param scrollToTop scroll the current cell to top with animations.
+ @param assetURL The player URL.
+ @param scrollPosition  scroll position.
+ @param animated scroll animation.
  @param completionHandler Scroll completion callback.
  */
-- (void)playTheIndexPath:(NSIndexPath *)indexPath scrollToTop:(BOOL)scrollToTop completionHandler:(void (^ __nullable)(void))completionHandler;
+- (void)playTheIndexPath:(NSIndexPath *)indexPath
+                assetURL:(NSURL *)assetURL
+          scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                animated:(BOOL)animated
+       completionHandler:(void (^ __nullable)(void))completionHandler;
+
 
 @end
 
@@ -484,6 +555,54 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (void)updateNoramlPlayerWithContainerView:(UIView *)containerView __attribute__((deprecated("use `addPlayerViewToContainerView:` instead.")));
 
+/**
+ Play the indexPath of url ,while the `assetURLs` or `sectionAssetURLs` is not NULL.
+ 
+ @param indexPath Play the indexPath of url
+ @param scrollToTop Scroll the current cell to top with animations.
+ */
+- (void)playTheIndexPath:(NSIndexPath *)indexPath scrollToTop:(BOOL)scrollToTop  __attribute__((deprecated("use `playTheIndexPath:scrollPosition:animated:` instead.")));
+
+/**
+ Play the indexPath of url with scroll postion.
+ 
+ @param indexPath Play the indexPath of url
+ @param assetURL The player URL.
+ @param scrollToTop Scroll the current cell to top with animations.
+ */
+- (void)playTheIndexPath:(NSIndexPath *)indexPath assetURL:(NSURL *)assetURL scrollToTop:(BOOL)scrollToTop  __attribute__((deprecated("use `playTheIndexPath:assetURL:scrollPosition:animated:` instead.")));
+
+/**
+ Play the indexPath of url ,while the `assetURLs` or `sectionAssetURLs` is not NULL.
+ 
+ @param indexPath Play the indexPath of url
+ @param scrollToTop scroll the current cell to top with animations.
+ @param completionHandler Scroll completion callback.
+ */
+- (void)playTheIndexPath:(NSIndexPath *)indexPath scrollToTop:(BOOL)scrollToTop completionHandler:(void (^ __nullable)(void))completionHandler  __attribute__((deprecated("use `playTheIndexPath:scrollPosition:animated:completionHandler:` instead.")));
+
+/**
+ Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
+
+ @param orientation UIInterfaceOrientation
+ @param animated is animated.
+ @param completion rotating completed callback.
+ */
+- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated completion:(void(^ __nullable)(void))completion __attribute__((deprecated("use `rotateToOrientation:animated:completion:` instead.")));
+
+/**
+ Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
+
+ @param orientation UIInterfaceOrientation
+ @param animated is animated.
+ */
+- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated __attribute__((deprecated("use `rotateToOrientation:animated:` instead.")));
+
+/**
+ Add to the keyWindow.
+ */
+- (void)addPlayerViewToKeyWindow __attribute__((deprecated("use `addPlayerViewToSmallFloatView` instead.")));;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 269 - 112
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerController.m

@@ -28,7 +28,9 @@
 #import <AVFoundation/AVFoundation.h>
 #import "UIScrollView+ZFPlayer.h"
 #import "ZFReachabilityManager.h"
-#import "ZFPlayer.h"
+#import "ZFPlayerConst.h"
+
+static NSMutableDictionary <NSString* ,NSNumber *> *_zfPlayRecords;
 
 @interface ZFPlayerController ()
 
@@ -48,13 +50,21 @@
 
 @implementation ZFPlayerController
 
+@dynamic scrollView;
+@dynamic containerViewTag;
+@dynamic playingIndexPath;
+
 - (instancetype)init {
     self = [super init];
     if (self) {
-        @weakify(self)
+        static dispatch_once_t onceToken;
+        dispatch_once(&onceToken, ^{
+            _zfPlayRecords = @{}.mutableCopy;
+        });
+        @zf_weakify(self)
         [[ZFReachabilityManager sharedManager] startMonitoring];
         [[ZFReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(ZFReachabilityStatus status) {
-            @strongify(self)
+            @zf_strongify(self)
             if ([self.controlView respondsToSelector:@selector(videoPlayer:reachabilityChanged:)]) {
                 [self.controlView videoPlayer:self reachabilityChanged:status];
             }
@@ -122,10 +132,13 @@
 }
 
 - (void)playerManagerCallbcak {
-    @weakify(self)
+    @zf_weakify(self)
     self.currentPlayerManager.playerPrepareToPlay = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset, NSURL * _Nonnull assetURL) {
-        @strongify(self)
-        self.currentPlayerManager.view.hidden = NO;
+        @zf_strongify(self)
+        if (self.resumePlayRecord && [_zfPlayRecords valueForKey:assetURL.absoluteString]) {
+            NSTimeInterval seekTime = [_zfPlayRecords valueForKey:assetURL.absoluteString].doubleValue;
+            self.currentPlayerManager.seekTime = seekTime;
+        }
         [self.notification addNotification];
         [self addDeviceOrientationObserver];
         if (self.scrollView) {
@@ -139,7 +152,7 @@
     };
     
     self.currentPlayerManager.playerReadyToPlay = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset, NSURL * _Nonnull assetURL) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.playerReadyToPlay) self.playerReadyToPlay(asset,assetURL);
         if (!self.customAudioSession) {
             // Apps using this category don't mute when the phone's mute button is turned on, but play sound when the phone is silent
@@ -150,15 +163,18 @@
     };
     
     self.currentPlayerManager.playerPlayTimeChanged = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset, NSTimeInterval currentTime, NSTimeInterval duration) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.playerPlayTimeChanged) self.playerPlayTimeChanged(asset,currentTime,duration);
         if ([self.controlView respondsToSelector:@selector(videoPlayer:currentTime:totalTime:)]) {
             [self.controlView videoPlayer:self currentTime:currentTime totalTime:duration];
         }
+        if (self.currentPlayerManager.assetURL.absoluteString) {
+            [_zfPlayRecords setValue:@(currentTime) forKey:self.currentPlayerManager.assetURL.absoluteString];
+        }
     };
     
     self.currentPlayerManager.playerBufferTimeChanged = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset, NSTimeInterval bufferTime) {
-        @strongify(self)
+        @zf_strongify(self)
         if ([self.controlView respondsToSelector:@selector(videoPlayer:bufferTime:)]) {
             [self.controlView videoPlayer:self bufferTime:bufferTime];
         }
@@ -166,7 +182,7 @@
     };
     
     self.currentPlayerManager.playerPlayStateChanged = ^(id  _Nonnull asset, ZFPlayerPlaybackState playState) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.playerPlayStateChanged) self.playerPlayStateChanged(asset, playState);
         if ([self.controlView respondsToSelector:@selector(videoPlayer:playStateChanged:)]) {
             [self.controlView videoPlayer:self playStateChanged:playState];
@@ -174,7 +190,11 @@
     };
     
     self.currentPlayerManager.playerLoadStateChanged = ^(id  _Nonnull asset, ZFPlayerLoadState loadState) {
-        @strongify(self)
+        @zf_strongify(self)
+        if (loadState == ZFPlayerLoadStatePrepare && CGSizeEqualToSize(CGSizeZero, self.currentPlayerManager.presentationSize)) {
+            CGSize size = self.currentPlayerManager.view.frame.size;
+            self.orientationObserver.presentationSize = size;
+        }
         if (self.playerLoadStateChanged) self.playerLoadStateChanged(asset, loadState);
         if ([self.controlView respondsToSelector:@selector(videoPlayer:loadStateChanged:)]) {
             [self.controlView videoPlayer:self loadStateChanged:loadState];
@@ -182,7 +202,10 @@
     };
     
     self.currentPlayerManager.playerDidToEnd = ^(id  _Nonnull asset) {
-        @strongify(self)
+        @zf_strongify(self)
+        if (self.currentPlayerManager.assetURL.absoluteString) {
+            [_zfPlayRecords setValue:@(0) forKey:self.currentPlayerManager.assetURL.absoluteString];
+        }
         if (self.playerDidToEnd) self.playerDidToEnd(asset);
         if ([self.controlView respondsToSelector:@selector(videoPlayerPlayEnd:)]) {
             [self.controlView videoPlayerPlayEnd:self];
@@ -190,7 +213,7 @@
     };
     
     self.currentPlayerManager.playerPlayFailed = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset, id  _Nonnull error) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.playerPlayFailed) self.playerPlayFailed(asset, error);
         if ([self.controlView respondsToSelector:@selector(videoPlayerPlayFailed:error:)]) {
             [self.controlView videoPlayerPlayFailed:self error:error];
@@ -198,7 +221,8 @@
     };
     
     self.currentPlayerManager.presentationSizeChanged = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset, CGSize size){
-        @strongify(self)
+        @zf_strongify(self)
+        self.orientationObserver.presentationSize = size;
         if (self.orientationObserver.fullScreenMode == ZFFullScreenModeAutomatic) {
             if (size.width > size.height) {
                 self.orientationObserver.fullScreenMode = ZFFullScreenModeLandscape;
@@ -214,7 +238,7 @@
 }
 
 - (void)layoutPlayerSubViews {
-    if (self.containerView && self.currentPlayerManager.view) {
+    if (self.containerView && self.currentPlayerManager.view && self.currentPlayerManager.isPreparedToPlay) {
         UIView *superview = nil;
         if (self.isFullScreen) {
             superview = self.orientationObserver.fullScreenContainerView;
@@ -237,9 +261,9 @@
 - (ZFPlayerNotification *)notification {
     if (!_notification) {
         _notification = [[ZFPlayerNotification alloc] init];
-        @weakify(self)
+        @zf_weakify(self)
         _notification.willResignActive = ^(ZFPlayerNotification * _Nonnull registrar) {
-            @strongify(self)
+            @zf_strongify(self)
             if (self.isViewControllerDisappear) return;
             if (self.pauseWhenAppResignActive && self.currentPlayerManager.isPlaying) {
                 self.pauseByEvent = YES;
@@ -252,13 +276,13 @@
             }
         };
         _notification.didBecomeActive = ^(ZFPlayerNotification * _Nonnull registrar) {
-            @strongify(self)
+            @zf_strongify(self)
             if (self.isViewControllerDisappear) return;
             if (self.isPauseByEvent) self.pauseByEvent = NO;
             self.orientationObserver.lockedScreen = NO;
         };
         _notification.oldDeviceUnavailable = ^(ZFPlayerNotification * _Nonnull registrar) {
-            @strongify(self)
+            @zf_strongify(self)
             if (self.currentPlayerManager.isPlaying) {
                 [self.currentPlayerManager play];
             }
@@ -283,17 +307,19 @@
     if (_currentPlayerManager.isPreparedToPlay) {
         [_currentPlayerManager stop];
         [_currentPlayerManager.view removeFromSuperview];
-        [self.orientationObserver removeDeviceOrientationObserver];
+        [self removeDeviceOrientationObserver];
         [self.gestureControl removeGestureToView:self.currentPlayerManager.view];
     }
     _currentPlayerManager = currentPlayerManager;
-    _currentPlayerManager.view.hidden = YES;
     self.gestureControl.disableTypes = self.disableGestureTypes;
     [self.gestureControl addGestureToView:currentPlayerManager.view];
     [self playerManagerCallbcak];
-    [self.orientationObserver updateRotateView:currentPlayerManager.view containerView:self.containerView];
     self.controlView.player = self;
     [self layoutPlayerSubViews];
+    if (currentPlayerManager.isPreparedToPlay) {
+        [self addDeviceOrientationObserver];
+    }
+    [self.orientationObserver updateRotateView:currentPlayerManager.view containerView:self.containerView];
 }
 
 - (void)setContainerView:(UIView *)containerView {
@@ -304,9 +330,13 @@
     if (!containerView) return;
     containerView.userInteractionEnabled = YES;
     [self layoutPlayerSubViews];
+    [self.orientationObserver updateRotateView:self.currentPlayerManager.view containerView:containerView];
 }
 
 - (void)setControlView:(UIView<ZFPlayerMediaControl> *)controlView {
+    if (controlView && controlView != _controlView) {
+        [_controlView removeFromSuperview];
+    }
     _controlView = controlView;
     if (!controlView) return;
     controlView.player = self;
@@ -384,16 +414,20 @@
 }
 
 - (void)stop {
-    [self.notification removeNotification];
-    [self.orientationObserver removeDeviceOrientationObserver];
     if (self.isFullScreen && self.exitFullScreenWhenStop) {
-        [self.orientationObserver exitFullScreenWithAnimated:NO];
-    }
-    [self.currentPlayerManager stop];
-    [self.currentPlayerManager.view removeFromSuperview];
-    if (self.scrollView) {
-        self.scrollView.zf_stopPlay = YES;
+        @zf_weakify(self)
+        [self.orientationObserver enterFullScreen:NO animated:NO completion:^{
+            @zf_strongify(self)
+            [self.currentPlayerManager stop];
+            [self.currentPlayerManager.view removeFromSuperview];
+        }];
+    } else {
+        [self.currentPlayerManager stop];
+        [self.currentPlayerManager.view removeFromSuperview];
     }
+    if (self.scrollView) self.scrollView.zf_stopPlay = YES;
+    [self.notification removeNotification];
+    [self.orientationObserver removeDeviceOrientationObserver];
 }
 
 - (void)replaceCurrentPlayerManager:(id<ZFPlayerMediaPlayback>)playerManager {
@@ -409,7 +443,7 @@
     [self.containerView addSubview:self.currentPlayerManager.view];
     self.currentPlayerManager.view.frame = self.containerView.bounds;
     self.currentPlayerManager.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.orientationObserver cellModelRotateView:self.currentPlayerManager.view rotateViewAtCell:cell playerViewTag:self.containerViewTag];
+    [self.orientationObserver updateRotateView:self.currentPlayerManager.view rotateViewAtCell:cell playerViewTag:self.containerViewTag];
     if ([self.controlView respondsToSelector:@selector(videoPlayer:floatViewShow:)]) {
         [self.controlView videoPlayer:self floatViewShow:NO];
     }
@@ -423,20 +457,19 @@
     [self.containerView addSubview:self.currentPlayerManager.view];
     self.currentPlayerManager.view.frame = self.containerView.bounds;
     self.currentPlayerManager.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.orientationObserver cellOtherModelRotateView:self.currentPlayerManager.view containerView:self.containerView];
+    [self.orientationObserver updateRotateView:self.currentPlayerManager.view containerView:self.containerView];
     if ([self.controlView respondsToSelector:@selector(videoPlayer:floatViewShow:)]) {
         [self.controlView videoPlayer:self floatViewShow:NO];
     }
 }
 
-/// Add to the keyWindow
-- (void)addPlayerViewToKeyWindow {
+- (void)addPlayerViewToSmallFloatView {
     self.isSmallFloatViewShow = YES;
     self.smallFloatView.hidden = NO;
     [self.smallFloatView addSubview:self.currentPlayerManager.view];
     self.currentPlayerManager.view.frame = self.smallFloatView.bounds;
     self.currentPlayerManager.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-    [self.orientationObserver cellOtherModelRotateView:self.currentPlayerManager.view containerView:self.smallFloatView];
+    [self.orientationObserver updateRotateView:self.currentPlayerManager.view containerView:self.smallFloatView];
     if ([self.controlView respondsToSelector:@selector(videoPlayer:floatViewShow:)]) {
         [self.controlView videoPlayer:self floatViewShow:YES];
     }
@@ -461,6 +494,10 @@
 
 #pragma mark - getter
 
+- (BOOL)resumePlayRecord {
+    return [objc_getAssociatedObject(self, _cmd) boolValue];
+}
+
 - (NSURL *)assetURL {
     return objc_getAssociatedObject(self, _cmd);
 }
@@ -471,14 +508,14 @@
 
 - (BOOL)isLastAssetURL {
     if (self.assetURLs.count > 0) {
-        return self.assetURL == self.assetURLs.lastObject;
+        return [self.assetURL isEqual:self.assetURLs.lastObject];
     }
     return NO;
 }
 
 - (BOOL)isFirstAssetURL {
     if (self.assetURLs.count > 0) {
-        return self.assetURL == self.assetURLs.firstObject;
+        return [self.assetURL isEqual:self.assetURLs.firstObject];
     }
     return NO;
 }
@@ -572,6 +609,10 @@
 
 #pragma mark - setter
 
+- (void)setResumePlayRecord:(BOOL)resumePlayRecord {
+    objc_setAssociatedObject(self, @selector(resumePlayRecord), @(resumePlayRecord), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
 - (void)setAssetURL:(NSURL *)assetURL {
     objc_setAssociatedObject(self, @selector(assetURL), assetURL, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
     self.currentPlayerManager.assetURL = assetURL;
@@ -668,9 +709,11 @@
     if (viewControllerDisappear) {
         [self removeDeviceOrientationObserver];
         if (self.currentPlayerManager.isPlaying) self.pauseByEvent = YES;
+        if (self.isSmallFloatViewShow) self.smallFloatView.hidden = YES;
     } else {
-        if (self.isPauseByEvent) self.pauseByEvent = NO;
         [self addDeviceOrientationObserver];
+        if (self.isPauseByEvent) self.pauseByEvent = NO;
+        if (self.isSmallFloatViewShow) self.smallFloatView.hidden = NO;
     }
 }
 
@@ -683,46 +726,58 @@
 @implementation ZFPlayerController (ZFPlayerOrientationRotation)
 
 - (void)addDeviceOrientationObserver {
-    [self.orientationObserver addDeviceOrientationObserver];
+    if (self.allowOrentitaionRotation) {
+        [self.orientationObserver addDeviceOrientationObserver];
+    }
 }
 
 - (void)removeDeviceOrientationObserver {
     [self.orientationObserver removeDeviceOrientationObserver];
 }
 
-- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
+/// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
+- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
+    [self rotateToOrientation:orientation animated:animated completion:nil];
+}
+
+/// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
+- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated completion:(void(^ __nullable)(void))completion {
     self.orientationObserver.fullScreenMode = ZFFullScreenModeLandscape;
-    [self.orientationObserver enterLandscapeFullScreen:orientation animated:animated];
+    [self.orientationObserver rotateToOrientation:orientation animated:animated completion:nil];
 }
 
-- (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated {
+- (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void (^ _Nullable)(void))completion {
     self.orientationObserver.fullScreenMode = ZFFullScreenModePortrait;
-    [self.orientationObserver enterPortraitFullScreen:fullScreen animated:animated];
+    [self.orientationObserver enterPortraitFullScreen:fullScreen animated:animated completion:completion];
 }
 
-- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated {
+- (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated {
+    [self enterPortraitFullScreen:fullScreen animated:animated completion:nil];
+}
+
+- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void (^ _Nullable)(void))completion {
     if (self.orientationObserver.fullScreenMode == ZFFullScreenModePortrait) {
-        [self.orientationObserver enterPortraitFullScreen:fullScreen animated:animated];
+        [self.orientationObserver enterPortraitFullScreen:fullScreen animated:animated completion:completion];
     } else {
         UIInterfaceOrientation orientation = UIInterfaceOrientationUnknown;
         orientation = fullScreen? UIInterfaceOrientationLandscapeRight : UIInterfaceOrientationPortrait;
-        [self.orientationObserver enterLandscapeFullScreen:orientation animated:animated];
+        [self.orientationObserver rotateToOrientation:orientation animated:animated completion:completion];
     }
 }
 
-- (BOOL)shouldForceDeviceOrientation {
-    return self.forceDeviceOrientation;
+- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated {
+    [self enterFullScreen:fullScreen animated:animated completion:nil];
 }
 
 #pragma mark - getter
 
 - (ZFOrientationObserver *)orientationObserver {
-    @weakify(self)
+    @zf_weakify(self)
     ZFOrientationObserver *orientationObserver = objc_getAssociatedObject(self, _cmd);
     if (!orientationObserver) {
         orientationObserver = [[ZFOrientationObserver alloc] init];
         orientationObserver.orientationWillChange = ^(ZFOrientationObserver * _Nonnull observer, BOOL isFullScreen) {
-            @strongify(self)
+            @zf_strongify(self)
             if (self.orientationWillChange) self.orientationWillChange(self, isFullScreen);
             if ([self.controlView respondsToSelector:@selector(videoPlayer:orientationWillChange:)]) {
                 [self.controlView videoPlayer:self orientationWillChange:observer];
@@ -731,7 +786,7 @@
             [self.controlView layoutIfNeeded];
         };
         orientationObserver.orientationDidChanged = ^(ZFOrientationObserver * _Nonnull observer, BOOL isFullScreen) {
-            @strongify(self)
+            @zf_strongify(self)
             if (self.orientationDidChanged) self.orientationDidChanged(self, isFullScreen);
             if ([self.controlView respondsToSelector:@selector(videoPlayer:orientationDidChanged:)]) {
                 [self.controlView videoPlayer:self orientationDidChanged:observer];
@@ -774,7 +829,7 @@
 }
 
 - (BOOL)shouldAutorotate {
-    return [self shouldForceDeviceOrientation];
+    return NO;
 }
 
 - (BOOL)allowOrentitaionRotation {
@@ -784,8 +839,18 @@
     return YES;
 }
 
-- (BOOL)forceDeviceOrientation {
-    return [objc_getAssociatedObject(self, _cmd) boolValue];
+- (UIStatusBarStyle)fullScreenStatusBarStyle {
+    NSNumber *number = objc_getAssociatedObject(self, _cmd);
+    if (number) return number.integerValue;
+    self.fullScreenStatusBarStyle = UIStatusBarStyleLightContent;
+    return UIStatusBarStyleLightContent;
+}
+
+- (UIStatusBarAnimation)fullScreenStatusBarAnimation {
+    NSNumber *number = objc_getAssociatedObject(self, _cmd);
+    if (number) return number.integerValue;
+    self.fullScreenStatusBarAnimation = UIStatusBarAnimationSlide;
+    return UIStatusBarAnimationSlide;
 }
 
 #pragma mark - setter
@@ -800,7 +865,7 @@
 
 - (void)setStatusBarHidden:(BOOL)statusBarHidden {
     objc_setAssociatedObject(self, @selector(isStatusBarHidden), @(statusBarHidden), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-    self.orientationObserver.statusBarHidden = statusBarHidden;
+    self.orientationObserver.fullScreenStatusBarHidden = statusBarHidden;
 }
 
 - (void)setLockedScreen:(BOOL)lockedScreen {
@@ -813,18 +878,23 @@
 
 - (void)setAllowOrentitaionRotation:(BOOL)allowOrentitaionRotation {
     objc_setAssociatedObject(self, @selector(allowOrentitaionRotation), @(allowOrentitaionRotation), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-    self.orientationObserver.allowOrentitaionRotation = allowOrentitaionRotation;
-}
-
-- (void)setForceDeviceOrientation:(BOOL)forceDeviceOrientation {
-    objc_setAssociatedObject(self, @selector(forceDeviceOrientation), @(forceDeviceOrientation), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-    self.orientationObserver.forceDeviceOrientation = forceDeviceOrientation;
+    self.orientationObserver.allowOrientationRotation = allowOrentitaionRotation;
 }
 
 - (void)setExitFullScreenWhenStop:(BOOL)exitFullScreenWhenStop {
     objc_setAssociatedObject(self, @selector(exitFullScreenWhenStop), @(exitFullScreenWhenStop), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
 }
 
+- (void)setFullScreenStatusBarStyle:(UIStatusBarStyle)fullScreenStatusBarStyle {
+    objc_setAssociatedObject(self, @selector(fullScreenStatusBarStyle), @(fullScreenStatusBarStyle), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+    self.orientationObserver.fullScreenStatusBarStyle = fullScreenStatusBarStyle;
+}
+
+- (void)setFullScreenStatusBarAnimation:(UIStatusBarAnimation)fullScreenStatusBarAnimation {
+    objc_setAssociatedObject(self, @selector(fullScreenStatusBarAnimation), @(fullScreenStatusBarAnimation), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+    self.orientationObserver.fullScreenStatusBarAnimation = fullScreenStatusBarAnimation;
+}
+
 @end
 
 
@@ -836,9 +906,9 @@
     ZFPlayerGestureControl *gestureControl = objc_getAssociatedObject(self, _cmd);
     if (!gestureControl) {
         gestureControl = [[ZFPlayerGestureControl alloc] init];
-        @weakify(self)
+        @zf_weakify(self)
         gestureControl.triggerCondition = ^BOOL(ZFPlayerGestureControl * _Nonnull control, ZFPlayerGestureType type, UIGestureRecognizer * _Nonnull gesture, UITouch *touch) {
-            @strongify(self)
+            @zf_strongify(self)
             if ([self.controlView respondsToSelector:@selector(gestureTriggerCondition:gestureType:gestureRecognizer:touch:)]) {
                 return [self.controlView gestureTriggerCondition:control gestureType:type gestureRecognizer:gesture touch:touch];
             }
@@ -846,42 +916,42 @@
         };
         
         gestureControl.singleTapped = ^(ZFPlayerGestureControl * _Nonnull control) {
-            @strongify(self)
+            @zf_strongify(self)
             if ([self.controlView respondsToSelector:@selector(gestureSingleTapped:)]) {
                 [self.controlView gestureSingleTapped:control];
             }
         };
         
         gestureControl.doubleTapped = ^(ZFPlayerGestureControl * _Nonnull control) {
-            @strongify(self)
+            @zf_strongify(self)
             if ([self.controlView respondsToSelector:@selector(gestureDoubleTapped:)]) {
                 [self.controlView gestureDoubleTapped:control];
             }
         };
         
         gestureControl.beganPan = ^(ZFPlayerGestureControl * _Nonnull control, ZFPanDirection direction, ZFPanLocation location) {
-            @strongify(self)
+            @zf_strongify(self)
             if ([self.controlView respondsToSelector:@selector(gestureBeganPan:panDirection:panLocation:)]) {
                 [self.controlView gestureBeganPan:control panDirection:direction panLocation:location];
             }
         };
         
         gestureControl.changedPan = ^(ZFPlayerGestureControl * _Nonnull control, ZFPanDirection direction, ZFPanLocation location, CGPoint velocity) {
-            @strongify(self)
+            @zf_strongify(self)
             if ([self.controlView respondsToSelector:@selector(gestureChangedPan:panDirection:panLocation:withVelocity:)]) {
                 [self.controlView gestureChangedPan:control panDirection:direction panLocation:location withVelocity:velocity];
             }
         };
         
         gestureControl.endedPan = ^(ZFPlayerGestureControl * _Nonnull control, ZFPanDirection direction, ZFPanLocation location) {
-            @strongify(self)
+            @zf_strongify(self)
             if ([self.controlView respondsToSelector:@selector(gestureEndedPan:panDirection:panLocation:)]) {
                 [self.controlView gestureEndedPan:control panDirection:direction panLocation:location];
             }
         };
         
         gestureControl.pinched = ^(ZFPlayerGestureControl * _Nonnull control, float scale) {
-            @strongify(self)
+            @zf_strongify(self)
             if ([self.controlView respondsToSelector:@selector(gesturePinched:scale:)]) {
                 [self.controlView gesturePinched:control scale:scale];
             }
@@ -915,7 +985,7 @@
 
 @implementation ZFPlayerController (ZFPlayerScrollView)
 
-+ (void)load {
++ (void)initialize {
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         SEL selectors[] = {
@@ -947,9 +1017,9 @@
 - (void)setScrollView:(UIScrollView *)scrollView {
     objc_setAssociatedObject(self, @selector(scrollView), scrollView, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
     self.scrollView.zf_WWANAutoPlay = self.isWWANAutoPlay;
-    @weakify(self)
+    @zf_weakify(self)
     scrollView.zf_playerWillAppearInScrollView = ^(NSIndexPath * _Nonnull indexPath) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.isFullScreen) return;
         if (self.zf_playerWillAppearInScrollView) self.zf_playerWillAppearInScrollView(indexPath);
         if ([self.controlView respondsToSelector:@selector(playerDidAppearInScrollView:)]) {
@@ -958,7 +1028,7 @@
     };
     
     scrollView.zf_playerDidAppearInScrollView = ^(NSIndexPath * _Nonnull indexPath) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.isFullScreen) return;
         if (self.zf_playerDidAppearInScrollView) self.zf_playerDidAppearInScrollView(indexPath);
         if ([self.controlView respondsToSelector:@selector(playerDidAppearInScrollView:)]) {
@@ -967,7 +1037,7 @@
     };
     
     scrollView.zf_playerWillDisappearInScrollView = ^(NSIndexPath * _Nonnull indexPath) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.isFullScreen) return;
         if (self.zf_playerWillDisappearInScrollView) self.zf_playerWillDisappearInScrollView(indexPath);
         if ([self.controlView respondsToSelector:@selector(playerWillDisappearInScrollView:)]) {
@@ -976,16 +1046,28 @@
     };
     
     scrollView.zf_playerDidDisappearInScrollView = ^(NSIndexPath * _Nonnull indexPath) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.isFullScreen) return;
         if (self.zf_playerDidDisappearInScrollView) self.zf_playerDidDisappearInScrollView(indexPath);
         if ([self.controlView respondsToSelector:@selector(playerDidDisappearInScrollView:)]) {
             [self.controlView playerDidDisappearInScrollView:self];
         }
+       
+        if (self.stopWhileNotVisible) { /// stop playing
+            if (self.containerType == ZFPlayerContainerTypeView) {
+                [self stopCurrentPlayingView];
+            } else if (self.containerType == ZFPlayerContainerTypeCell) {
+                [self stopCurrentPlayingCell];
+            }
+        } else { /// add to window
+            if (!self.isSmallFloatViewShow) {
+                [self addPlayerViewToSmallFloatView];
+            }
+        }
     };
     
     scrollView.zf_playerAppearingInScrollView = ^(NSIndexPath * _Nonnull indexPath, CGFloat playerApperaPercent) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.isFullScreen) return;
         if (self.zf_playerAppearingInScrollView) self.zf_playerAppearingInScrollView(indexPath, playerApperaPercent);
         if ([self.controlView respondsToSelector:@selector(playerAppearingInScrollView:playerApperaPercent:)]) {
@@ -993,39 +1075,46 @@
         }
         if (!self.stopWhileNotVisible && playerApperaPercent >= self.playerApperaPercent) {
             if (self.containerType == ZFPlayerContainerTypeView) {
-                [self addPlayerViewToContainerView:self.containerView];
+                if (self.isSmallFloatViewShow) {
+                    [self addPlayerViewToContainerView:self.containerView];
+                }
             } else if (self.containerType == ZFPlayerContainerTypeCell) {
-                [self addPlayerViewToCell];
+                if (self.isSmallFloatViewShow) {
+                    [self addPlayerViewToCell];
+                }
             }
         }
     };
     
     scrollView.zf_playerDisappearingInScrollView = ^(NSIndexPath * _Nonnull indexPath, CGFloat playerDisapperaPercent) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.isFullScreen) return;
         if (self.zf_playerDisappearingInScrollView) self.zf_playerDisappearingInScrollView(indexPath, playerDisapperaPercent);
         if ([self.controlView respondsToSelector:@selector(playerDisappearingInScrollView:playerDisapperaPercent:)]) {
             [self.controlView playerDisappearingInScrollView:self playerDisapperaPercent:playerDisapperaPercent];
         }
-        /// stop playing
-        if (self.stopWhileNotVisible && playerDisapperaPercent >= self.playerDisapperaPercent) {
-            if (self.containerType == ZFPlayerContainerTypeView) {
-                [self stopCurrentPlayingView];
-            } else if (self.containerType == ZFPlayerContainerTypeCell) {
-                [self stopCurrentPlayingCell];
+        if (playerDisapperaPercent >= self.playerDisapperaPercent) {
+            if (self.stopWhileNotVisible) { /// stop playing
+                if (self.containerType == ZFPlayerContainerTypeView) {
+                    [self stopCurrentPlayingView];
+                } else if (self.containerType == ZFPlayerContainerTypeCell) {
+                    [self stopCurrentPlayingCell];
+                }
+            } else {  /// add to window
+                if (!self.isSmallFloatViewShow) {
+                    [self addPlayerViewToSmallFloatView];
+                }
             }
         }
-        /// add to window
-        if (!self.stopWhileNotVisible && playerDisapperaPercent >= self.playerDisapperaPercent) [self addPlayerViewToKeyWindow];
     };
     
     scrollView.zf_playerShouldPlayInScrollView = ^(NSIndexPath * _Nonnull indexPath) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.zf_playerShouldPlayInScrollView) self.zf_playerShouldPlayInScrollView(indexPath);
     };
     
     scrollView.zf_scrollViewDidEndScrollingCallback = ^(NSIndexPath * _Nonnull indexPath) {
-        @strongify(self)
+        @zf_strongify(self)
         if (self.zf_scrollViewDidEndScrollingCallback) self.zf_scrollViewDidEndScrollingCallback(indexPath);
     };
 }
@@ -1048,14 +1137,12 @@
 - (void)setPlayingIndexPath:(NSIndexPath *)playingIndexPath {
     objc_setAssociatedObject(self, @selector(playingIndexPath), playingIndexPath, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
     if (playingIndexPath) {
-        // Stop the current playing cell video.
-        [self stop];
         self.isSmallFloatViewShow = NO;
         if (self.smallFloatView) self.smallFloatView.hidden = YES;
         
         UIView *cell = [self.scrollView zf_getCellForIndexPath:playingIndexPath];
         self.containerView = [cell viewWithTag:self.containerViewTag];
-        [self.orientationObserver cellModelRotateView:self.currentPlayerManager.view rotateViewAtCell:cell playerViewTag:self.containerViewTag];
+        [self.orientationObserver updateRotateView:self.currentPlayerManager.view rotateViewAtCell:cell playerViewTag:self.containerViewTag];
         [self addDeviceOrientationObserver];
         self.scrollView.zf_playingIndexPath = playingIndexPath;
         [self layoutPlayerSubViews];
@@ -1223,6 +1310,81 @@
     self.assetURL = assetURL;
 }
 
+
+- (void)playTheIndexPath:(NSIndexPath *)indexPath scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition animated:(BOOL)animated {
+    [self playTheIndexPath:indexPath scrollPosition:scrollPosition animated:animated completionHandler:nil];
+}
+
+- (void)playTheIndexPath:(NSIndexPath *)indexPath scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition animated:(BOOL)animated completionHandler:(void (^ __nullable)(void))completionHandler {
+    NSURL *assetURL;
+    if (self.sectionAssetURLs.count) {
+        assetURL = self.sectionAssetURLs[indexPath.section][indexPath.row];
+    } else if (self.assetURLs.count) {
+        assetURL = self.assetURLs[indexPath.row];
+        self.currentPlayIndex = indexPath.row;
+    }
+    @zf_weakify(self)
+    [self.scrollView zf_scrollToRowAtIndexPath:indexPath atScrollPosition:scrollPosition animated:animated completionHandler:^{
+        @zf_strongify(self)
+        if (completionHandler) completionHandler();
+        self.playingIndexPath = indexPath;
+        self.assetURL = assetURL;
+    }];
+}
+
+
+- (void)playTheIndexPath:(NSIndexPath *)indexPath assetURL:(NSURL *)assetURL {
+    self.playingIndexPath = indexPath;
+    self.assetURL = assetURL;
+}
+
+
+- (void)playTheIndexPath:(NSIndexPath *)indexPath
+                assetURL:(NSURL *)assetURL
+          scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                animated:(BOOL)animated {
+    [self playTheIndexPath:indexPath assetURL:assetURL scrollPosition:scrollPosition animated:animated completionHandler:nil];
+}
+
+
+- (void)playTheIndexPath:(NSIndexPath *)indexPath
+                assetURL:(NSURL *)assetURL
+          scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
+                animated:(BOOL)animated
+       completionHandler:(void (^ __nullable)(void))completionHandler {
+    @zf_weakify(self)
+    [self.scrollView zf_scrollToRowAtIndexPath:indexPath atScrollPosition:scrollPosition animated:animated completionHandler:^{
+        @zf_strongify(self)
+        if (completionHandler) completionHandler();
+        self.playingIndexPath = indexPath;
+        self.assetURL = assetURL;
+    }];
+}
+
+@end
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+@implementation ZFPlayerController (ZFPlayerDeprecated)
+
+- (void)updateScrollViewPlayerToCell {
+    if (self.currentPlayerManager.view && self.playingIndexPath && self.containerViewTag) {
+        UIView *cell = [self.scrollView zf_getCellForIndexPath:self.playingIndexPath];
+        self.containerView = [cell viewWithTag:self.containerViewTag];
+        [self.orientationObserver updateRotateView:self.currentPlayerManager.view rotateViewAtCell:cell playerViewTag:self.containerViewTag];
+        [self layoutPlayerSubViews];
+    }
+}
+
+- (void)updateNoramlPlayerWithContainerView:(UIView *)containerView {
+    if (self.currentPlayerManager.view && self.containerView) {
+        self.containerView = containerView;
+        [self.orientationObserver updateRotateView:self.currentPlayerManager.view containerView:self.containerView];
+        [self layoutPlayerSubViews];
+    }
+}
+
 - (void)playTheIndexPath:(NSIndexPath *)indexPath scrollToTop:(BOOL)scrollToTop completionHandler:(void (^ _Nullable)(void))completionHandler {
     NSURL *assetURL;
     if (self.sectionAssetURLs.count) {
@@ -1232,9 +1394,9 @@
         self.currentPlayIndex = indexPath.row;
     }
     if (scrollToTop) {
-        @weakify(self)
+        @zf_weakify(self)
         [self.scrollView zf_scrollToRowAtIndexPath:indexPath completionHandler:^{
-            @strongify(self)
+            @zf_strongify(self)
             if (completionHandler) completionHandler();
             self.playingIndexPath = indexPath;
             self.assetURL = assetURL;
@@ -1249,9 +1411,9 @@
 - (void)playTheIndexPath:(NSIndexPath *)indexPath scrollToTop:(BOOL)scrollToTop {
     if ([indexPath compare:self.playingIndexPath] == NSOrderedSame) return;
     if (scrollToTop) {
-        @weakify(self)
+        @zf_weakify(self)
         [self.scrollView zf_scrollToRowAtIndexPath:indexPath completionHandler:^{
-            @strongify(self)
+            @zf_strongify(self)
             [self playTheIndexPath:indexPath];
         }];
     } else {
@@ -1267,25 +1429,20 @@
     }
 }
 
-@end
-
-@implementation ZFPlayerController (ZFPlayerDeprecated)
+- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated completion:(void (^ _Nullable)(void))completion {
+    self.orientationObserver.fullScreenMode = ZFFullScreenModeLandscape;
+    [self.orientationObserver rotateToOrientation:orientation animated:animated completion:completion];
+}
 
-- (void)updateScrollViewPlayerToCell {
-    if (self.currentPlayerManager.view && self.playingIndexPath && self.containerViewTag) {
-        UIView *cell = [self.scrollView zf_getCellForIndexPath:self.playingIndexPath];
-        self.containerView = [cell viewWithTag:self.containerViewTag];
-        [self.orientationObserver cellModelRotateView:self.currentPlayerManager.view rotateViewAtCell:cell playerViewTag:self.containerViewTag];
-        [self layoutPlayerSubViews];
-    }
+- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
+    [self enterLandscapeFullScreen:orientation animated:animated completion:nil];
 }
 
-- (void)updateNoramlPlayerWithContainerView:(UIView *)containerView {
-    if (self.currentPlayerManager.view && self.containerView) {
-        self.containerView = containerView;
-        [self.orientationObserver cellOtherModelRotateView:self.currentPlayerManager.view containerView:self.containerView];
-        [self layoutPlayerSubViews];
-    }
+/// Add to the keyWindow
+- (void)addPlayerViewToKeyWindow {
+    [self addPlayerViewToSmallFloatView];
 }
 
 @end
+
+#pragma clang diagnostic pop

+ 1 - 1
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerGestureControl.m

@@ -216,7 +216,7 @@
                 case ZFPanDirectionH: {
                     if (translate.x > 0) {
                         self.panMovingDirection = ZFPanMovingDirectionRight;
-                    } else if (translate.y < 0) {
+                    } else {
                         self.panMovingDirection = ZFPanMovingDirectionLeft;
                     }
                 }

+ 1 - 1
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerLogManager.m

@@ -37,7 +37,7 @@ static BOOL kLogEnable = NO;
 }
 
 + (NSString *)version {
-    return @"3.3.1";
+    return @"4.0.1";
 }
 
 + (void)logWithFunction:(const char *)function lineNumber:(int)lineNumber formatString:(NSString *)formatString {

+ 11 - 29
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerMediaPlayback.h

@@ -24,47 +24,24 @@
 
 #import <Foundation/Foundation.h>
 #import "ZFPlayerView.h"
+#import "ZFPlayerConst.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
-typedef NS_ENUM(NSUInteger, ZFPlayerPlaybackState) {
-    ZFPlayerPlayStateUnknown,
-    ZFPlayerPlayStatePlaying,
-    ZFPlayerPlayStatePaused,
-    ZFPlayerPlayStatePlayFailed,
-    ZFPlayerPlayStatePlayStopped
-};
-
-typedef NS_OPTIONS(NSUInteger, ZFPlayerLoadState) {
-    ZFPlayerLoadStateUnknown        = 0,
-    ZFPlayerLoadStatePrepare        = 1 << 0,
-    ZFPlayerLoadStatePlayable       = 1 << 1,
-    ZFPlayerLoadStatePlaythroughOK  = 1 << 2, // Playback will be automatically started.
-    ZFPlayerLoadStateStalled        = 1 << 3, // Playback will be automatically paused in this state, if started.
-};
-
-typedef NS_ENUM(NSInteger, ZFPlayerScalingMode) {
-    ZFPlayerScalingModeNone,       // No scaling.
-    ZFPlayerScalingModeAspectFit,  // Uniform scale until one dimension fits.
-    ZFPlayerScalingModeAspectFill, // Uniform scale until the movie fills the visible bounds. One dimension may have clipped contents.
-    ZFPlayerScalingModeFill        // Non-uniform scale. Both render dimensions will exactly match the visible bounds.
-};
-
 @protocol ZFPlayerMediaPlayback <NSObject>
 
 @required
 /// The view must inherited `ZFPlayerView`,this view deals with some gesture conflicts.
 @property (nonatomic) ZFPlayerView *view;
 
-@optional
 /// The player volume.
 /// Only affects audio volume for the player instance and not for the device.
-/// You can change device volume or player volume as needed,change the player volume you can folllow the `ZFPlayerMediaPlayback` protocol.
+/// You can change device volume or player volume as needed,change the player volume you can follow the `ZFPlayerMediaPlayback` protocol.
 @property (nonatomic) float volume;
 
 /// The player muted.
 /// indicates whether or not audio output of the player is muted. Only affects audio muting for the player instance and not for the device.
-/// You can change device volume or player muted as needed,change the player muted you can folllow the `ZFPlayerMediaPlayback` protocol.
+/// You can change device volume or player muted as needed,change the player muted you can follow the `ZFPlayerMediaPlayback` protocol.
 @property (nonatomic, getter=isMuted) BOOL muted;
 
 /// Playback speed,0.5...2
@@ -105,7 +82,7 @@ typedef NS_ENUM(NSInteger, ZFPlayerScalingMode) {
 @property (nonatomic) NSURL *assetURL;
 
 /// The video size.
-@property (nonatomic, readonly) CGSize presentationSize;
+@property (nonatomic) CGSize presentationSize;
 
 /// The playback state.
 @property (nonatomic, readonly) ZFPlayerPlaybackState playState;
@@ -167,11 +144,16 @@ typedef NS_ENUM(NSInteger, ZFPlayerScalingMode) {
 /// Stop playback.
 - (void)stop;
 
+/// Use this method to seek to a specified time for the current player and to be notified when the seek operation is complete.
+- (void)seekToTime:(NSTimeInterval)time completionHandler:(void (^ __nullable)(BOOL finished))completionHandler;
+
+@optional
+
 /// Video UIImage at the current time.
 - (UIImage *)thumbnailImageAtCurrentTime;
 
-/// Use this method to seek to a specified time for the current player and to be notified when the seek operation is complete.
-- (void)seekToTime:(NSTimeInterval)time completionHandler:(void (^ __nullable)(BOOL finished))completionHandler;
+/// Video UIImage at the current time.
+- (void)thumbnailImageAtCurrentTime:(void(^)(UIImage *))handler;
 
 @end
 

+ 0 - 1
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerNotification.h

@@ -24,7 +24,6 @@
 
 #import <UIKit/UIKit.h>
 #import <AVFoundation/AVFoundation.h>
-#import <MediaPlayer/MPMusicPlayerController.h>
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 13 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerView.h

@@ -23,7 +23,20 @@
 // THE SOFTWARE.
 
 #import <UIKit/UIKit.h>
+#import "ZFPlayerConst.h"
 
 @interface ZFPlayerView : UIView
 
+/// player content view.
+@property (nonatomic, strong) UIView *playerView;
+
+/// Determines how the content scales to fit the view.
+@property (nonatomic, assign) ZFPlayerScalingMode scalingMode;
+
+/// The video size.
+@property (nonatomic, assign) CGSize presentationSize;
+
+/// The cover for playerView.
+@property (nonatomic, strong, readonly) UIImageView *coverImageView;
+
 @end

+ 88 - 23
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPlayerView.m

@@ -23,38 +23,103 @@
 // THE SOFTWARE.
 
 #import "ZFPlayerView.h"
-#import "ZFPlayer.h"
-
-@interface ZFPlayerView ()
-
-@property (nonatomic, weak) UIView *fitView;
-@end
+#import "ZFPlayerConst.h"
 
 @implementation ZFPlayerView
+@synthesize presentationSize = _presentationSize;
+@synthesize coverImageView = _coverImageView;
 
-- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
-    // Determine whether you can receive touch events
-    if (self.userInteractionEnabled == NO || self.hidden == YES || self.alpha <= 0.01) return nil;
-    // Determine if the touch point is out of reach
-    if (![self pointInside:point withEvent:event]) return nil;
-    NSInteger count = self.subviews.count;
-    for (NSInteger i = count - 1; i >= 0; i--) {
-        UIView *childView = self.subviews[i];
-        CGPoint childPoint = [self convertPoint:point toView:childView];
-        UIView *fitView = [childView hitTest:childPoint withEvent:event];
-        if (fitView) {
-            return fitView;
-        }
+- (instancetype)init {
+    self = [super init];
+    if (self) {
+        self.backgroundColor = [UIColor blackColor];
+        [self addSubview:self.coverImageView];
     }
     return self;
 }
 
-- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {}
+- (void)setPlayerView:(UIView *)playerView {
+    if (_playerView) {
+        [_playerView removeFromSuperview];
+        self.presentationSize = CGSizeZero;
+    }
+    _playerView = playerView;
+    if (playerView != nil) {
+        [self addSubview:playerView];
+    }
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    CGFloat min_x = 0;
+    CGFloat min_y = 0;
+    CGFloat min_w = 0;
+    CGFloat min_h = 0;
+    CGFloat min_view_w = self.frame.size.width;
+    CGFloat min_view_h = self.frame.size.height;
+    
+    CGSize playerViewSize = CGSizeZero;
+    CGFloat videoWidth = self.presentationSize.width;
+    CGFloat videoHeight = self.presentationSize.height;
+    if (videoHeight == 0) return;
+    CGFloat screenScale = min_view_w/min_view_h;
+    CGFloat videoScale = videoWidth/videoHeight;
+    if (screenScale > videoScale) {
+        CGFloat height = min_view_h;
+        CGFloat width = height * videoScale;
+        playerViewSize = CGSizeMake(width, height);
+    } else {
+        CGFloat width = min_view_w;
+        CGFloat height = width / videoScale;
+        playerViewSize = CGSizeMake(width, height);
+    }
+    
+    if (self.scalingMode == ZFPlayerScalingModeNone || self.scalingMode == ZFPlayerScalingModeAspectFit) {
+        min_w = playerViewSize.width;
+        min_h = playerViewSize.height;
+        min_x = (min_view_w - min_w) / 2.0;
+        min_y = (min_view_h - min_h) / 2.0;
+        self.playerView.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    } else if (self.scalingMode == ZFPlayerScalingModeAspectFill || self.scalingMode == ZFPlayerScalingModeFill) {
+        self.playerView.frame = self.bounds;
+    }
+    self.coverImageView.frame = self.playerView.frame;
+}
+
+- (CGSize)presentationSize {
+    if (CGSizeEqualToSize(_presentationSize, CGSizeZero)) {
+        _presentationSize = self.frame.size;
+    }
+    return _presentationSize;
+}
 
-- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {}
+- (UIImageView *)coverImageView {
+    if (!_coverImageView) {
+        _coverImageView = [[UIImageView alloc] init];
+        _coverImageView.userInteractionEnabled = YES;
+        _coverImageView.clipsToBounds = YES;
+        _coverImageView.contentMode = UIViewContentModeScaleAspectFit;
+    }
+    return _coverImageView;
+}
 
-- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {}
+- (void)setScalingMode:(ZFPlayerScalingMode)scalingMode {
+    _scalingMode = scalingMode;
+     if (scalingMode == ZFPlayerScalingModeNone || scalingMode == ZFPlayerScalingModeAspectFit) {
+         self.coverImageView.contentMode = UIViewContentModeScaleAspectFit;
+    } else if (scalingMode == ZFPlayerScalingModeAspectFill) {
+        self.coverImageView.contentMode = UIViewContentModeScaleAspectFill;
+    } else if (scalingMode == ZFPlayerScalingModeFill) {
+        self.coverImageView.contentMode = UIViewContentModeScaleToFill;
+    }
+    [self layoutIfNeeded];
+}
 
-- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {}
+- (void)setPresentationSize:(CGSize)presentationSize {
+    _presentationSize = presentationSize;
+    if (CGSizeEqualToSize(CGSizeZero, presentationSize)) return;
+    [self setNeedsLayout];
+    [self layoutIfNeeded];
+}
 
 @end

+ 60 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPortraitViewController.h

@@ -0,0 +1,60 @@
+//
+//  ZFPortraitViewController.h
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <UIKit/UIKit.h>
+#import "ZFOrientationObserver.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ZFPortraitViewController : UIViewController
+
+/// The block invoked When player will rotate.
+@property (nonatomic, copy, nullable) void(^orientationWillChange)(BOOL isFullScreen);
+
+/// The block invoked when player rotated.
+@property (nonatomic, copy, nullable) void(^orientationDidChanged)(BOOL isFullScreen);
+
+@property (nonatomic, strong) UIView *contentView;
+
+@property (nonatomic, strong) UIView *containerView;
+
+@property (nonatomic, assign) BOOL statusBarHidden;
+
+/// default is  UIStatusBarStyleLightContent.
+@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;
+/// defalut is UIStatusBarAnimationSlide.
+@property (nonatomic, assign) UIStatusBarAnimation statusBarAnimation;
+
+/// default is ZFDisablePortraitGestureTypesNone.
+@property (nonatomic, assign) ZFDisablePortraitGestureTypes disablePortraitGestureTypes;
+
+@property (nonatomic, assign) CGSize presentationSize;
+
+@property (nonatomic, assign) BOOL fullScreenAnimation;
+
+@property (nonatomic, assign) NSTimeInterval duration;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 231 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPortraitViewController.m

@@ -0,0 +1,231 @@
+//
+//  ZFPortraitViewController.m
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "ZFPortraitViewController.h"
+#import "ZFPersentInteractiveTransition.h"
+#import "ZFPresentTransition.h"
+
+@interface ZFPortraitViewController ()<UIViewControllerTransitioningDelegate,ZFPortraitOrientationDelegate>
+
+@property (nonatomic, strong) ZFPresentTransition *transition;
+@property (nonatomic, strong) ZFPersentInteractiveTransition *interactiveTransition;
+@property (nonatomic, assign, getter=isFullScreen) BOOL fullScreen;
+
+@end
+
+@implementation ZFPortraitViewController
+
+- (instancetype)init {
+    self = [super init];
+    if (self) {
+        self.transitioningDelegate = self;
+        self.modalPresentationStyle = UIModalPresentationOverFullScreen;
+        self.modalPresentationCapturesStatusBarAppearance = YES;
+        _statusBarStyle = UIStatusBarStyleLightContent;
+        _statusBarAnimation = UIStatusBarAnimationSlide;
+    }
+    return self;
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = [UIColor blackColor];
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    if (!self.fullScreenAnimation) {
+        if (self.orientationWillChange) {
+            self.orientationWillChange(YES);
+        }
+    }
+}
+
+- (void)viewDidAppear:(BOOL)animated {
+    [super viewDidAppear:animated];
+    if (!self.fullScreenAnimation) {
+        self.view.alpha = 1;
+        [self.view addSubview:self.contentView];
+        self.contentView.frame = [self contentFullScreenRect];
+        if (self.orientationDidChanged) {
+            self.orientationDidChanged(YES);
+        }
+    }
+    self.fullScreen = YES;
+    [self.interactiveTransition updateContentView:self.contentView
+                                    containerView:self.containerView];
+}
+
+- (void)viewWillDisappear:(BOOL)animated {
+    [super viewWillDisappear:animated];
+    if (!self.fullScreenAnimation) {
+        if (self.orientationWillChange) {
+            self.orientationWillChange(NO);
+        }
+    }
+}
+
+- (void)viewDidDisappear:(BOOL)animated {
+    [super viewDidDisappear:animated];
+    self.fullScreen = NO;
+    if (!self.fullScreenAnimation) {
+        [self.containerView addSubview:self.contentView];
+        self.contentView.frame = self.containerView.bounds;
+        if (self.orientationDidChanged) {
+            self.orientationDidChanged(NO);
+        }
+    }
+}
+
+#pragma mark - transition delegate
+
+- (id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
+    [self.transition transitionWithTransitionType:ZFPresentTransitionTypePresent contentView:self.contentView containerView:self.containerView];
+    return self.transition;
+}
+
+- (id<UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
+    [self.transition transitionWithTransitionType:ZFPresentTransitionTypeDismiss contentView:self.contentView containerView:self.containerView];
+    return self.transition;
+}
+
+- (id<UIViewControllerInteractiveTransitioning>)interactionControllerForDismissal:(id<UIViewControllerAnimatedTransitioning>)animator {
+    return self.interactiveTransition.interation ? self.interactiveTransition : nil;
+}
+
+
+- (BOOL)shouldAutorotate {
+    return NO;
+}
+
+- (BOOL)prefersStatusBarHidden {
+    return self.statusBarHidden;
+}
+
+- (UIStatusBarStyle)preferredStatusBarStyle {
+    return self.statusBarStyle;
+}
+
+- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation {
+    return self.statusBarAnimation;
+}
+
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
+    return UIInterfaceOrientationMaskPortrait;
+}
+
+#pragma mark - ZFPortraitOrientationDelegate
+
+- (void)zf_orientationWillChange:(BOOL)isFullScreen {
+    if (self.orientationWillChange) {
+        self.orientationWillChange(isFullScreen);
+    }
+}
+
+- (void)zf_orientationDidChanged:(BOOL)isFullScreen {
+    if (self.orientationDidChanged) {
+        self.orientationDidChanged(isFullScreen);
+    }
+}
+
+- (void)zf_interationState:(BOOL)isDragging {
+    self.transition.interation = isDragging;
+}
+
+#pragma mark - getter
+
+- (ZFPresentTransition *)transition {
+    if (!_transition) {
+        _transition = [[ZFPresentTransition alloc] init];
+        _transition.contentFullScreenRect = [self contentFullScreenRect];
+        _transition.delagate = self;
+    }
+    return _transition;
+}
+
+- (ZFPersentInteractiveTransition *)interactiveTransition {
+    if (!_interactiveTransition) {
+        _interactiveTransition = [[ZFPersentInteractiveTransition alloc] init];
+        _interactiveTransition.contentFullScreenRect = [self contentFullScreenRect];
+        _interactiveTransition.viewController = self;
+        _interactiveTransition.delagate = self;
+    }
+    return _interactiveTransition;;
+}
+
+- (void)setDisablePortraitGestureTypes:(ZFDisablePortraitGestureTypes)disablePortraitGestureTypes {
+    _disablePortraitGestureTypes = disablePortraitGestureTypes;
+    self.interactiveTransition.disablePortraitGestureTypes = disablePortraitGestureTypes;
+}
+
+- (void)setPresentationSize:(CGSize)presentationSize {
+    _presentationSize = presentationSize;
+    self.transition.contentFullScreenRect = [self contentFullScreenRect];
+    self.interactiveTransition.contentFullScreenRect = [self contentFullScreenRect];
+    if (!self.fullScreenAnimation && self.isFullScreen) {
+        self.contentView.frame = [self contentFullScreenRect];
+    }
+}
+
+- (void)setFullScreen:(BOOL)fullScreen {
+    _fullScreen = fullScreen;
+    self.transition.fullScreen = fullScreen;
+}
+
+- (void)setFullScreenAnimation:(BOOL)fullScreenAnimation {
+    _fullScreenAnimation = fullScreenAnimation;
+    self.interactiveTransition.fullScreenAnimation = fullScreenAnimation;
+}
+
+- (void)setDuration:(NSTimeInterval)duration {
+    _duration = duration;
+    self.transition.duration = duration;
+}
+
+- (CGRect)contentFullScreenRect {
+    CGFloat videoWidth = self.presentationSize.width;
+    CGFloat videoHeight = self.presentationSize.height;
+    if (videoHeight == 0) {
+        return CGRectZero;
+    }
+    CGSize fullScreenScaleSize = CGSizeZero;
+    CGFloat screenScale = ZFPlayerScreenWidth/ZFPlayerScreenHeight;
+    CGFloat videoScale = videoWidth/videoHeight;
+    if (screenScale > videoScale) {
+        CGFloat height = ZFPlayerScreenHeight;
+        CGFloat width = height * videoScale;
+        fullScreenScaleSize = CGSizeMake(width, height);
+    } else {
+        CGFloat width = ZFPlayerScreenWidth;
+        CGFloat height = (CGFloat)(width / videoScale);
+        fullScreenScaleSize = CGSizeMake(width, height);
+    }
+    
+    videoWidth = fullScreenScaleSize.width;
+    videoHeight = fullScreenScaleSize.height;
+    CGRect rect = CGRectMake((ZFPlayerScreenWidth - videoWidth) / 2.0, (ZFPlayerScreenHeight - videoHeight) / 2.0, videoWidth, videoHeight);
+    return rect;
+}
+
+@end

+ 49 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPresentTransition.h

@@ -0,0 +1,49 @@
+//
+//  ZFPresentTransition.h
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <UIKit/UIKit.h>
+#import "ZFOrientationObserver.h"
+
+typedef NS_ENUM(NSUInteger, ZFPresentTransitionType) {
+    ZFPresentTransitionTypePresent,
+    ZFPresentTransitionTypeDismiss,
+};
+
+@interface ZFPresentTransition : NSObject<UIViewControllerAnimatedTransitioning>
+
+@property (nonatomic, weak) id<ZFPortraitOrientationDelegate> delagate;
+
+@property (nonatomic, assign) CGRect contentFullScreenRect;
+
+@property (nonatomic, assign, getter=isFullScreen) BOOL fullScreen;
+
+@property (nonatomic, assign) BOOL interation;
+
+@property (nonatomic, assign) NSTimeInterval duration;
+
+- (void)transitionWithTransitionType:(ZFPresentTransitionType)type
+                         contentView:(UIView *)contentView
+                       containerView:(UIView *)containerView;
+
+@end

+ 156 - 0
Pods/ZFPlayer/ZFPlayer/Classes/Core/ZFPresentTransition.m

@@ -0,0 +1,156 @@
+//
+//  ZFPresentTransition.m
+//  ZFPlayer
+//
+// Copyright (c) 2020年 任子丰 ( http://github.com/renzifeng )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "ZFPresentTransition.h"
+#import "ZFPlayerConst.h"
+
+@interface ZFPresentTransition ()
+
+@property (nonatomic, strong) UIView *contentView;
+@property (nonatomic, assign) ZFPresentTransitionType type;
+@property (nonatomic, strong) UIView *containerView;
+@property (nonatomic, assign, getter=isTransiting) BOOL transiting;
+
+@end
+
+@implementation ZFPresentTransition
+
+- (void)transitionWithTransitionType:(ZFPresentTransitionType)type
+                         contentView:(UIView *)contentView
+                       containerView:(UIView *)containerView {
+    
+    self.type = type;
+    self.contentView = contentView;
+    self.containerView = containerView;
+}
+
+- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext {
+    return self.duration == 0 ? 0.25f : self.duration;
+}
+
+- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
+    switch (self.type) {
+        case ZFPresentTransitionTypePresent: {
+            [self presentAnimation:transitionContext];
+        }
+            break;
+        case ZFPresentTransitionTypeDismiss: {
+            [self dismissAnimation:transitionContext];
+        }
+            break;
+    }
+}
+
+- (void)presentAnimation:(id<UIViewControllerContextTransitioning>)transitionContext {
+    UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+    UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
+    if ([fromVC isKindOfClass:[UINavigationController class]]) {
+        UINavigationController *nav = (UINavigationController *)fromVC;
+        fromVC = nav.viewControllers.lastObject;
+    } else if ([fromVC isKindOfClass:[UITabBarController class]]) {
+        UITabBarController *tabBar = (UITabBarController *)fromVC;
+        if ([tabBar.selectedViewController isKindOfClass:[UINavigationController class]]) {
+            UINavigationController *nav = (UINavigationController *)tabBar.selectedViewController;
+            fromVC = nav.viewControllers.lastObject;
+        } else {
+            fromVC = tabBar.selectedViewController;
+        }
+    }
+    UIView *containerView = [transitionContext containerView];
+    [containerView addSubview:toVC.view];
+    [containerView addSubview:self.contentView];
+    CGRect originRect = [self.containerView convertRect:self.contentView.frame toView:toVC.view];
+    self.contentView.frame = originRect;
+
+    UIColor *tempColor = toVC.view.backgroundColor;
+    toVC.view.backgroundColor = [tempColor colorWithAlphaComponent:0];
+    toVC.view.alpha = 1;
+    [self.delagate zf_orientationWillChange:YES];
+    
+    CGRect toRect = self.contentFullScreenRect;
+    self.transiting = YES;
+    [UIView animateWithDuration:[self transitionDuration:transitionContext] animations:^{
+        self.contentView.frame = toRect;
+        [self.contentView layoutIfNeeded];
+        toVC.view.backgroundColor = [tempColor colorWithAlphaComponent:1.f];
+    } completion:^(BOOL finished) {
+        self.transiting = NO;
+        [toVC.view addSubview:self.contentView];
+        [transitionContext completeTransition:YES];
+        [self.delagate zf_orientationDidChanged:YES];
+        if (!CGRectEqualToRect(toRect, self.contentFullScreenRect)) {
+            self.contentView.frame = self.contentFullScreenRect;
+            [self.contentView layoutIfNeeded];
+        }
+    }];
+}
+
+- (void)dismissAnimation:(id<UIViewControllerContextTransitioning>)transitionContext {
+    UIView *containerView = [transitionContext containerView];
+    UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
+    if ([toVC isKindOfClass:[UINavigationController class]]) {
+        UINavigationController *nav = (UINavigationController *)toVC;
+        toVC = nav.viewControllers.lastObject;
+    } else if ([toVC isKindOfClass:[UITabBarController class]]) {
+        UITabBarController *tabBar = (UITabBarController *)toVC;
+        if ([tabBar.selectedViewController isKindOfClass:[UINavigationController class]]) {
+            UINavigationController *nav = (UINavigationController *)tabBar.selectedViewController;
+            toVC = nav.viewControllers.lastObject;
+        } else {
+            toVC = tabBar.selectedViewController;
+        }
+    }
+    
+    UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
+    fromVC.view.frame = containerView.bounds;
+    [containerView addSubview:fromVC.view];
+    [containerView addSubview:self.contentView];
+    
+    CGRect originRect = [fromVC.view convertRect:self.contentView.frame toView:toVC.view];
+    self.contentView.frame = originRect;
+    CGRect toRect = [self.containerView convertRect:self.containerView.bounds toView:toVC.view];
+    [fromVC.view convertRect:self.contentView.bounds toView:self.containerView.window];
+    [self.delagate zf_orientationWillChange:NO];
+    self.transiting = YES;
+    [UIView animateWithDuration:[self transitionDuration:transitionContext] animations:^{
+        fromVC.view.alpha = 0;
+        self.contentView.frame = toRect;
+        [self.contentView layoutIfNeeded];
+    } completion:^(BOOL finished) {
+        [self.containerView addSubview:self.contentView];
+        self.contentView.frame = self.containerView.bounds;
+        [transitionContext completeTransition:YES];
+        [self.delagate zf_orientationDidChanged:NO];
+        self.transiting = NO;
+    }];
+}
+
+- (void)setContentFullScreenRect:(CGRect)contentFullScreenRect {
+    _contentFullScreenRect = contentFullScreenRect;
+    if (!self.transiting && self.isFullScreen && !self.interation) {
+        self.contentView.frame = contentFullScreenRect;
+    }
+}
+
+@end

+ 60 - 0
smartRhino.xcodeproj/project.pbxproj

@@ -1361,6 +1361,10 @@
 		EBD537AE24908CD3000EDF2B /* HomeTeacherCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = EBD537AC24908CD3000EDF2B /* HomeTeacherCell.xib */; };
 		EBD537B12490A709000EDF2B /* BookTeacherListVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBD537B02490A709000EDF2B /* BookTeacherListVC.m */; };
 		EBD537B42490AE1D000EDF2B /* BookListenDetailVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBD537B32490AE1D000EDF2B /* BookListenDetailVC.m */; };
+		EBD6231125148231007FF6BC /* IndexGoodBookCell.m in Sources */ = {isa = PBXBuildFile; fileRef = EBD6230F25148231007FF6BC /* IndexGoodBookCell.m */; };
+		EBD6231225148231007FF6BC /* IndexGoodBookCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = EBD6231025148231007FF6BC /* IndexGoodBookCell.xib */; };
+		EBD623152514A175007FF6BC /* home.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EBD623142514A174007FF6BC /* home.storyboard */; };
+		EBD623192514A21C007FF6BC /* IndexMoreVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBD623182514A21C007FF6BC /* IndexMoreVC.m */; };
 		EBD627D52429DD6500D91C9E /* ChatQrcodeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBD627D42429DD6500D91C9E /* ChatQrcodeVC.m */; };
 		EBDD70BB23B4876F00AC0BF4 /* MyWorkCarVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBDD70BA23B4876F00AC0BF4 /* MyWorkCarVC.m */; };
 		EBDE08B02458179B005D426C /* CommonHomeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBDE08AF2458179B005D426C /* CommonHomeVC.m */; };
@@ -1426,6 +1430,13 @@
 		EBF2FB0E24A3457A0028EA09 /* HomeWeiCousreVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF2FB0C24A3457A0028EA09 /* HomeWeiCousreVC.m */; };
 		EBF2FB1124A3498C0028EA09 /* HomeMingShiVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF2FB0F24A3498C0028EA09 /* HomeMingShiVC.m */; };
 		EBF2FB1424A34DD10028EA09 /* HomeUserVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF2FB1324A34DD10028EA09 /* HomeUserVC.m */; };
+		EBF3C5192513356400D40A66 /* IndexSearchVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF3C5182513356400D40A66 /* IndexSearchVC.m */; };
+		EBF3C52725133D8200D40A66 /* SegmentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF3C52525133D8100D40A66 /* SegmentViewController.m */; };
+		EBF3C52E25133FB900D40A66 /* IndexAllVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF3C52D25133FB900D40A66 /* IndexAllVC.m */; };
+		EBF3C5322513446A00D40A66 /* IndexSubVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF3C5312513446A00D40A66 /* IndexSubVC.m */; };
+		EBF3C53725134DBB00D40A66 /* IndexAllCell.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF3C53525134DBB00D40A66 /* IndexAllCell.m */; };
+		EBF3C53825134DBB00D40A66 /* IndexAllCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = EBF3C53625134DBB00D40A66 /* IndexAllCell.xib */; };
+		EBF3C53F251353DB00D40A66 /* IndexAllModel.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF3C53C251353DA00D40A66 /* IndexAllModel.m */; };
 		EBF48A3124CFCD0300A91850 /* ChatSearchModel.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF48A3024CFCD0300A91850 /* ChatSearchModel.m */; };
 		EBF64A76241C73510074FD55 /* WorkFlowFecordSearchVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF64A75241C73510074FD55 /* WorkFlowFecordSearchVC.m */; };
 		EBF64A79241C810A0074FD55 /* FecordSearchVC.m in Sources */ = {isa = PBXBuildFile; fileRef = EBF64A78241C810A0074FD55 /* FecordSearchVC.m */; };
@@ -3820,6 +3831,12 @@
 		EBD537B02490A709000EDF2B /* BookTeacherListVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BookTeacherListVC.m; sourceTree = "<group>"; };
 		EBD537B22490AE1D000EDF2B /* BookListenDetailVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BookListenDetailVC.h; sourceTree = "<group>"; };
 		EBD537B32490AE1D000EDF2B /* BookListenDetailVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BookListenDetailVC.m; sourceTree = "<group>"; };
+		EBD6230E25148231007FF6BC /* IndexGoodBookCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IndexGoodBookCell.h; sourceTree = "<group>"; };
+		EBD6230F25148231007FF6BC /* IndexGoodBookCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IndexGoodBookCell.m; sourceTree = "<group>"; };
+		EBD6231025148231007FF6BC /* IndexGoodBookCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = IndexGoodBookCell.xib; sourceTree = "<group>"; };
+		EBD623142514A174007FF6BC /* home.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = home.storyboard; sourceTree = "<group>"; };
+		EBD623172514A21C007FF6BC /* IndexMoreVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IndexMoreVC.h; sourceTree = "<group>"; };
+		EBD623182514A21C007FF6BC /* IndexMoreVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IndexMoreVC.m; sourceTree = "<group>"; };
 		EBD627D32429DD6500D91C9E /* ChatQrcodeVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChatQrcodeVC.h; sourceTree = "<group>"; };
 		EBD627D42429DD6500D91C9E /* ChatQrcodeVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ChatQrcodeVC.m; sourceTree = "<group>"; };
 		EBDD70B923B4876F00AC0BF4 /* MyWorkCarVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyWorkCarVC.h; sourceTree = "<group>"; };
@@ -3934,6 +3951,19 @@
 		EBF2FB1024A3498C0028EA09 /* HomeMingShiVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeMingShiVC.h; sourceTree = "<group>"; };
 		EBF2FB1224A34DD10028EA09 /* HomeUserVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeUserVC.h; sourceTree = "<group>"; };
 		EBF2FB1324A34DD10028EA09 /* HomeUserVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeUserVC.m; sourceTree = "<group>"; };
+		EBF3C5172513356400D40A66 /* IndexSearchVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IndexSearchVC.h; sourceTree = "<group>"; };
+		EBF3C5182513356400D40A66 /* IndexSearchVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IndexSearchVC.m; sourceTree = "<group>"; };
+		EBF3C52525133D8100D40A66 /* SegmentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SegmentViewController.m; sourceTree = "<group>"; };
+		EBF3C52625133D8100D40A66 /* SegmentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SegmentViewController.h; sourceTree = "<group>"; };
+		EBF3C52C25133FB900D40A66 /* IndexAllVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IndexAllVC.h; sourceTree = "<group>"; };
+		EBF3C52D25133FB900D40A66 /* IndexAllVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IndexAllVC.m; sourceTree = "<group>"; };
+		EBF3C5302513446A00D40A66 /* IndexSubVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IndexSubVC.h; sourceTree = "<group>"; };
+		EBF3C5312513446A00D40A66 /* IndexSubVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IndexSubVC.m; sourceTree = "<group>"; };
+		EBF3C53425134DBB00D40A66 /* IndexAllCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IndexAllCell.h; sourceTree = "<group>"; };
+		EBF3C53525134DBB00D40A66 /* IndexAllCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IndexAllCell.m; sourceTree = "<group>"; };
+		EBF3C53625134DBB00D40A66 /* IndexAllCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = IndexAllCell.xib; sourceTree = "<group>"; };
+		EBF3C53C251353DA00D40A66 /* IndexAllModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IndexAllModel.m; sourceTree = "<group>"; };
+		EBF3C53D251353DA00D40A66 /* IndexAllModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexAllModel.h; sourceTree = "<group>"; };
 		EBF48A2F24CFCD0300A91850 /* ChatSearchModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChatSearchModel.h; sourceTree = "<group>"; };
 		EBF48A3024CFCD0300A91850 /* ChatSearchModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ChatSearchModel.m; sourceTree = "<group>"; };
 		EBF64A74241C73510074FD55 /* WorkFlowFecordSearchVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WorkFlowFecordSearchVC.h; sourceTree = "<group>"; };
@@ -6106,6 +6136,8 @@
 				C7D6BA11235DA18700770E7C /* HomeDetailController.m */,
 				EB44409424A1F5D200B2E212 /* IndexViewController.h */,
 				EB44409524A1F5D200B2E212 /* IndexViewController.m */,
+				EBF3C5172513356400D40A66 /* IndexSearchVC.h */,
+				EBF3C5182513356400D40A66 /* IndexSearchVC.m */,
 				324F17F2239E57010025CAE7 /* HomeTestViewController.h */,
 				324F17F3239E57010025CAE7 /* HomeTestViewController.m */,
 				324F17F5239E5B540025CAE7 /* App.pdf */,
@@ -6207,6 +6239,12 @@
 				EBE1E2B92494A40100DB80BF /* HomeBigshotListCell.h */,
 				EBE1E2BB2494A40200DB80BF /* HomeBigshotListCell.m */,
 				EBE1E2BA2494A40100DB80BF /* HomeBigshotListCell.xib */,
+				EBF3C53425134DBB00D40A66 /* IndexAllCell.h */,
+				EBF3C53525134DBB00D40A66 /* IndexAllCell.m */,
+				EBF3C53625134DBB00D40A66 /* IndexAllCell.xib */,
+				EBD6230E25148231007FF6BC /* IndexGoodBookCell.h */,
+				EBD6230F25148231007FF6BC /* IndexGoodBookCell.m */,
+				EBD6231025148231007FF6BC /* IndexGoodBookCell.xib */,
 			);
 			path = Cell;
 			sourceTree = "<group>";
@@ -6677,6 +6715,7 @@
 		C7D6B9F7235DA18700770E7C /* Home */ = {
 			isa = PBXGroup;
 			children = (
+				EBD623142514A174007FF6BC /* home.storyboard */,
 				C7F6162C238C070E008AF22D /* OtherHomeVC */,
 				C7D6BA24235DA18700770E7C /* Model */,
 				C7811F5823603D4A000CC76A /* VC */,
@@ -6773,6 +6812,8 @@
 				EB44408624A1CA5E00B2E212 /* HomeSubModel.m */,
 				EB44408824A1CBB600B2E212 /* HomeSubItemModel.h */,
 				EB44408924A1CBB600B2E212 /* HomeSubItemModel.m */,
+				EBF3C53D251353DA00D40A66 /* IndexAllModel.h */,
+				EBF3C53C251353DA00D40A66 /* IndexAllModel.m */,
 			);
 			path = Model;
 			sourceTree = "<group>";
@@ -6785,6 +6826,8 @@
 				C7811F5A23603EE2000CC76A /* HomeDetail */,
 				C7D6BA2A235DA18700770E7C /* HorizonScroll.h */,
 				C7D6BA2C235DA18700770E7C /* HorizonScroll.m */,
+				EBF3C52625133D8100D40A66 /* SegmentViewController.h */,
+				EBF3C52525133D8100D40A66 /* SegmentViewController.m */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -7944,6 +7987,12 @@
 				EBF2FB1324A34DD10028EA09 /* HomeUserVC.m */,
 				EB6A3D5024A864730067DBFA /* HomeProblemVC.h */,
 				EB6A3D5124A864740067DBFA /* HomeProblemVC.m */,
+				EBF3C52C25133FB900D40A66 /* IndexAllVC.h */,
+				EBF3C52D25133FB900D40A66 /* IndexAllVC.m */,
+				EBF3C5302513446A00D40A66 /* IndexSubVC.h */,
+				EBF3C5312513446A00D40A66 /* IndexSubVC.m */,
+				EBD623172514A21C007FF6BC /* IndexMoreVC.h */,
+				EBD623182514A21C007FF6BC /* IndexMoreVC.m */,
 			);
 			path = SubVC;
 			sourceTree = "<group>";
@@ -9282,6 +9331,7 @@
 				C7799EFF23AB2A1600270988 /* WorkFlowOrderItemCell.xib in Resources */,
 				EB8E2CED239666A900CDFBDA /* user_avatar_me@3x.png in Resources */,
 				EB0DBF0323ADA8A200E977ED /* MyTDTopicSelectExtentCell.xib in Resources */,
+				EBD6231225148231007FF6BC /* IndexGoodBookCell.xib in Resources */,
 				EBF1771C24826E5100C729DC /* BookPeriodicaCell.xib in Resources */,
 				C76CC9E223BCA03D003B23DC /* MeetingRecordTitleCell.xib in Resources */,
 				EB5E18C6247F88E800EDB76E /* BookPublicBookCell.xib in Resources */,
@@ -9326,6 +9376,7 @@
 				C78373F123A9D82E0096AFE2 /* HistoricalWorkFlowListController.xib in Resources */,
 				EB1E0F74246CD5A300D4C3DE /* BookAllLookCell.xib in Resources */,
 				C622157D237169E3006F5D7F /* NoticeNewGroupMenuCell.xib in Resources */,
+				EBD623152514A175007FF6BC /* home.storyboard in Resources */,
 				C7743F9223A86D7000973D70 /* MyWorkFlowListController.xib in Resources */,
 				EB9D65A7248E358900636BAC /* BookReadFontNameAlert.xib in Resources */,
 				EB8E2CE1239666A900CDFBDA /* close_gray@2x.png in Resources */,
@@ -9631,6 +9682,7 @@
 				EB8E2D4E239666A900CDFBDA /* icon_018_cover.png in Resources */,
 				EB8E2D9E239666A900CDFBDA /* msg_recv_audio@2x.png in Resources */,
 				C7D6BCBF235DA1CE00770E7C /* BindMobileViewController.xib in Resources */,
+				EBF3C53825134DBB00D40A66 /* IndexAllCell.xib in Resources */,
 				EB8E2D99239666A900CDFBDA /* msg_bg_recv@2x.png in Resources */,
 				C7D6BCB8235DA1CE00770E7C /* LearninglistViewController.xib in Resources */,
 				C751012923837FB100E4429B /* MyZanCell.xib in Resources */,
@@ -9828,6 +9880,7 @@
 				EB4310B324CE7D1F00481097 /* SourceGroupSearchVC.m in Sources */,
 				C7743F9823A86DAE00973D70 /* WorkFlowFecordController.m in Sources */,
 				EBCCEC4E2508C3D800DC6B6F /* BookSetPlayTimeAlert.m in Sources */,
+				EBF3C53725134DBB00D40A66 /* IndexAllCell.m in Sources */,
 				EB8E2D24239666A900CDFBDA /* EMChineseToPinyin.m in Sources */,
 				EB952680248A0BA6003EFCCE /* DCContentVC.m in Sources */,
 				EB9DA130250333240062FEB8 /* SwitchTableViewCell.m in Sources */,
@@ -9919,6 +9972,7 @@
 				EB9BCC1224EBDD92005D7499 /* NoteBookEditSearchVC.m in Sources */,
 				EB3EAFF123A31C7D00C38AB4 /* TDGroupInfoDetailVC.m in Sources */,
 				EBABACA2248B7A300033B985 /* HKFloatManager.m in Sources */,
+				EBF3C52E25133FB900D40A66 /* IndexAllVC.m in Sources */,
 				C72F3904236DADDC00933828 /* BlacklistCell.m in Sources */,
 				C59D0C4523825DE1007D0760 /* YYSentinel.m in Sources */,
 				C59D0C2323825DE1007D0760 /* YYTextRubyAnnotation.m in Sources */,
@@ -9931,6 +9985,7 @@
 				EBF2FB0E24A3457A0028EA09 /* HomeWeiCousreVC.m in Sources */,
 				EB8E2CFF239666A900CDFBDA /* DACircularProgressView.m in Sources */,
 				EB3DCA4724551B0E000A0189 /* ShareListVC.m in Sources */,
+				EBF3C52725133D8200D40A66 /* SegmentViewController.m in Sources */,
 				EBBEE55B2498599300B135E4 /* PNCircleChart.m in Sources */,
 				EBB6887B23C9C0C300E24DD9 /* UITextView+RCSBackWord.m in Sources */,
 				EB56DA0723BB31AF00FE7262 /* EMChatFileShowVC.m in Sources */,
@@ -9953,6 +10008,7 @@
 				EBF7175724722D4B00ED1838 /* BookWCDetailVC.m in Sources */,
 				EBF2D55D23C2E9AC00EC35C4 /* MHCommentReply.m in Sources */,
 				C770406D23AC9F7300BFF1B0 /* MeetingListModel.m in Sources */,
+				EBF3C5322513446A00D40A66 /* IndexSubVC.m in Sources */,
 				C70B6D6623CEBB6A008D5C48 /* ZFReOrderTableView.m in Sources */,
 				C62215A02372C27B006F5D7F /* MailListCell.m in Sources */,
 				EB0F64C523A9DA2B00AD56A0 /* MyTDTopicGroupManageVC.m in Sources */,
@@ -10133,6 +10189,7 @@
 				EBB6888123C9C1C900E24DD9 /* RichTextEditViewController.m in Sources */,
 				C62270A1236C09FC00E2E3BF /* GHRefreshCollectionView.m in Sources */,
 				C625AACF2370125D0010E967 /* ChatMsgNoticeVC.m in Sources */,
+				EBD623192514A21C007FF6BC /* IndexMoreVC.m in Sources */,
 				C56AC85F2384DB1000D46052 /* EaseSDKHelper.m in Sources */,
 				EBAA1F242463A4F200272F13 /* SourceGroupVC.m in Sources */,
 				EB8E2CF4239666A900CDFBDA /* wav.mm in Sources */,
@@ -10199,6 +10256,7 @@
 				C708DC0A2371BE36005CC822 /* WorkFlowSearchDetailVC.m in Sources */,
 				C59D0C2423825DE1007D0760 /* UITextField+YYAdd.m in Sources */,
 				EB8E2CD8239666A900CDFBDA /* NSObject+Alert.m in Sources */,
+				EBF3C5192513356400D40A66 /* IndexSearchVC.m in Sources */,
 				EB8E2D21239666A900CDFBDA /* EMTextViewController.m in Sources */,
 				C701EE4A23C2D97800082463 /* InPutGongWenImageCell.m in Sources */,
 				C7799EF423AB19EA00270988 /* WorkFlowOrderTopCell.m in Sources */,
@@ -10589,6 +10647,7 @@
 				EB8E2CF8239666A900CDFBDA /* MWZoomingScrollView.m in Sources */,
 				C59D0C2D23825DE1007D0760 /* UIBarButtonItem+YYAdd.m in Sources */,
 				C7D6BBAC235DA18A00770E7C /* NavigationController.m in Sources */,
+				EBD6231125148231007FF6BC /* IndexGoodBookCell.m in Sources */,
 				C79C6D3B23BF16C500BE4156 /* MeetingDetailsTimeCell.m in Sources */,
 				C625AA95236FD1A90010E967 /* ChatMsgSearchHistoryCell.m in Sources */,
 				EB4B653424C19E4B0041A82C /* MailGroupListSerachVC.m in Sources */,
@@ -10623,6 +10682,7 @@
 				C7D6BB46235DA18A00770E7C /* ThirdSharedView.m in Sources */,
 				C6F2E1A3236C44D8009E6903 /* ShowGenderAlertView.m in Sources */,
 				EB8E2D74239666A900CDFBDA /* EMChatBar.m in Sources */,
+				EBF3C53F251353DB00D40A66 /* IndexAllModel.m in Sources */,
 				C7D6BBA7235DA18A00770E7C /* UIColor+HexCustomer.m in Sources */,
 				C7AB8435235EA93B00F2363F /* SWQRCodeManager.m in Sources */,
 				EB8E2D7A239666A900CDFBDA /* EMMsgAudioBubbleView.m in Sources */,

BIN
smartRhino.xcworkspace/xcuserdata/niuzhen.xcuserdatad/UserInterfaceState.xcuserstate


+ 9 - 1
smartRhino/AppConfig.h

@@ -131,7 +131,7 @@ return;\
 // 是否为空对象
 #define MHObjectIsNil(__object)  ((nil == __object) || [__object isKindOfClass:[NSNull class]])
 
-//#define BaseUrl @"http://111.12.8.69:83"///广西
+//#define BaseUrl @"http://192.168.0.133:84"///广西
 //#define HtmlUrl @"http://192.168.0.113:8081"
 //#define HtmlUrl @"http://192.168.0.114:8081"
 
@@ -213,6 +213,14 @@ return;\
 #define API_APP_Media_Audio                   @"/api/app/media/audio/"
 #define API_APP_Media_Video                   @"/api/app/media/video/"
 #define API_APP_Media_Recommend               @"/api/app/media/recommend"
+#define API_APP_Media_Read                    @"/api/app/media/read/"
+
+#pragma mark - 首页搜索
+#define API_APP_Page_Search                   @"/api/app/page/search"
+#define API_APP_Media_Search                  @"/api/app/media/search"
+#define API_APP_Page_System_Lable_User        @"/api/app/page/system-lable-user"
+#define API_APP_Media_Lable_List              @"/api/web/media/lable-list"
+
 
 #define API_APP_Teacher                       @"/api/app/teacher/"
 #define API_APP_Media_Teacher                 @"/api/app/media/teacher"

+ 6 - 1
smartRhino/AppDelegate.m

@@ -71,6 +71,11 @@
 }
 - (void)configUSharePlatforms
 {
+    [[UMSocialGlobal shareInstance] setUniversalLinkDic:@{@(UMSocialPlatformType_WechatSession):@"https://apk.tederen.com",
+                                                          @(UMSocialPlatformType_WechatTimeLine):@"https://apk.tederen.com",
+                                                          @(UMSocialPlatformType_QQ):@"https://apk.tederen.com",
+                                                          @(UMSocialPlatformType_Sina):@"https://apk.tederen.com",
+    }];
     [UMConfigure initWithAppkey:UMengAppKey channel:nil];
 
     /* 设置微信的appKey和appSecret */
@@ -81,7 +86,7 @@
     /* 设置分享到QQ互联的appID
      * U-Share SDK为了兼容大部分平台命名,统一用appKey和appSecret进行参数设置,而QQ平台仅需将appID作为U-Share的appKey参数传进即可。
     */
-    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:QQAppKey/*设置QQ平台的appID*/  appSecret:nil redirectURL:@"https://apk.tederen.com"];
+    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:QQAppKey/*设置QQ平台的appID*/  appSecret:QQAppSecret redirectURL:@"https://apk.tederen.com"];
 
     /* 设置新浪的appKey和appSecret */
     [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_Sina appKey:WBAppKey  appSecret:WBAppSecret redirectURL:@"https://apk.tederen.com"];

+ 3 - 1
smartRhino/FwzAppConfig.h

@@ -322,9 +322,11 @@ typedef enum CollectModelType{
     CollectModel_TopicBooK = 41,
     CollectModel_TopicSubBooK = 42,
     CollectModel_Aritle = 100,
+    CollectModel_MediaAritle = 101,
     CollectModel_CollectFileAll = 120,
     CollectModel_NoteFileAll = 130,
     CollectModel_Teacher = 180,
+    CollectModel_Organization = 190,
     CollectModel_file = 300,
     CollectModel_Image = 301,
 //    CollectModel_meetMian  = 8,
@@ -469,7 +471,7 @@ typedef enum MediaType{
     MediaMusicType  = 40,  ///音频
     MediaQikanType  = 50,  ///期刊
     MediaVideoType  = 60,  ///视频
-    MediaArticeType = 100, ///文章
+    MediaArticeType = 101, ///文章
 }MediaType;
 
 typedef enum PlayModelType{

+ 2 - 2
smartRhino/PhbAppConfig.h

@@ -50,8 +50,8 @@
 #define UMengAppKey  @"5e7426ef570df3d20e00019e"
 
 ///QQ广西
-#define QQAppKey     @"1110364101"
-#define QQAppSecret  @"i7deddNT1KAK7MU9"
+#define QQAppKey     @"101901983"
+#define QQAppSecret  @"3c8344c33cab01f0e3ce68fc0ae961df"
 
 ///微博广西
 #define WBAppKey     @"1039156716"

+ 2 - 0
smartRhino/Project/Other/Third/Calender/NSDate+Extension.h

@@ -36,4 +36,6 @@
 + (NSString *)getTimeStringAutoShort3:(NSString *)date;
 + (NSString *)getCHtimeWihtDate:(NSString *)date;
 + (NSString *)getTimeString:(NSDate *)dt format:(NSString *)fmt;
+///格式:02-07
++ (NSString *)getMonthAndDayWihtDate:(NSString *)date;
 @end

+ 6 - 0
smartRhino/Project/Other/Third/Calender/NSDate+Extension.m

@@ -268,5 +268,11 @@
     }
     return ret;
 }
++ (NSString *)getMonthAndDayWihtDate:(NSString *)date
+{
+    NSDate * dt = [self getStringDate:date format:@"yyyy-MM-dd HH:mm:ss"];
+    NSString * ret = [self getTimeString:dt format:@"MM-dd"];
+    return ret;
+}
 @end
 

+ 3 - 1
smartRhino/Project/Other/Third/JSONModel/JSONModel/JSONModel.m

@@ -1046,7 +1046,9 @@ static JSONKeyMapper* globalKeyMapper = nil;
 {
     NSData* jsonData = nil;
     NSError* jsonError = nil;
-    
+    if (propertyNames == nil) {
+        return @"";
+    }
     @try {
         NSDictionary* dict = [self toDictionaryWithKeys:propertyNames];
         jsonData = [NSJSONSerialization dataWithJSONObject:dict options:kNilOptions error:&jsonError];

+ 32 - 29
smartRhino/Project/Other/Third/YYKit/Model/NSObject+YYModel.h

@@ -215,6 +215,10 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (NSString *)modelDescription;
 
++ (nullable NSArray *)modelArrayWithClass:(Class)cls json:(id)json;
+
++ (nullable NSDictionary *)modelDictionaryWithClass:(Class)cls json:(id)json;
+
 @end
 
 
@@ -222,41 +226,40 @@ NS_ASSUME_NONNULL_BEGIN
 /**
  Provide some data-model method for NSArray.
  */
-@interface NSArray (YYModel)
-
-/**
- Creates and returns an array from a json-array.
- This method is thread-safe.
- 
- @param cls  The instance's class in array.
- @param json  A json array of `NSArray`, `NSString` or `NSData`.
-              Example: [{"name":"Mary"},{name:"Joe"}]
- 
- @return A array, or nil if an error occurs.
- */
-+ (nullable NSArray *)modelArrayWithClass:(Class)cls json:(id)json;
-
-@end
+//@interface NSArray (YYModel)
+//
+///**
+// Creates and returns an array from a json-array.
+// This method is thread-safe.
+//
+// @param cls  The instance's class in array.
+// @param json  A json array of `NSArray`, `NSString` or `NSData`.
+//              Example: [{"name":"Mary"},{name:"Joe"}]
+//
+// @return A array, or nil if an error occurs.
+// */
+//
+//@end
 
 
 
 /**
  Provide some data-model method for NSDictionary.
  */
-@interface NSDictionary (YYModel)
-
-/**
- Creates and returns a dictionary from a json.
- This method is thread-safe.
- 
- @param cls  The value instance's class in dictionary.
- @param json  A json dictionary of `NSDictionary`, `NSString` or `NSData`.
-              Example: {"user1":{"name","Mary"}, "user2": {name:"Joe"}}
- 
- @return A dictionary, or nil if an error occurs.
- */
-+ (nullable NSDictionary *)modelDictionaryWithClass:(Class)cls json:(id)json;
-@end
+//@interface NSDictionary (YYModel)
+//
+///**
+// Creates and returns a dictionary from a json.
+// This method is thread-safe.
+// 
+// @param cls  The value instance's class in dictionary.
+// @param json  A json dictionary of `NSDictionary`, `NSString` or `NSData`.
+//              Example: {"user1":{"name","Mary"}, "user2": {name:"Joe"}}
+// 
+// @return A dictionary, or nil if an error occurs.
+// */
+//+ (nullable NSDictionary *)modelDictionaryWithClass:(Class)cls json:(id)json;
+//@end
 
 
 

+ 2 - 0
smartRhino/Project/Other/Util/StoryboardManager/StoryboardManager.h

@@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (weak, nonatomic,readonly) UIStoryboard *Source;
 @property (weak, nonatomic,readonly) UIStoryboard *Book;
 @property (weak, nonatomic,readonly) UIStoryboard *BookDetail;
+@property (weak, nonatomic,readonly) UIStoryboard *home;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 8 - 0
smartRhino/Project/Other/Util/StoryboardManager/StoryboardManager.m

@@ -35,6 +35,8 @@
 @property (weak, nonatomic) UIStoryboard *Source;
 @property (weak, nonatomic) UIStoryboard *Book;
 @property (weak, nonatomic) UIStoryboard *BookDetail;
+@property (weak, nonatomic) UIStoryboard *home;
+
 @end
 
 @implementation StoryboardManager
@@ -199,4 +201,10 @@
     }
     return _BookDetail = [UIStoryboard storyboardWithName:@"BookDetail" bundle:nil];
 }
+- (UIStoryboard *)home {
+    if (_home) {
+        return _home;
+    }
+    return _home = [UIStoryboard storyboardWithName:@"home" bundle:nil];
+}
 @end

+ 1 - 2
smartRhino/Project/VCModel/ChatMessage/Controller/ChatMsgNotice/Controller/MoveViewController.m

@@ -125,8 +125,7 @@
                         }
                     }
                 } failure:^(NSError * _Nonnull error) {
-                    NSLog(@"%@",error);
-                    SHOWERROR([ZYCTool handerResultData:error])
+
                 }];
             } cancle:^{
             }] show];

+ 3 - 0
smartRhino/Project/VCModel/Home/Model/HomeSubItemModel.h

@@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, assign) NSInteger   Id;
 @property (nonatomic, copy) NSString     *Title;
 @property (nonatomic, copy) NSString     *ImageUrls;
+@property (nonatomic, copy) NSString     *FileUrl;
 @property (nonatomic, copy) NSString     *ImageUrl;
 @property (nonatomic, assign) BOOL        IsCollect;
 @property (nonatomic, copy) NSString     *Author;
@@ -22,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString     *Duration;
 @property (nonatomic, copy) NSString     *Summary;
 @property (nonatomic, copy) NSString     *Press;
+@property (nonatomic, assign) NSInteger   PressId;
+@property (nonatomic, copy) NSString     *VideoImage;
 @property (nonatomic, assign) NSInteger   CollectCount;
 @property (nonatomic, assign) MediaType   MediaType;
 @property (nonatomic, assign) NSInteger   ReadCount;

+ 22 - 0
smartRhino/Project/VCModel/Home/Model/IndexAllModel.h

@@ -0,0 +1,22 @@
+//
+//  IndexAllModel.h
+//  smartRhino
+//
+//  Created by niuzhen on 2020/6/23.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import "BaseModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface IndexAllModel : BaseModel
+@property (nonatomic, assign) NSInteger   LableId;
+@property (nonatomic, assign) NSInteger   Total;
+@property (nonatomic, copy) NSString     *LableName;
+@property (nonatomic, assign) BOOL        IsTop;
+@property (nonatomic, strong) NSArray    *Items;
+@end
+
+NS_ASSUME_NONNULL_END
+

+ 13 - 0
smartRhino/Project/VCModel/Home/Model/IndexAllModel.m

@@ -0,0 +1,13 @@
+//
+//  IndexAllModel.m
+//  smartRhino
+//
+//  Created by niuzhen on 2020/6/23.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import "IndexAllModel.h"
+
+@implementation IndexAllModel
+
+@end

+ 2 - 2
smartRhino/Project/VCModel/Home/OtherHomeVC/MyTDTopic/VC/TopicBook/MyTDTopicBookVC.m

@@ -94,9 +94,9 @@
             MyFavoriteNewFindVC *vc = [MyFavoriteNewFindVC initMyFavoriteNewFindVC];
             vc.ParentId = weakSelf.ParentId;
             vc.roleId = weakSelf.roleId;
-            vc.createFoldType = CreateNotesType;
+            vc.createFoldType = CreateNewTopicType;
             vc.modifyTye = CreateType;
-            vc.fileType = NewTopicFileType;
+            vc.fileType = weakSelf.ParentId == 0 ? NewTopicFileType : NewNotFileType;
             [weakSelf.navigationController pushViewController:vc animated:YES];
         }else{
             NSMutableArray *menuDataSourceArray = [weakSelf getMenuDataSource:weakSelf.addListArray];

+ 6 - 0
smartRhino/Project/VCModel/Home/VC/BookStore/VC/BookWCDetailVC.m

@@ -362,6 +362,12 @@
             [weakSelf.playBtn setImage:IMG(@"new_allPlay_44x44_") forState:UIControlStateNormal];
         }
     }];
+    NSString * url = [NSString stringWithFormat:@"%@%ld",Host(API_APP_Media_Read),subModel.Id];
+    [[HttpManager sharedHttpManager] PUTUrl:url parameters:@{} responseStyle:DATA success:^(id  _Nonnull responseObject) {
+        
+    } failure:^(NSError * _Nonnull error) {
+        
+    }];
 }
 
 #pragma mark - UITableViewDelegate

+ 2 - 0
smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeSubCell.h

@@ -9,6 +9,7 @@
 #import <UIKit/UIKit.h>
 #import "BookHomeSubModel.h"
 #import "HomeSubItemModel.h"
+
 NS_ASSUME_NONNULL_BEGIN
 
 @interface BookHomeSubCell : UICollectionViewCell
@@ -23,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (assign, nonatomic) BookHomeType             type;
 - (void)setDataWithModel:(BookHomeSubModel *)model;
 - (void)setData:(HomeSubItemModel *)model;
+- (void)setDataIndexModel:(HomeSubItemModel *)model searchText:(NSString *)text;
 - (void)setDataModel:(HomeSubItemModel *)model withType:(BookHomeType)type;
 @end
 

+ 12 - 0
smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeSubCell.m

@@ -143,6 +143,18 @@
     self.titleL.font = [UIFont systemFontOfSize:17];
     self.constant.constant = CGRectGetMaxY(self.subTitleL.frame);
 }
+- (void)setDataIndexModel:(HomeSubItemModel *)model searchText:(NSString *)text
+{
+    [self.imagV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")];
+    self.titleL.attributedText = [ZYCTool checkOfString:model.Title withSearchText:text withColor:UIColorHex(0xFF5252)];
+    self.nameL.text = model.Author;
+    self.subTitleL.text = model.Summary;
+    [self.nameL layoutIfNeeded];
+    [self.subTitleL layoutIfNeeded];
+    [self.conView layoutIfNeeded];
+    self.titleL.font = [UIFont systemFontOfSize:17];
+    self.constant.constant = CGRectGetMaxY(self.subTitleL.frame);
+}
 - (NSAttributedString *)setSubTitleText:(NSString *)text
 {
     if (text.length == 0) {

+ 6 - 6
smartRhino/Project/VCModel/Home/VC/BookStore/View/BookHomeSubCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -34,18 +34,18 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="王德培等" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z8u-OB-Dnl">
-                                <rect key="frame" x="0.0" y="25" width="233" height="51.5"/>
+                                <rect key="frame" x="0.0" y="25" width="233" height="50.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                 <color key="textColor" red="0.36470588235294116" green="0.39215686274509803" blue="0.43137254901960786" alpha="0.84705882352941175" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YfZ-Ot-w8W">
-                                <rect key="frame" x="0.0" y="80.5" width="233" height="13.5"/>
+                                <rect key="frame" x="0.0" y="79.5" width="233" height="14.5"/>
                                 <attributedString key="attributedText">
                                     <fragment content="子标题">
                                         <attributes>
                                             <color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            <font key="NSFont" size="12" name=".PingFangSC-Regular"/>
+                                            <font key="NSFont" metaFont="cellTitle"/>
                                             <paragraphStyle key="NSParagraphStyle" alignment="justified" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
                                         </attributes>
                                     </fragment>
@@ -77,6 +77,7 @@
                     </view>
                 </subviews>
             </view>
+            <viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
             <constraints>
                 <constraint firstAttribute="trailing" secondItem="Bc8-wf-3Ic" secondAttribute="trailing" constant="15" id="6Lw-y5-oOB"/>
                 <constraint firstItem="vsA-5i-JVn" firstAttribute="leading" secondItem="bA2-sd-Bwc" secondAttribute="trailing" constant="15" id="6yi-Fb-K8a"/>
@@ -88,7 +89,6 @@
                 <constraint firstItem="bA2-sd-Bwc" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="ffI-0V-uny"/>
                 <constraint firstItem="Bc8-wf-3Ic" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="15" id="pPE-tv-Q5G"/>
             </constraints>
-            <viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
             <size key="customSize" width="348" height="143"/>
             <connections>
                 <outlet property="conView" destination="vsA-5i-JVn" id="jBD-T3-df2"/>

+ 8 - 4
smartRhino/Project/VCModel/Home/VC/BookStore/View/BookSubArticeCell.xib

@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -43,7 +44,7 @@
                                     <fragment content="初中阅读理解">
                                         <attributes>
                                             <color key="NSColor" red="0.039215686270000001" green="0.039215686270000001" blue="0.039215686270000001" alpha="1" colorSpace="calibratedRGB"/>
-                                            <font key="NSFont" size="17" name=".PingFangSC-Regular"/>
+                                            <font key="NSFont" metaFont="system" size="17"/>
                                             <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="5" tighteningFactorForTruncation="0.0"/>
                                         </attributes>
                                     </fragment>
@@ -84,7 +85,7 @@
                                 <nil key="highlightedColor"/>
                             </label>
                         </subviews>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                             <constraint firstItem="IWF-Ko-oPE" firstAttribute="top" secondItem="y3f-8i-XPH" secondAttribute="bottom" constant="4" id="0Lw-oe-URj"/>
                             <constraint firstItem="uHg-h9-jcn" firstAttribute="leading" secondItem="M7f-gW-2R6" secondAttribute="trailing" constant="20" id="4Xu-39-KW0"/>
@@ -141,5 +142,8 @@
     <resources>
         <image name="Home_yun_icon" width="15" height="11"/>
         <image name="img_placeHolder" width="800" height="800"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
     </resources>
 </document>

+ 17 - 0
smartRhino/Project/VCModel/Home/VC/IndexSearchVC.h

@@ -0,0 +1,17 @@
+//
+//  IndexSearchVC.h
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/17.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface IndexSearchVC : UIViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 220 - 0
smartRhino/Project/VCModel/Home/VC/IndexSearchVC.m

@@ -0,0 +1,220 @@
+//
+//  IndexSearchVC.m
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/17.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import "IndexSearchVC.h"
+#import "DrawerView.h"
+#import "TabBarController.h"
+#import "SegmentViewController.h"
+#import "IndexAllVC.h"
+#import "IndexSubVC.h"
+#import "InfoSearchView.h"
+
+@interface IndexSearchVC ()<InfoSearchViewDelegate>
+@property (nonatomic, strong) InfoSearchView      *topNavSearch;
+@property (strong, nonatomic) DrawerView           *drawerView;
+@property (strong, nonatomic) SegmentViewController          *pageView;
+@property (copy,nonatomic) NSString               *searchStr;
+@property (strong, nonatomic) IndexAllVC           *allVC;
+@property (strong, nonatomic) IndexSubVC           *articeVC;
+@property (strong, nonatomic) IndexSubVC           *bookVC;
+@property (strong, nonatomic) IndexSubVC           *videoVC;
+@property (strong, nonatomic) IndexSubVC           *musicVC;
+
+@end
+
+@implementation IndexSearchVC
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    [self.navigationController.navigationBar setHidden:YES];
+}
+
+- (DrawerView *)drawerView{
+    if(!_drawerView){
+        _drawerView = [[DrawerView alloc] init];
+    }
+    return _drawerView;
+}
+- (InfoSearchView *)topNavSearch {
+    if (!_topNavSearch) {
+        _topNavSearch = [[InfoSearchView alloc] initWithFrame:CGRectMake(0, (IS_IPHONEX?40:20), kGXScreenWidth, 45) type:InfoSearchViewTypeDefault];
+    }
+    return _topNavSearch;
+}
+- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
+{
+    [self.topNavSearch.searchBar resignFirstResponder];
+}
+
+- (void)searchButtonAction:(UISearchBar *)searchBar {
+    self.searchStr = searchBar.text;
+    // 添加历史记录,刷新historyTable
+    [self noticeGetData];
+    [self.view endEditing:YES];
+}
+- (void)noticeGetData
+{
+    if (self.searchStr.length == 0) {
+        return;
+    }
+    switch (self.pageView.selectIndex - 10000) {
+        case 0:
+        {
+            self.allVC.searchText = self.searchStr;
+            [self.allVC getData];
+        }
+            break;
+        case 1:
+        {
+            self.articeVC.searchText = self.searchStr;
+            self.articeVC.type = MediaArticeType;
+            [self.articeVC getData];
+        }
+            break;
+        case 2:
+        {
+            self.bookVC.searchText = self.searchStr;
+            self.bookVC.type = MediaBookType;
+            [self.bookVC getData];
+        }
+            break;
+        case 3:
+        {
+            self.videoVC.searchText = self.searchStr;
+            self.videoVC.type = MediaVideoType;
+            [self.videoVC getData];
+        }
+            break;
+        default:
+        {
+            self.musicVC.searchText = self.searchStr;
+            self.musicVC.type = MediaMusicType;
+            [self.musicVC getData];
+        }
+            break;
+    }
+}
+// 文本改变回调
+- (void)textDidChange:(NSString *)text {
+    self.searchStr = text;
+    if (ISEmptyString(text)) {
+        // 没有文本显示历史记录cell
+    } else {
+        // 有文本,就去搜索文章列表,有联想显示联想,没有联想显示历史记录
+    }
+}
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = [UIColor whiteColor];
+    [self.view addSubview:self.topNavSearch];
+    [self addNavSearch];
+    [self addPageView];
+    [self.pageView addObserver:self forKeyPath:@"selectIndex" options:NSKeyValueObservingOptionNew context:nil];
+}
+- (void)dealloc
+{
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context
+{
+    id new = [change objectForKey:@"new"];
+    id old = [change objectForKey:@"old"];
+    if (new != old) {
+        [self noticeGetData];
+    }
+}
+- (void)addNavSearch
+{
+    WS(weakSelf);
+    self.topNavSearch.delegate = self;
+    self.topNavSearch.backBlock = ^{
+        [weakSelf.navigationController popViewControllerAnimated:YES];
+    };
+    self.topNavSearch.menuBlock = ^{
+        [weakSelf.view endEditing:YES];
+        [[UtilsTools getWindow] addSubview:weakSelf.drawerView];
+        weakSelf.drawerView.SelectDrawerBlock = ^(NSIndexPath * _Nonnull indexPath) {
+            if (![weakSelf.tabBarController isKindOfClass:[TabBarController class]]) {
+                [TabBarController sharedTabBarController].tabBar.hidden = NO;
+                [weakSelf.tabBarController.navigationController popViewControllerAnimated:NO];
+            }
+            if ([weakSelf.navigationController.viewControllers count] > 1) {
+                [weakSelf.navigationController popToRootViewControllerAnimated:NO];
+            }
+            switch (indexPath.section) {
+                case 0:
+                {
+                    [[TabBarController sharedTabBarController] setSelectedIndex:indexPath.row];
+                }
+                    break;
+                case 1:
+                {
+                    switch (indexPath.row) {
+                        case 0:
+                        {
+                            [[TabBarController sharedTabBarController] setSelectedIndex:2];
+                        }
+                            break;
+                        case 1:
+                        {
+                            [[TabBarController sharedTabBarController] setSelectedIndex:2];
+                        }
+                            break;
+                        default:
+                        {
+                            [[TabBarController sharedTabBarController] setSelectedIndex:3];
+                        }
+                            break;
+                    }
+                    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                        [[NSNotificationCenter defaultCenter] postNotificationName:DRAWERPUSHVC object:nil userInfo:@{VCINDEX:@(indexPath.row)}];
+                    });
+                }
+                    break;
+                default:
+                {
+                    [[TabBarController sharedTabBarController] setSelectedIndex:3];
+                    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                        [[NSNotificationCenter defaultCenter] postNotificationName:DRAWERPUSHVC object:nil userInfo:@{VCINDEX:@(4 + indexPath.row)}];
+                    });
+                }
+                    break;
+            }
+        };
+        weakSelf.drawerView.frame = CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT);// - kNavigationHeight
+    };
+}
+- (void)addPageView
+{
+    self.pageView = [[SegmentViewController alloc] init];
+    NSArray * titleArray = @[@"全部",@"文章",@"书籍",@"视频",@"音频"];
+    self.pageView.titleArray = titleArray;
+    NSMutableArray *controlArray = [[NSMutableArray alloc]init];
+    
+    self.allVC = [[IndexAllVC alloc]init];
+    [controlArray addObject:self.allVC];
+
+    self.articeVC = [[IndexSubVC alloc]init];
+    [controlArray addObject:self.articeVC];
+
+    self.bookVC = [[IndexSubVC alloc]init];
+    [controlArray addObject:self.bookVC];
+    
+    self.videoVC = [[IndexSubVC alloc]init];
+    [controlArray addObject:self.videoVC];
+    
+    self.musicVC = [[IndexSubVC alloc]init];
+    [controlArray addObject:self.musicVC];
+    self.pageView.subViewControllers = controlArray;
+    self.pageView.buttonWidth = self.view.frame.size.width / titleArray.count;
+    self.pageView.buttonHeight = 34.f;
+    self.pageView.bottomCount = titleArray.count;
+    [self.pageView initSegment:0];
+    [self.pageView addParentController:self];
+    [self.pageView.view setFrame:CGRectMake(0, CGRectGetMaxY(self.topNavSearch.frame), SCREEN_WIDTH, SCREEN_HEIGHT - CGRectGetMaxY(self.topNavSearch.frame))];
+}
+@end

+ 18 - 0
smartRhino/Project/VCModel/Home/VC/SubVC/IndexAllVC.h

@@ -0,0 +1,18 @@
+//
+//  IndexAllVC.h
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/17.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface IndexAllVC : UIViewController
+@property (nonatomic, copy) NSString     * searchText;
+- (void)getData;
+@end
+
+NS_ASSUME_NONNULL_END

+ 188 - 0
smartRhino/Project/VCModel/Home/VC/SubVC/IndexAllVC.m

@@ -0,0 +1,188 @@
+//
+//  IndexAllVC.m
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/17.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import "IndexAllVC.h"
+#import "IndexAllCell.h"
+#import "IndexAllModel.h"
+#import "HomeSubItemModel.h"
+#import "BookTeacherDetailVC.h"
+#import "BookWCDetailVC.h"
+#import "BookListenVC.h"
+#import "BookListDetailVC.h"
+#import "IndexMoreVC.h"
+
+@interface IndexAllVC ()<UITableViewDelegate,UITableViewDataSource>
+@property (nonatomic, strong) UITableView    * tableView;
+@property (nonatomic, strong) NSMutableArray * dataArray;
+@end
+
+@implementation IndexAllVC
+- (NSMutableArray *)dataArray
+{
+    if (!_dataArray) {
+        _dataArray = [NSMutableArray array];
+    }
+    return _dataArray;
+}
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = UIColorHex(0xF8F8F8);
+    [self.view addSubview:self.tableView];
+    self.tableView.showsVerticalScrollIndicator = NO;
+    self.tableView.backgroundColor = [UIColor clearColor];
+    self.tableView.delegate = self;
+    self.tableView.dataSource = self;
+    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.mas_offset(UIEdgeInsetsMake(20,15,(IS_IPHONEX ? 40 : 20) + EMVIEWBOTTOMMARGIN + 50,15));
+    }];
+}
+- (void)getData
+{
+    WS(weakSelf);
+    [self.dataArray removeAllObjects];
+    SHOWLOADING
+    [[HttpManager sharedHttpManager] POSTUrl:Host(API_APP_Page_Search) parameters:@{@"keyword":self.searchText} responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+        REMOVESHOW
+        NSLog(@"%@",responseObject);
+        if ([responseObject isKindOfClass:[NSArray class]]) {
+            for (NSDictionary * dict in responseObject) {
+                IndexAllModel * model = [IndexAllModel modelWithDictionary:dict];
+                NSMutableArray * array = [NSMutableArray array];
+                for (NSDictionary * subDict in model.Items) {
+                    HomeSubItemModel * subModel = [HomeSubItemModel modelWithDictionary:subDict];
+                    [array addObject:subModel];
+                }
+                model.Items = array.mutableCopy;
+                [weakSelf.dataArray addObject:model];
+            }
+        }
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [weakSelf.tableView reloadData];
+        });
+    } failure:^(NSError * _Nonnull error) {
+        REMOVESHOW
+    }];
+}
+- (UITableView *)tableView
+{
+    if (!_tableView) {
+        _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
+        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+    }
+    return _tableView;
+}
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
+{
+    return 14.f;
+}
+- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
+{
+    return 0.01f;
+}
+- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
+{
+    UIView * view = [UIView new];
+    return view;
+}
+- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
+{
+    UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 14)];
+    view.backgroundColor = UIColorHex(0xF8F8F8);
+    return view;
+}
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+    return self.dataArray.count;
+}
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    return 1;
+}
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    WS(weakSelf);
+    IndexAllModel * model = [self.dataArray objectAtIndex:indexPath.section];
+    IndexAllCell * cell = [IndexAllCell configCell:tableView indexPath:indexPath];
+    [cell setDataWithModel:model searchText:self.searchText];
+    [cell.topBtn setAction:^{
+        [weakSelf top:model.LableId];
+    }];
+    [cell.moreBtn setAction:^{
+        [weakSelf moreWithName:model.LableName Id:model.LableId ];
+    }];
+    cell.ClickRowBlock = ^(CollectModelType type, NSInteger Id) {
+        [weakSelf pushVC:type Id:Id];
+    };
+
+    return cell;
+}
+
+- (void)top:(NSInteger)Id
+{
+    WS(weakSelf);
+    [[HttpManager sharedHttpManager] PUTUrl:Host(API_APP_Page_System_Lable_User) parameters:@{@"SystemLableId":@(Id)} responseStyle:DATA success:^(id  _Nonnull responseObject) {
+        [weakSelf getData];
+    } failure:^(NSError * _Nonnull error) {
+        
+    }];
+}
+- (void)moreWithName:(NSString *)name Id:(NSInteger)Id
+{
+    IndexMoreVC * vc = [IndexMoreVC initIndexMoreVC];
+    vc.Id = Id;
+    vc.titleStr = name;
+    [self.navigationController pushViewController:vc animated:YES];
+}
+- (void)pushVC:(CollectModelType)type Id:(NSInteger)Id
+{
+    switch (type) {
+        case CollectModel_StoreBook:
+        {
+            BookListDetailVC * vc = [BookListDetailVC initBookListDetailVC];
+            vc.Id = Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_StoreVideo:
+        {
+            BookWCDetailVC * vc = [BookWCDetailVC initBookWCDetailVC];
+            vc.Id = Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_StoreSound:
+        {
+            BookListenVC * vc = [BookListenVC initBookListenVC];
+            vc.Id = Id;
+            vc.MediaType = MediaMusicType;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_Teacher:
+        {
+            BookTeacherDetailVC * vc = [BookTeacherDetailVC initBookTeacherDetailVC];
+            vc.Id = Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_Organization:
+        {
+
+        }
+            break;
+        default:
+        {
+            MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
+            vc.type = type;
+            vc.Id = Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+    }
+}
+@end

+ 19 - 0
smartRhino/Project/VCModel/Home/VC/SubVC/IndexMoreVC.h

@@ -0,0 +1,19 @@
+//
+//  IndexMoreVC.h
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/18.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import "BaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface IndexMoreVC : BaseViewController
+@property (nonatomic, assign) NSInteger   Id;
+@property (nonatomic, copy) NSString     *titleStr;
++(IndexMoreVC *)initIndexMoreVC;
+@end
+
+NS_ASSUME_NONNULL_END

+ 251 - 0
smartRhino/Project/VCModel/Home/VC/SubVC/IndexMoreVC.m

@@ -0,0 +1,251 @@
+//
+//  IndexMoreVC.m
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/18.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import "IndexMoreVC.h"
+#import "HomeWeiCousreCell.h"
+#import "BookSubArticeCell.h"
+#import "HomeTeacherCell.h"
+#import "HomeMusicCell.h"
+#import "HomeSchoolCell.h"
+#import "IndexGoodBookCell.h"
+#import "HomeSubItemModel.h"
+#import "BookTeacherDetailVC.h"
+#import "BookWCDetailVC.h"
+#import "BookListenVC.h"
+#import "BookListDetailVC.h"
+#import "TDSearchBar.h"
+
+@interface IndexMoreVC ()<UISearchBarDelegate,UIScrollViewDelegate>
+@property (weak, nonatomic) IBOutlet UILabel  *titleL;
+@property (weak, nonatomic) IBOutlet UIButton *shareBtn;
+@property (weak, nonatomic) IBOutlet UILabel  *countL;
+@property (weak, nonatomic) IBOutlet UIButton *cateBtn;
+@property (weak, nonatomic) IBOutlet UIView   *searchView;
+@property (weak, nonatomic) IBOutlet UITableView *tableView;
+@property (nonatomic, strong) NSMutableArray * dataArray;
+@property (nonatomic, copy) NSString         * searchText;
+@property (nonatomic, assign) NSInteger        currentPage;
+@property (nonatomic, assign) NSInteger        Total;
+@property (nonatomic, strong) TDSearchBar     *searchBar;
+@end
+
+@implementation IndexMoreVC
++(IndexMoreVC *)initIndexMoreVC{
+    IndexMoreVC *controller = [StoryboardManager.shared.home instantiateViewControllerWithIdentifier:@"IndexMoreVC"];
+    return controller;
+}
+- (NSMutableArray *)dataArray
+{
+    if (!_dataArray) {
+        _dataArray = [NSMutableArray array];
+    }
+    return _dataArray;
+}
+- (TDSearchBar *)searchBar {
+    if (!_searchBar) {
+        _searchBar = [[TDSearchBar alloc] initWithFrame:CGRectZero];
+    }
+    return _searchBar;
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.fd_prefersNavigationBarHidden = YES;
+    self.view.backgroundColor = UIColorHex(0xF8F8F8);
+    self.tableView.backgroundColor = [UIColor clearColor];
+    self.tableView.layer.cornerRadius = 8.f;
+    self.tableView.layer.masksToBounds = YES;
+    self.searchBar.delegate = self;
+    WS(weakSelf);
+    self.tableView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
+        [weakSelf footerRefresh];
+    }];
+    self.titleL.text = self.titleStr;
+    [self.searchView addSubview:self.searchBar];
+    [self.searchBar mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.mas_offset(UIEdgeInsetsMake(11, 15, 11, 15));
+    }];
+    [self getData];
+}
+
+- (void)footerRefresh
+{
+    self.currentPage += 1;
+    if (self.dataArray.count == self.Total) {
+        self.tableView.mj_footer.hidden = YES;
+        [self.tableView.mj_footer resetNoMoreData];
+        return;
+    }
+    [self getDataNetWork];
+}
+- (void)getDataNetWork
+{
+    WS(weakSelf);
+    SHOWLOADING
+    NSDictionary * paraDict = @{@"LableId":@(self.Id),
+                                @"Page":@(self.currentPage),
+                                @"PerPage":@(10),
+                                @"KeyWord":self.searchText
+    };
+    [[HttpManager sharedHttpManager] GETUrl:Host(API_APP_Media_Lable_List) parameters:paraDict responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+        REMOVESHOW
+        NSLog(@"%@",responseObject);
+        if ([responseObject isKindOfClass:[NSDictionary class]]) {
+            for (NSDictionary * dict in responseObject[@"Items"]) {
+                HomeSubItemModel * model = [HomeSubItemModel modelWithDictionary:dict];
+                [weakSelf.dataArray addObject:model];
+            }
+        }
+        weakSelf.Total = [responseObject[@"Total"] integerValue];
+        [weakSelf.tableView.mj_footer endRefreshing];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [weakSelf.tableView reloadData];
+            weakSelf.countL.text = [NSString stringWithFormat:@"为你找到相关结果为%ld个",weakSelf.Total];
+        });
+    } failure:^(NSError * _Nonnull error) {
+        REMOVESHOW
+    }];
+}
+- (void)getData
+{
+    [self.dataArray removeAllObjects];
+    self.currentPage = 1;
+    self.Total = 0;
+    [self getDataNetWork];
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    return self.dataArray.count;
+}
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    HomeSubItemModel * model = [self.dataArray objectAtIndex:indexPath.row];
+    switch ((CollectModelType)model.MediaType) {
+        case CollectModel_StoreBook:
+        {
+            IndexGoodBookCell * cell = [IndexGoodBookCell configCell0:tableView indexPath:indexPath];
+            [cell setDataWithModel:model searchText:@""];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_StoreVideo:
+        {
+            HomeWeiCousreCell * cell = [HomeWeiCousreCell configCell0:tableView indexPath:indexPath];
+            [cell setDataWithIndexModel:model searchText:@""];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_StoreSound:
+        {
+            HomeMusicCell * cell = [HomeMusicCell configCell:tableView indexPath:indexPath];
+            [cell setDataWithModel:model searchText:@""];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_Teacher:
+        {
+            HomeTeacherCell * cell = [HomeTeacherCell configCell:tableView indexPath:indexPath];
+            [cell setDataWithModel:model searchText:@""];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_Organization:
+        {
+            HomeSchoolCell * cell = [HomeSchoolCell configCell1:tableView indexPath:indexPath];
+            [cell setDataIndexModel:model searchText:@""];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        default:
+        {
+            IndexGoodBookCell * cell = [IndexGoodBookCell configCell1:tableView indexPath:indexPath];
+            [cell setDataWithModel:model searchText:@""];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+    }
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    HomeSubItemModel * model = [self.dataArray objectAtIndex:indexPath.row];
+    [tableView deselectRowAtIndexPath:indexPath animated:YES];
+    switch ((CollectModelType)model.MediaType) {
+        case CollectModel_StoreBook:
+        {
+            BookListDetailVC * vc = [BookListDetailVC initBookListDetailVC];
+            vc.Id = model.Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_StoreVideo:
+        {
+            BookWCDetailVC * vc = [BookWCDetailVC initBookWCDetailVC];
+            vc.Id = model.Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_StoreSound:
+        {
+            BookListenVC * vc = [BookListenVC initBookListenVC];
+            vc.Id = model.Id;
+            vc.MediaType = MediaMusicType;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_Teacher:
+        {
+            BookTeacherDetailVC * vc = [BookTeacherDetailVC initBookTeacherDetailVC];
+            vc.Id = model.Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_Organization:
+        {
+            
+        }
+            break;
+        default:
+        {
+            MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
+            vc.type = (CollectModelType)model.MediaType;
+            vc.Id = model.Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+    }
+}
+#pragma mark - Delegata
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView
+{
+    [self setEditing:YES];
+}
+- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar {
+    self.searchText = searchBar.text;
+    [self getData];
+}
+@end

+ 19 - 0
smartRhino/Project/VCModel/Home/VC/SubVC/IndexSubVC.h

@@ -0,0 +1,19 @@
+//
+//  IndexSubVC.h
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/17.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface IndexSubVC : UIViewController
+@property (nonatomic, assign) MediaType   type;
+@property (nonatomic, copy) NSString     * searchText;
+- (void)getData;
+@end
+
+NS_ASSUME_NONNULL_END

+ 252 - 0
smartRhino/Project/VCModel/Home/VC/SubVC/IndexSubVC.m

@@ -0,0 +1,252 @@
+//
+//  IndexSubVC.m
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/17.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import "IndexSubVC.h"
+#import "HomeWeiCousreCell.h"
+#import "BookSubArticeCell.h"
+#import "HomeTeacherCell.h"
+#import "HomeMusicCell.h"
+#import "HomeSchoolCell.h"
+#import "IndexGoodBookCell.h"
+#import "HomeSubItemModel.h"
+#import "BookTeacherDetailVC.h"
+#import "BookWCDetailVC.h"
+#import "BookListenVC.h"
+#import "BookListDetailVC.h"
+
+@interface IndexSubVC ()<UITableViewDelegate,UITableViewDataSource>
+@property (nonatomic, strong) UITableView    * tableView;
+@property (nonatomic, strong) NSMutableArray * dataArray;
+@property (nonatomic, assign) NSInteger        currentPage;
+@property (nonatomic, assign) NSInteger        Total;
+@end
+
+@implementation IndexSubVC
+- (NSMutableArray *)dataArray
+{
+    if (!_dataArray) {
+        _dataArray = [NSMutableArray array];
+    }
+    return _dataArray;
+}
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = UIColorHex(0xF8F8F8);
+    [self.view addSubview:self.tableView];
+    self.tableView.showsVerticalScrollIndicator = NO;
+    self.tableView.backgroundColor = [UIColor clearColor];
+    self.tableView.delegate = self;
+    self.tableView.dataSource = self;
+    self.tableView.layer.cornerRadius = 8.f;
+    self.tableView.layer.masksToBounds = YES;
+    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.mas_offset(UIEdgeInsetsMake(20,15,(IS_IPHONEX ? 40 : 20) + EMVIEWBOTTOMMARGIN + 50,15));
+    }];
+
+    WS(weakSelf);
+    self.tableView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
+        [weakSelf footerRefresh];
+    }];
+}
+
+- (void)footerRefresh
+{
+    self.currentPage += 1;
+    if (self.dataArray.count == self.Total) {
+        self.tableView.mj_footer.hidden = YES;
+        [self.tableView.mj_footer resetNoMoreData];
+        return;
+    }
+    [self getDataNetWork];
+}
+- (void)getDataNetWork
+{
+    WS(weakSelf);
+    SHOWLOADING
+    NSDictionary * paraDict = @{@"MediaType":@(self.type),
+                                @"Page":@(self.currentPage),
+                                @"PerPage":@(10),
+                                @"KeyWord":self.searchText
+    };
+    [[HttpManager sharedHttpManager] GETUrl:Host(API_APP_Media_Search) parameters:paraDict responseStyle:JOSN success:^(id  _Nonnull responseObject) {
+        REMOVESHOW
+        NSLog(@"%@",responseObject);
+        if ([responseObject isKindOfClass:[NSDictionary class]]) {
+            for (NSDictionary * dict in responseObject[@"Items"]) {
+                HomeSubItemModel * model = [HomeSubItemModel modelWithDictionary:dict];
+                [weakSelf.dataArray addObject:model];
+            }
+        }
+        weakSelf.Total = [responseObject[@"Total"] integerValue];
+        [weakSelf.tableView.mj_footer endRefreshing];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [weakSelf.tableView reloadData];
+        });
+    } failure:^(NSError * _Nonnull error) {
+        REMOVESHOW
+    }];
+}
+- (void)getData
+{
+    [self.dataArray removeAllObjects];
+    self.currentPage = 1;
+    self.Total = 0;
+    [self getDataNetWork];
+}
+- (UITableView *)tableView
+{
+    if (!_tableView) {
+        _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
+        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+    }
+    return _tableView;
+}
+//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
+//{
+//    return self.dataArray.count == 0 ? 0.01f : 15.f;
+//}
+//- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
+//{
+//    return self.dataArray.count == 0 ? 0.01f : 15.f;
+//}
+//- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
+//{
+//    UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, self.dataArray.count == 0 ? 0.01f : 15.f)];
+//    view.backgroundColor = UIColorHex(0xFFFFFF);
+//    return view;
+//}
+//- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
+//{
+//    UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, self.dataArray.count == 0 ? 0.01f : 15.f)];
+//    view.backgroundColor = UIColorHex(0xFFFFFF);
+//    return view;
+//}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    return self.dataArray.count;
+}
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    HomeSubItemModel * model = [self.dataArray objectAtIndex:indexPath.row];
+    switch ((CollectModelType)model.MediaType) {
+        case CollectModel_StoreBook:
+        {
+            IndexGoodBookCell * cell = [IndexGoodBookCell configCell0:tableView indexPath:indexPath];
+            [cell setDataWithModel:model searchText:self.searchText];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_StoreVideo:
+        {
+            HomeWeiCousreCell * cell = [HomeWeiCousreCell configCell0:tableView indexPath:indexPath];
+            [cell setDataWithIndexModel:model searchText:self.searchText];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_StoreSound:
+        {
+            HomeMusicCell * cell = [HomeMusicCell configCell:tableView indexPath:indexPath];
+            [cell setDataWithModel:model searchText:self.searchText];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_Teacher:
+        {
+            HomeTeacherCell * cell = [HomeTeacherCell configCell:tableView indexPath:indexPath];
+            [cell setDataWithModel:model searchText:self.searchText];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_Organization:
+        {
+            HomeSchoolCell * cell = [HomeSchoolCell configCell1:tableView indexPath:indexPath];
+            [cell setDataIndexModel:model searchText:self.searchText];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        default:
+        {
+            IndexGoodBookCell * cell = [IndexGoodBookCell configCell1:tableView indexPath:indexPath];
+            [cell setDataWithModel:model searchText:self.searchText];
+            if (self.dataArray.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+    }
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    HomeSubItemModel * model = [self.dataArray objectAtIndex:indexPath.row];
+    [tableView deselectRowAtIndexPath:indexPath animated:YES];
+    switch ((CollectModelType)model.MediaType) {
+        case CollectModel_StoreBook:
+        {
+            BookListDetailVC * vc = [BookListDetailVC initBookListDetailVC];
+            vc.Id = model.Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_StoreVideo:
+        {
+            BookWCDetailVC * vc = [BookWCDetailVC initBookWCDetailVC];
+            vc.Id = model.Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_StoreSound:
+        {
+            BookListenVC * vc = [BookListenVC initBookListenVC];
+            vc.Id = model.Id;
+            vc.MediaType = MediaMusicType;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_Teacher:
+        {
+            BookTeacherDetailVC * vc = [BookTeacherDetailVC initBookTeacherDetailVC];
+            vc.Id = model.Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+        case CollectModel_Organization:
+        {
+
+        }
+            break;
+        default:
+        {
+            MyTDTopicDetailVC * vc = [MyTDTopicDetailVC initMyTDTopicDetailVC];
+            vc.type = (CollectModelType)model.MediaType;
+            vc.Id = model.Id;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+            break;
+    }
+}
+
+@end
+

+ 8 - 4
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeGoodBookCell.xib

@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -28,7 +29,7 @@
                     </label>
                     <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="ysF-Xb-9r9">
                         <rect key="frame" x="0.0" y="46" width="320" height="100"/>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="100" id="Gf8-xE-dZW"/>
                         </constraints>
@@ -58,7 +59,7 @@
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Book_huan_Btn" translatesAutoresizingMaskIntoConstraints="NO" id="NYx-Wu-Vty">
                                 <rect key="frame" x="131.5" y="16.5" width="11" height="11"/>
                             </imageView>
-                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eXD-Mb-dOw">
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eXD-Mb-dOw">
                                 <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                             </button>
                         </subviews>
@@ -107,5 +108,8 @@
     <resources>
         <image name="Book_huan_Btn" width="11" height="11"/>
         <image name="home_hot_icon" width="32" height="16"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
     </resources>
 </document>

+ 1 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeMusicCell.h

@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 + (HomeMusicCell *)configCell:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath;
 - (void)setDataWithModel:(HomeSubItemModel *)model;
+- (void)setDataWithModel:(HomeSubItemModel *)model searchText:(NSString *)text;
 @end
 
 NS_ASSUME_NONNULL_END

+ 12 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeMusicCell.m

@@ -7,6 +7,7 @@
 //
 
 #import "HomeMusicCell.h"
+#import "NSDate+Extension.h"
 
 @implementation HomeMusicCell
 
@@ -39,4 +40,15 @@
     self.countL.text = [NSString stringWithFormat:@"%ld",model.ReadCount];
 //    self.timeL.text = model.Duration;
 }
+- (void)setDataWithModel:(HomeSubItemModel *)model searchText:(NSString *)text
+{
+    [self.imagV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")];
+    self.titleL.attributedText = [ZYCTool checkOfString:model.Title withSearchText:text withColor:UIColorHex(0xFF5252)];
+    self.subTitleL.text = @"";
+    self.titleL.numberOfLines = 1;
+    self.soundContant.constant = 0.f;
+    self.countL.text = [NSString stringWithFormat:@"%ld",model.ReadCount];
+    self.timeL.text = model.Duration;
+    self.DateL.text = [NSDate getMonthAndDayWihtDate:model.CreatedDate];
+}
 @end

+ 17 - 17
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeMusicCell.xib

@@ -1,20 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="KGk-i7-Jjw" customClass="HomeMusicCell">
-            <rect key="frame" x="0.0" y="0.0" width="320" height="100"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="89" id="KGk-i7-Jjw" customClass="HomeMusicCell">
+            <rect key="frame" x="0.0" y="0.0" width="320" height="85"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
-                <rect key="frame" x="0.0" y="0.0" width="320" height="100"/>
+                <rect key="frame" x="0.0" y="0.0" width="320" height="85"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wPR-i3-uWF">
@@ -25,7 +25,7 @@
                         </constraints>
                     </view>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_placeHolder" translatesAutoresizingMaskIntoConstraints="NO" id="MFp-Pv-IJS">
-                        <rect key="frame" x="15" y="30" width="40" height="40"/>
+                        <rect key="frame" x="15" y="22.5" width="40" height="40"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="40" id="IYf-89-w3Z"/>
                             <constraint firstAttribute="width" constant="40" id="OI3-DX-v8h"/>
@@ -38,16 +38,16 @@
                         </userDefinedRuntimeAttributes>
                     </imageView>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Book_Musicplay_btn" translatesAutoresizingMaskIntoConstraints="NO" id="DFI-bp-gtH">
-                        <rect key="frame" x="29.5" y="44" width="11" height="12.5"/>
+                        <rect key="frame" x="29.5" y="36.5" width="11" height="12.5"/>
                     </imageView>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2020未来教育论坛金句集锦——林建华 今天的教育决定国家的未来" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xga-Oc-bkQ">
-                        <rect key="frame" x="70" y="13" width="235" height="44.5"/>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2020未来教育论坛金句集" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xga-Oc-bkQ">
+                        <rect key="frame" x="70" y="13" width="235" height="29.5"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <color key="textColor" red="0.039215686274509803" green="0.039215686274509803" blue="0.039215686274509803" alpha="1" colorSpace="calibratedRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="新概念英语" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zvu-IP-2sN">
-                        <rect key="frame" x="70" y="69.5" width="66.5" height="15"/>
+                        <rect key="frame" x="70" y="54.5" width="66.5" height="15"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="15" id="QRy-W5-eNR"/>
                             <constraint firstAttribute="width" relation="lessThanOrEqual" constant="72" id="hal-1P-BbM"/>
@@ -57,21 +57,21 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_guangbo_icon" translatesAutoresizingMaskIntoConstraints="NO" id="OYa-4d-qlb">
-                        <rect key="frame" x="151.5" y="71.5" width="11" height="11"/>
+                        <rect key="frame" x="151.5" y="56.5" width="11" height="11"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="11" id="ExU-tq-hGd"/>
                             <constraint firstAttribute="height" constant="11" id="z7W-Ul-LHN"/>
                         </constraints>
                     </imageView>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_ting_icon" translatesAutoresizingMaskIntoConstraints="NO" id="No3-0K-Eec">
-                        <rect key="frame" x="229" y="71.5" width="11" height="11"/>
+                        <rect key="frame" x="229" y="56.5" width="11" height="11"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="11" id="5Ow-lC-GhQ"/>
                             <constraint firstAttribute="width" constant="11" id="Tbe-VT-ITU"/>
                         </constraints>
                     </imageView>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="01:47:42" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WoE-ks-I2V">
-                        <rect key="frame" x="165.5" y="69.5" width="53.5" height="15"/>
+                        <rect key="frame" x="165.5" y="54.5" width="53.5" height="15"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="15" id="NpZ-Rc-cwJ"/>
                         </constraints>
@@ -80,7 +80,7 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="320" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OkM-A9-iIU">
-                        <rect key="frame" x="243" y="69.5" width="24" height="15"/>
+                        <rect key="frame" x="243" y="54.5" width="24" height="15"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="15" id="c5a-0B-4ur"/>
                         </constraints>
@@ -89,7 +89,7 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="02-07" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r6V-xZ-PHP">
-                        <rect key="frame" x="277" y="69.5" width="37.5" height="15"/>
+                        <rect key="frame" x="277" y="54.5" width="37.5" height="15"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="15" id="GJF-oM-dc9"/>
                         </constraints>
@@ -98,7 +98,7 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="r2L-v9-OqF">
-                        <rect key="frame" x="15" y="99.5" width="290" height="0.5"/>
+                        <rect key="frame" x="15" y="84.5" width="290" height="0.5"/>
                         <color key="backgroundColor" red="0.89803921568627454" green="0.89803921568627454" blue="0.89803921568627454" alpha="1" colorSpace="calibratedRGB"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="0.5" id="As2-qD-AKe"/>
@@ -149,7 +149,7 @@
                 <outlet property="tingImgV" destination="No3-0K-Eec" id="UjF-8m-Ybk"/>
                 <outlet property="titleL" destination="xga-Oc-bkQ" id="yPL-LE-fDL"/>
             </connections>
-            <point key="canvasLocation" x="137.68115942028987" y="152.67857142857142"/>
+            <point key="canvasLocation" x="137.68115942028987" y="148.32589285714286"/>
         </tableViewCell>
     </objects>
     <resources>

+ 9 - 1
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeSchoolCell.h

@@ -7,6 +7,7 @@
 //
 
 #import <UIKit/UIKit.h>
+#import "HomeSubItemModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -22,9 +23,16 @@ NS_ASSUME_NONNULL_BEGIN
 @property (weak, nonatomic) IBOutlet NSLayoutConstraint *levelW;
 @property (weak, nonatomic) IBOutlet UIView *topView;
 @property (weak, nonatomic) IBOutlet NSLayoutConstraint *height;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *subContant;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *subTopContant;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *subBottomContant;
+@property (weak, nonatomic) IBOutlet UIView *lineV;
 
-+ (HomeSchoolCell *)configCell:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath;
++ (HomeSchoolCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath;
++ (HomeSchoolCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath;
 - (void)setData;
+
+- (void)setDataIndexModel:(HomeSubItemModel *)model searchText:(NSString *)text;
 @end
 
 NS_ASSUME_NONNULL_END

+ 27 - 2
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeSchoolCell.m

@@ -28,14 +28,22 @@
 
     // Configure the view for the selected state
 }
-+ (HomeSchoolCell *)configCell:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
-    static NSString *cellIdentifer = @"HomeSchoolCell";
++ (HomeSchoolCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
+    static NSString *cellIdentifer = @"HomeSchoolCell0";
     HomeSchoolCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
     if (cell == nil) {
         cell = [[[NSBundle mainBundle] loadNibNamed:@"HomeSchoolCell" owner:nil options:nil] objectAtIndex:0];
     }
     return cell;
 }
++ (HomeSchoolCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
+    static NSString *cellIdentifer = @"HomeSchoolCell1";
+    HomeSchoolCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
+    if (cell == nil) {
+        cell = [[[NSBundle mainBundle] loadNibNamed:@"HomeSchoolCell" owner:nil options:nil] objectAtIndex:1];
+    }
+    return cell;
+}
 - (void)setData
 {
     self.addressL.text = @"北京";
@@ -45,6 +53,23 @@
     self.numW.constant = [self addPlaceLabel:self.numL];
     self.levelW.constant = [self addPlaceLabel:self.levelL];
 }
+
+- (void)setDataIndexModel:(HomeSubItemModel *)model searchText:(NSString *)text
+{
+    [self.imagV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:kPlaceHolderImage];
+    self.titleL.attributedText = [ZYCTool checkOfString:model.Title withSearchText:text withColor:UIColorHex(0xFF5252)];
+    self.addressL.text = @"北京";
+    self.numL.text = @"特级教师36人";
+    self.levelL.text = @"小学、初中";
+    self.subTitleL.hidden = YES;
+    self.subContant.constant = 0.f;
+    self.subTopContant.constant = 0.f;
+    self.subBottomContant.constant = 0.f;
+
+    self.addW.constant = [self addPlaceLabel:self.addressL];
+    self.numW.constant = [self addPlaceLabel:self.numL];
+    self.levelW.constant = [self addPlaceLabel:self.levelL];
+}
 - (CGFloat)addPlaceLabel:(UILabel *)label
 {
     CGFloat W = [label sizeThatFits:CGSizeMake(SCREEN_WIDTH, 18)].width  + 16;

+ 106 - 5
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeSchoolCell.xib

@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="149" id="DJJ-nF-PsO" customClass="HomeSchoolCell">
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="HomeSchoolCell0" rowHeight="149" id="DJJ-nF-PsO" customClass="HomeSchoolCell">
             <rect key="frame" x="0.0" y="0.0" width="320" height="149"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="DJJ-nF-PsO" id="DnF-qW-JJE">
@@ -37,7 +37,7 @@
                             <constraint firstAttribute="height" constant="10" id="Hvb-Ov-vqO"/>
                         </constraints>
                     </view>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="中国河北大学附属中学廊坊市天河 区京沈路校区西校区分校第三" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gMI-LX-MFJ">
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="中国河北大学附属中学廊坊市天河 区京沈路校区西校区分校第三" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gMI-LX-MFJ">
                         <rect key="frame" x="85" y="25" width="220" height="51.5"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <color key="textColor" red="0.039215686270000001" green="0.039215686270000001" blue="0.039215686270000001" alpha="1" colorSpace="calibratedRGB"/>
@@ -122,13 +122,114 @@
                 <outlet property="imagV" destination="6t5-sz-xts" id="bbt-Zc-dWe"/>
                 <outlet property="levelL" destination="yaU-j5-jfH" id="P2H-dW-AB8"/>
                 <outlet property="levelW" destination="CTR-fK-UrO" id="FSy-36-H60"/>
+                <outlet property="lineV" destination="c9B-P9-K6s" id="UU1-yT-hAa"/>
                 <outlet property="numL" destination="PO9-EV-e5n" id="7RB-78-puA"/>
                 <outlet property="numW" destination="kP6-Nn-JHh" id="908-5O-XtD"/>
+                <outlet property="subBottomContant" destination="GiB-lw-ZyX" id="mTG-ER-BPG"/>
+                <outlet property="subContant" destination="O3O-SS-MbE" id="0ef-Fw-hEf"/>
                 <outlet property="subTitleL" destination="jTZ-ua-nBF" id="cQt-0k-q01"/>
+                <outlet property="subTopContant" destination="dwN-Td-nGw" id="A8F-0C-0ZQ"/>
                 <outlet property="titleL" destination="gMI-LX-MFJ" id="a5p-5F-cZ5"/>
                 <outlet property="topView" destination="bTZ-96-WsT" id="bJg-PN-wqJ"/>
             </connections>
-            <point key="canvasLocation" x="137.68115942028987" y="198.54910714285714"/>
+            <point key="canvasLocation" x="138" y="351"/>
+        </tableViewCell>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="HomeSchoolCell1" rowHeight="132" id="Hk6-lP-zuo" customClass="HomeSchoolCell">
+            <rect key="frame" x="0.0" y="0.0" width="320" height="120"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Hk6-lP-zuo" id="SS7-p0-xVx">
+                <rect key="frame" x="0.0" y="0.0" width="320" height="120"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_placeHolder" translatesAutoresizingMaskIntoConstraints="NO" id="yl5-Yw-dao">
+                        <rect key="frame" x="15" y="20" width="80" height="80"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="80" id="XCj-05-B8U"/>
+                            <constraint firstAttribute="width" constant="80" id="aXl-U7-sp2"/>
+                        </constraints>
+                        <userDefinedRuntimeAttributes>
+                            <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
+                                <integer key="value" value="4"/>
+                            </userDefinedRuntimeAttribute>
+                            <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
+                        </userDefinedRuntimeAttributes>
+                    </imageView>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="西校区分校第三" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dsY-IF-wYb">
+                        <rect key="frame" x="110" y="32" width="195" height="20.5"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                        <color key="textColor" red="0.039215686270000001" green="0.039215686270000001" blue="0.039215686270000001" alpha="1" colorSpace="calibratedRGB"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                    <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="b6e-HW-Xl6">
+                        <rect key="frame" x="15" y="119.5" width="290" height="0.5"/>
+                        <color key="backgroundColor" red="0.8980392157" green="0.8980392157" blue="0.8980392157" alpha="1" colorSpace="calibratedRGB"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="0.5" id="mU5-AM-kvu"/>
+                        </constraints>
+                    </view>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="北京" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hjQ-OY-kfG">
+                        <rect key="frame" x="110" y="64.5" width="20" height="18"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="18" id="Mut-Lo-g7n"/>
+                            <constraint firstAttribute="width" constant="20" id="OX1-UE-iwO"/>
+                        </constraints>
+                        <fontDescription key="fontDescription" type="system" pointSize="10"/>
+                        <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="特级教师28人" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sqx-7g-dgE">
+                        <rect key="frame" x="135" y="64.5" width="20" height="18"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="20" id="Qxu-B8-eEG"/>
+                            <constraint firstAttribute="height" constant="18" id="i7x-FH-epw"/>
+                        </constraints>
+                        <fontDescription key="fontDescription" type="system" pointSize="10"/>
+                        <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="初中" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jhZ-K2-R0f">
+                        <rect key="frame" x="160" y="64.5" width="20" height="18"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="20" id="Mji-9P-aah"/>
+                            <constraint firstAttribute="height" constant="18" id="Zy4-Sd-JPD"/>
+                        </constraints>
+                        <fontDescription key="fontDescription" type="system" pointSize="10"/>
+                        <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                        <nil key="highlightedColor"/>
+                    </label>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="hjQ-OY-kfG" firstAttribute="top" secondItem="dsY-IF-wYb" secondAttribute="bottom" constant="12" id="6eF-Re-mtD"/>
+                    <constraint firstItem="yl5-Yw-dao" firstAttribute="leading" secondItem="SS7-p0-xVx" secondAttribute="leading" constant="15" id="Asu-CQ-WwT"/>
+                    <constraint firstAttribute="trailing" secondItem="dsY-IF-wYb" secondAttribute="trailing" constant="15" id="FAp-WN-ooS"/>
+                    <constraint firstItem="yl5-Yw-dao" firstAttribute="top" secondItem="SS7-p0-xVx" secondAttribute="top" constant="20" id="H7p-Gd-9N8"/>
+                    <constraint firstAttribute="bottom" secondItem="b6e-HW-Xl6" secondAttribute="bottom" id="HuH-kv-A1P"/>
+                    <constraint firstItem="sqx-7g-dgE" firstAttribute="leading" secondItem="hjQ-OY-kfG" secondAttribute="trailing" constant="5" id="JcU-o4-5Rx"/>
+                    <constraint firstItem="b6e-HW-Xl6" firstAttribute="top" secondItem="yl5-Yw-dao" secondAttribute="bottom" constant="19.5" id="LdG-zg-Veu"/>
+                    <constraint firstItem="hjQ-OY-kfG" firstAttribute="leading" secondItem="dsY-IF-wYb" secondAttribute="leading" id="SAX-Ye-n7F"/>
+                    <constraint firstItem="jhZ-K2-R0f" firstAttribute="leading" secondItem="sqx-7g-dgE" secondAttribute="trailing" constant="5" id="axp-aI-5n6"/>
+                    <constraint firstItem="b6e-HW-Xl6" firstAttribute="leading" secondItem="SS7-p0-xVx" secondAttribute="leading" constant="15" id="b8r-dD-epn"/>
+                    <constraint firstItem="dsY-IF-wYb" firstAttribute="centerY" secondItem="yl5-Yw-dao" secondAttribute="centerY" constant="-18" id="d8N-z0-H8A"/>
+                    <constraint firstItem="sqx-7g-dgE" firstAttribute="centerY" secondItem="hjQ-OY-kfG" secondAttribute="centerY" id="eHC-dx-OLA"/>
+                    <constraint firstAttribute="trailing" secondItem="b6e-HW-Xl6" secondAttribute="trailing" constant="15" id="hYl-3j-cPm"/>
+                    <constraint firstItem="yl5-Yw-dao" firstAttribute="centerY" secondItem="SS7-p0-xVx" secondAttribute="centerY" id="oe2-Lt-Zq9"/>
+                    <constraint firstItem="jhZ-K2-R0f" firstAttribute="centerY" secondItem="sqx-7g-dgE" secondAttribute="centerY" id="qq7-QU-OSg"/>
+                    <constraint firstItem="dsY-IF-wYb" firstAttribute="leading" secondItem="yl5-Yw-dao" secondAttribute="trailing" constant="15" id="ysF-H1-16m"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="F6b-FD-wJ6"/>
+            <connections>
+                <outlet property="addW" destination="OX1-UE-iwO" id="Bjz-da-a9x"/>
+                <outlet property="addressL" destination="hjQ-OY-kfG" id="j1V-Xy-Vpc"/>
+                <outlet property="imagV" destination="yl5-Yw-dao" id="3Cl-vN-9bZ"/>
+                <outlet property="levelL" destination="jhZ-K2-R0f" id="qzK-Aw-ZmW"/>
+                <outlet property="levelW" destination="Mji-9P-aah" id="LaM-rC-tZb"/>
+                <outlet property="lineV" destination="b6e-HW-Xl6" id="boF-bV-VBV"/>
+                <outlet property="numL" destination="sqx-7g-dgE" id="ib9-B7-MNs"/>
+                <outlet property="numW" destination="Qxu-B8-eEG" id="9Hl-VF-tVC"/>
+                <outlet property="titleL" destination="dsY-IF-wYb" id="tC8-cf-99U"/>
+            </connections>
+            <point key="canvasLocation" x="137.68115942028987" y="492.85714285714283"/>
         </tableViewCell>
     </objects>
     <resources>

+ 18 - 14
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeTableViewCell.xib

@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina5_9" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -18,12 +19,12 @@
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YgE-8E-OAL">
-                        <rect key="frame" x="14" y="11" width="346" height="28"/>
+                        <rect key="frame" x="14" y="11.000000000000002" width="346" height="26.666666666666671"/>
                         <attributedString key="attributedText">
                             <fragment content="Label">
                                 <attributes>
-                                    <color key="NSColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
-                                    <font key="NSFont" size="20" name="PingFangSC-Regular"/>
+                                    <color key="NSColor" name="textColor" catalog="System" colorSpace="catalog"/>
+                                    <font key="NSFont" size="19" name="PingFangSC-Regular"/>
                                     <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
                                 </attributes>
                             </fragment>
@@ -31,22 +32,22 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KFl-uC-noW">
-                        <rect key="frame" x="14" y="54" width="31" height="17.666666666666671"/>
+                        <rect key="frame" x="14" y="52.666666666666664" width="31" height="18.999999999999993"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_browse" translatesAutoresizingMaskIntoConstraints="NO" id="KbR-uD-9vR">
-                        <rect key="frame" x="59.999999999999993" y="58.333333333333336" width="12.666666666666664" height="9.0000000000000071"/>
+                        <rect key="frame" x="59.999999999999993" y="57.666666666666664" width="12.666666666666664" height="8.9999999999999929"/>
                     </imageView>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7Co-Gx-Kdg">
-                        <rect key="frame" x="77.666666666666671" y="55.666666666666664" width="31" height="14.333333333333336"/>
+                        <rect key="frame" x="77.666666666666671" y="55" width="31" height="14.333333333333329"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Khb-wA-qTJ" customClass="TDButton">
-                        <rect key="frame" x="355" y="51.666666666666664" width="8" height="21.999999999999993"/>
+                        <rect key="frame" x="355" y="51" width="8" height="22"/>
                         <state key="normal" image="icon_delete"/>
                         <connections>
                             <action selector="deleteButtonClicked:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="atU-JK-psD"/>
@@ -125,7 +126,7 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Dh-EO-9mO">
-                        <rect key="frame" x="142" y="53" width="31" height="14.333333333333329"/>
+                        <rect key="frame" x="142" y="51.666666666666664" width="31" height="14.333333333333336"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
@@ -145,12 +146,12 @@
                         </connections>
                     </button>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7k3-6j-kIG">
-                        <rect key="frame" x="142" y="20" width="218" height="28"/>
+                        <rect key="frame" x="142" y="20" width="218" height="26.666666666666671"/>
                         <attributedString key="attributedText">
                             <fragment content="Label">
                                 <attributes>
                                     <color key="NSColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
-                                    <font key="NSFont" size="20" name="PingFangSC-Regular"/>
+                                    <font key="NSFont" size="19" name="PingFangSC-Regular"/>
                                     <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
                                 </attributes>
                             </fragment>
@@ -205,7 +206,7 @@
                             <fragment content="Label">
                                 <attributes>
                                     <color key="NSColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
-                                    <font key="NSFont" size="20" name="PingFangSC-Regular"/>
+                                    <font key="NSFont" size="19" name="PingFangSC-Regular"/>
                                     <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
                                 </attributes>
                             </fragment>
@@ -264,7 +265,7 @@
                                 </subviews>
                             </stackView>
                         </subviews>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                             <constraint firstAttribute="bottom" secondItem="eJF-jW-6lE" secondAttribute="bottom" id="669-6a-4xa"/>
                             <constraint firstItem="eJF-jW-6lE" firstAttribute="leading" secondItem="GIO-Ee-ceQ" secondAttribute="leading" id="EIm-Fs-VWU"/>
@@ -330,5 +331,8 @@
         <image name="icon_browse" width="12.666666984558105" height="9"/>
         <image name="icon_delete" width="8" height="8.6666669845581055"/>
         <image name="img_placeHolder" width="800" height="800"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
     </resources>
 </document>

+ 2 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeTeacherCell.h

@@ -17,9 +17,11 @@ NS_ASSUME_NONNULL_BEGIN
 @property (weak, nonatomic) IBOutlet UILabel *nameL;
 @property (weak, nonatomic) IBOutlet UILabel *subTitleL;
 @property (weak, nonatomic) IBOutlet UILabel *countl;
+@property (weak, nonatomic) IBOutlet UIView *lineV;
 @property (copy, nonatomic) void(^ClickCollectBlock)(NSInteger Id);
 + (HomeTeacherCell *)configCell:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath;
 - (void)setDataWithModel:(HomeSubItemModel *)model;
+- (void)setDataWithModel:(HomeSubItemModel *)model searchText:(NSString *)text;
 @end
 
 NS_ASSUME_NONNULL_END

+ 9 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeTeacherCell.m

@@ -54,4 +54,13 @@
         }
     }];
 }
+
+- (void)setDataWithModel:(HomeSubItemModel *)model searchText:(NSString *)text
+{
+    [self.imagV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")];
+    self.subTitleL.text = model.Summary;
+    self.nameL.attributedText = [ZYCTool checkOfString:model.Title withSearchText:text withColor:UIColorHex(0xFF5252)];
+    self.countl.text = [NSString stringWithFormat:@"收藏:%ld",model.CollectCount];
+    self.collectBtn.hidden = YES;
+}
 @end

+ 4 - 3
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeTeacherCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -42,7 +42,7 @@
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
-                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BcD-9t-0sI">
+                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BcD-9t-0sI">
                         <rect key="frame" x="261" y="54" width="44" height="22"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="22" id="dl2-PD-xMJ"/>
@@ -83,6 +83,7 @@
                 <outlet property="collectBtn" destination="BcD-9t-0sI" id="Yhq-Jc-tKb"/>
                 <outlet property="countl" destination="9Dx-Qy-2N4" id="tSh-N8-puE"/>
                 <outlet property="imagV" destination="TRr-1h-jmP" id="vCK-YS-hUj"/>
+                <outlet property="lineV" destination="k8h-rU-HaY" id="HpM-Ha-beg"/>
                 <outlet property="nameL" destination="dpR-D9-Tpp" id="if3-tZ-4Og"/>
                 <outlet property="subTitleL" destination="o1z-ap-61o" id="I0t-7M-Ill"/>
             </connections>

+ 2 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeWeiCousreCell.h

@@ -46,6 +46,8 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)setDataVideoModel:(BookChanelRightModel *)model;
 - (void)setDataRightModel:(BookChanelRightModel *)model;
 - (void)setDataWithModel:(HomeSubItemModel *)model;
+- (void)setDataWithIndexModel:(HomeSubItemModel *)model searchText:(NSString *)text;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 31 - 5
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeWeiCousreCell.m

@@ -97,6 +97,20 @@
     self.nameL.text = model.Author;
     self.numL.text = [NSString stringWithFormat:@"%ld",model.ReadCount];
 }
+- (void)setDataWithIndexModel:(HomeSubItemModel *)model searchText:(NSString *)text
+{
+    [self.imgV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")];
+    self.titleL.attributedText = [ZYCTool checkOfString:model.Title withSearchText:text withColor:UIColorHex(0xFF5252)];
+    CGFloat height = [self.titleL sizeThatFits:CGSizeMake(SCREEN_WIDTH - 205, MAXFLOAT)].height;
+    if (height > 30) {
+        self.subTitleL.numberOfLines = 1;
+    }else{
+        self.subTitleL.numberOfLines = 2;
+    }
+    self.subTitleL.text = model.Summary;
+    self.nameL.text = model.Author;
+    self.numL.text = [NSString stringWithFormat:@"%ld",model.ReadCount];
+}
 - (void)setDataWithModel:(HomeSubItemModel *)model
 {
     [self.imgV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")];
@@ -160,6 +174,18 @@
     [self.collectionView setContentOffset:CGPointZero animated:NO];
     [self setArray:array];
     [self.collectionView reloadData];
+    NSInteger item = 0;
+    for (NSInteger i = 0; i < array.count; i ++) {
+        BookListenSubModel * model = array[i];
+        if (model.isSelect) {
+            item = i;
+        }
+    }
+    WS(weakSelf);
+    NSIndexPath * indexPath = [NSIndexPath indexPathForItem:item inSection:0];
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [weakSelf.collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionLeft animated:YES];
+    });
 }
 - (void)setArray:(NSArray *)array
 {
@@ -188,23 +214,23 @@
 - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
 {
     HomeWeiCousreCollectCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeWeiCousreCollectCell" forIndexPath:indexPath];
-    BookListenSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
+    BookListenSubModel * model = [self.dataArray objectAtIndex:indexPath.item];
     [cell setDataWithTitle:model.Name isSelect:model.isSelect];
     return cell;
 }
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
 {
-    [collectionView deselectItemAtIndexPath:indexPath animated:YES];
     WS(weakSelf);
-    BookListenSubModel * model = [self.dataArray objectAtIndex:indexPath.row];
+    [collectionView deselectItemAtIndexPath:indexPath animated:YES];
+    BookListenSubModel * model = [self.dataArray objectAtIndex:indexPath.item];
     for (BookListenSubModel * smodel in self.dataArray) {
         smodel.isSelect = NO;
     }
     model.isSelect = YES;
-    [self.collectionView reloadData];
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
         [weakSelf.collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionLeft animated:YES];
     });
+    [self.collectionView reloadData];
     if (self.ClickItemBlock) {
         self.ClickItemBlock(model);
     }

+ 14 - 10
smartRhino/Project/VCModel/Home/VC/View/Cell/HomeWeiCousreCell.xib

@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -33,7 +34,7 @@
                                 <nil key="highlightedColor"/>
                             </label>
                         </subviews>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="80" id="69I-ie-syq"/>
                             <constraint firstItem="Bgp-qa-TtD" firstAttribute="centerY" secondItem="uol-zb-5L9" secondAttribute="centerY" id="Jfq-Pu-2vn"/>
@@ -141,7 +142,7 @@
                 <subviews>
                     <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="Jck-7h-Uq0">
                         <rect key="frame" x="15" y="15" width="290" height="80"/>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="E7B-2R-aX9">
                             <size key="itemSize" width="50" height="50"/>
                             <size key="headerReferenceSize" width="0.0" height="0.0"/>
@@ -199,7 +200,7 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3.7万人已学习" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="e1P-BX-gYZ">
-                        <rect key="frame" x="113" y="93.5" width="91.5" height="17"/>
+                        <rect key="frame" x="113" y="93.5" width="91" height="17"/>
                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
@@ -308,10 +309,10 @@
             <point key="canvasLocation" x="111.59420289855073" y="347.54464285714283"/>
         </tableViewCell>
         <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="HomeWeiCousreCell4" rowHeight="130" id="91l-XX-Lyg" customClass="HomeWeiCousreCell">
-            <rect key="frame" x="0.0" y="0.0" width="320" height="110.5"/>
+            <rect key="frame" x="0.0" y="0.0" width="320" height="110"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="91l-XX-Lyg" id="B29-Nk-6lM">
-                <rect key="frame" x="0.0" y="0.0" width="320" height="110.5"/>
+                <rect key="frame" x="0.0" y="0.0" width="320" height="110"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bZM-XU-n5i">
@@ -330,7 +331,7 @@
                                 <nil key="highlightedColor"/>
                             </label>
                         </subviews>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                             <constraint firstItem="TXB-zZ-Xv3" firstAttribute="centerY" secondItem="ajT-CT-7WK" secondAttribute="centerY" id="29r-tL-rRG"/>
                             <constraint firstAttribute="width" constant="130" id="3th-K8-Yqt"/>
@@ -357,7 +358,7 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3vg-Et-rWE">
-                        <rect key="frame" x="0.0" y="110" width="320" height="0.5"/>
+                        <rect key="frame" x="0.0" y="109.5" width="320" height="0.5"/>
                         <color key="backgroundColor" red="0.8980392157" green="0.8980392157" blue="0.8980392157" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="0.5" id="MJz-p6-NRa"/>
@@ -371,7 +372,7 @@
                     </label>
                 </subviews>
                 <constraints>
-                    <constraint firstItem="3vg-Et-rWE" firstAttribute="top" secondItem="bZM-XU-n5i" secondAttribute="bottom" constant="15" id="0gi-Cm-I2J"/>
+                    <constraint firstItem="3vg-Et-rWE" firstAttribute="top" secondItem="bZM-XU-n5i" secondAttribute="bottom" constant="14.5" id="0gi-Cm-I2J"/>
                     <constraint firstItem="7V0-cn-IqN" firstAttribute="leading" secondItem="ylM-sq-9Ba" secondAttribute="leading" id="3IK-L4-F7y"/>
                     <constraint firstItem="ylM-sq-9Ba" firstAttribute="top" secondItem="d81-lp-DFW" secondAttribute="top" id="4qT-sK-8xl"/>
                     <constraint firstItem="bZM-XU-n5i" firstAttribute="leading" secondItem="B29-Nk-6lM" secondAttribute="leading" constant="15" id="CtQ-K5-9VV"/>
@@ -407,5 +408,8 @@
         <image name="Home_yun_icon" width="15" height="11"/>
         <image name="home_video_leftIcon" width="12" height="12"/>
         <image name="img_placeHolder" width="800" height="800"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
     </resources>
 </document>

+ 28 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/IndexAllCell.h

@@ -0,0 +1,28 @@
+//
+//  IndexAllCell.h
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/17.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "IndexAllModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface IndexAllCell : UITableViewCell
+@property (weak, nonatomic) IBOutlet UITableView *subTableV;
+@property (weak, nonatomic) IBOutlet UILabel *nameL;
+@property (weak, nonatomic) IBOutlet UILabel *countL;
+@property (weak, nonatomic) IBOutlet UIButton *moreBtn;
+@property (weak, nonatomic) IBOutlet UIButton *topBtn;
+@property (weak, nonatomic) IBOutlet UIView *bgView;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contant;
+
+@property (copy, nonatomic) void(^ClickRowBlock)(CollectModelType type, NSInteger Id);
++ (IndexAllCell *)configCell:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath;
+- (void)setDataWithModel:(IndexAllModel *)model searchText:(NSString *)text;
+@end
+
+NS_ASSUME_NONNULL_END

+ 187 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/IndexAllCell.m

@@ -0,0 +1,187 @@
+//
+//  IndexAllCell.m
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/17.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import "IndexAllCell.h"
+#import "HomeSubItemModel.h"
+#import "HomeWeiCousreCell.h"
+#import "BookSubArticeCell.h"
+#import "HomeTeacherCell.h"
+#import "HomeMusicCell.h"
+#import "HomeSchoolCell.h"
+#import "IndexGoodBookCell.h"
+
+
+@interface IndexAllCell ()<UITableViewDelegate,UITableViewDataSource>
+@property (nonatomic, strong) IndexAllModel * model;
+@property (nonatomic, copy) NSString        * searchText;
+@end
+@implementation IndexAllCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    self.subTableV.delegate = self;
+    self.subTableV.dataSource = self;
+    self.backgroundColor = [UIColor clearColor];
+    self.bgView.layer.cornerRadius = 8.f;
+    self.bgView.layer.masksToBounds = YES;
+}
++ (IndexAllCell *)configCell:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath
+{
+    static NSString *cellIdentifer = @"IndexAllCell";
+    IndexAllCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
+    if (cell == nil) {
+        cell = [[[NSBundle mainBundle] loadNibNamed:@"IndexAllCell" owner:nil options:nil] objectAtIndex:0];
+    }
+    return cell;
+}
+- (void)setDataWithModel:(IndexAllModel *)model searchText:(NSString *)text
+{
+    self.model = model;
+    self.searchText = text;
+    self.nameL.text = self.model.LableName;
+    self.countL.text = [NSString stringWithFormat:@"(%ld)",self.model.Total];
+    self.topBtn.selected = self.model.IsTop;
+    [self.topBtn setTitle:@" 置顶 " forState:UIControlStateNormal];
+    [self.topBtn setTitle:@" 取消置顶 " forState:UIControlStateSelected];
+    [self.topBtn setTitleColor:UIColorHex(0x3979D3) forState:UIControlStateNormal];
+    [self.topBtn setTitleColor:UIColorHex(0xBCBCBC) forState:UIControlStateSelected];
+    if (self.topBtn.selected) {
+        self.topBtn.layer.borderColor = UIColorHex(0xBCBCBC).CGColor;
+    }else{
+        self.topBtn.layer.borderColor = UIColorHex(0x3979D3).CGColor;
+    }
+    self.topBtn.layer.borderWidth = 1.f;
+    self.topBtn.layer.cornerRadius = 4.f;
+    self.topBtn.layer.masksToBounds = YES;
+    
+    self.subTableV.estimatedRowHeight = 80;
+    self.subTableV.rowHeight = UITableViewAutomaticDimension;
+    self.subTableV.showsVerticalScrollIndicator = NO;
+    self.subTableV.showsHorizontalScrollIndicator = NO;
+    [self.subTableV reloadData];
+    
+    HomeSubItemModel * smodel = self.model.Items.firstObject;
+    switch ((CollectModelType)smodel.MediaType) {
+        case CollectModel_StoreBook:
+        {
+            self.contant.constant = 120.f * self.model.Items.count;
+        }
+            break;
+        case CollectModel_StoreVideo:
+        {
+            self.contant.constant = 110.f * self.model.Items.count;
+        }
+            break;
+        case CollectModel_StoreSound:
+        {
+            self.contant.constant = 85.f * self.model.Items.count;
+        }
+            break;
+        case CollectModel_Teacher:
+        {
+            self.contant.constant = 130.f * self.model.Items.count;
+        }
+            break;
+        case CollectModel_Organization:
+        {
+            self.contant.constant = 130.f * self.model.Items.count;
+        }
+            break;
+        default:
+        {
+            self.contant.constant = 120.f * self.model.Items.count;
+        }
+            break;
+    }
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    return self.model.Items.count;
+}
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    HomeSubItemModel * smodel = self.model.Items[indexPath.item];
+    switch ((CollectModelType)smodel.MediaType) {
+        case CollectModel_StoreBook:
+        {
+            IndexGoodBookCell * cell = [IndexGoodBookCell configCell0:tableView indexPath:indexPath];
+            [cell setDataWithModel:smodel searchText:self.searchText];
+            if (self.model.Items.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_StoreVideo:
+        {
+            HomeWeiCousreCell * cell = [HomeWeiCousreCell configCell0:tableView indexPath:indexPath];
+            [cell setDataWithIndexModel:smodel searchText:self.searchText];
+            if (self.model.Items.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_StoreSound:
+        {
+            HomeMusicCell * cell = [HomeMusicCell configCell:tableView indexPath:indexPath];
+            [cell setDataWithModel:smodel searchText:self.searchText];
+            if (self.model.Items.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_Teacher:
+        {
+            HomeTeacherCell * cell = [HomeTeacherCell configCell:tableView indexPath:indexPath];
+            [cell setDataWithModel:smodel searchText:self.searchText];
+            if (self.model.Items.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        case CollectModel_Organization:
+        {
+            HomeSchoolCell * cell = [HomeSchoolCell configCell1:tableView indexPath:indexPath];
+            [cell setDataIndexModel:smodel searchText:self.searchText];
+            if (self.model.Items.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+        default:
+        {
+            IndexGoodBookCell * cell = [IndexGoodBookCell configCell1:tableView indexPath:indexPath];
+            [cell setDataWithModel:smodel searchText:self.searchText];
+            if (self.model.Items.count == indexPath.row + 1) {
+                cell.lineV.hidden = YES;
+            }
+            return cell;
+        }
+            break;
+    }
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    [tableView deselectRowAtIndexPath:indexPath animated:YES];
+    HomeSubItemModel * model = self.model.Items[indexPath.item];
+    if (self.ClickRowBlock) {
+        self.ClickRowBlock((CollectModelType)model.MediaType, model.Id);
+    }
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+}
+
+@end

+ 104 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/IndexAllCell.xib

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_1" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="232" id="KGk-i7-Jjw" customClass="IndexAllCell">
+            <rect key="frame" x="0.0" y="0.0" width="320" height="232"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
+                <rect key="frame" x="0.0" y="0.0" width="320" height="232"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OD9-XK-Pqi">
+                        <rect key="frame" x="0.0" y="0.0" width="320" height="232"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ilk-vi-R2l">
+                                <rect key="frame" x="15" y="15" width="39.5" height="116"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                                <color key="textColor" red="0.039215686274509803" green="0.039215686274509803" blue="0.039215686274509803" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sLR-9q-ehS">
+                                <rect key="frame" x="54.5" y="63.5" width="39.5" height="19.5"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                                <color key="textColor" red="0.22352941176470587" green="0.47450980392156861" blue="0.82745098039215681" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2KB-QT-zxt">
+                                <rect key="frame" x="274" y="58" width="31" height="30"/>
+                                <state key="normal" title="更多">
+                                    <color key="titleColor" red="0.22352941176470587" green="0.47450980392156861" blue="0.82745098039215681" alpha="1" colorSpace="calibratedRGB"/>
+                                </state>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PlR-IZ-cKa">
+                                <rect key="frame" x="281" y="203" width="30" height="18"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="18" id="503-HG-wsr"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                <color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <state key="normal" title="置顶">
+                                    <color key="titleColor" red="0.22352941179999999" green="0.47450980390000003" blue="0.82745098039999998" alpha="1" colorSpace="calibratedRGB"/>
+                                </state>
+                            </button>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Sxl-h8-okj">
+                                <rect key="frame" x="0.0" y="146" width="320" height="50"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="50" id="KWO-7e-g4x"/>
+                                </constraints>
+                            </tableView>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstItem="2KB-QT-zxt" firstAttribute="centerY" secondItem="Ilk-vi-R2l" secondAttribute="centerY" id="0wS-ZA-qOC"/>
+                            <constraint firstItem="Ilk-vi-R2l" firstAttribute="top" secondItem="OD9-XK-Pqi" secondAttribute="top" constant="15" id="3Zo-Gb-kDR"/>
+                            <constraint firstAttribute="trailing" secondItem="Sxl-h8-okj" secondAttribute="trailing" id="6Qm-nV-Wth"/>
+                            <constraint firstItem="Sxl-h8-okj" firstAttribute="top" secondItem="Ilk-vi-R2l" secondAttribute="bottom" constant="15" id="9Rz-Rs-Ipa"/>
+                            <constraint firstAttribute="bottom" secondItem="PlR-IZ-cKa" secondAttribute="bottom" constant="11" id="BSF-zg-iGD"/>
+                            <constraint firstItem="sLR-9q-ehS" firstAttribute="leading" secondItem="Ilk-vi-R2l" secondAttribute="trailing" id="G2u-5o-df1"/>
+                            <constraint firstAttribute="trailing" secondItem="PlR-IZ-cKa" secondAttribute="trailing" constant="9" id="LYE-o0-eXc"/>
+                            <constraint firstItem="Sxl-h8-okj" firstAttribute="leading" secondItem="OD9-XK-Pqi" secondAttribute="leading" id="bcX-O4-gDD"/>
+                            <constraint firstItem="PlR-IZ-cKa" firstAttribute="top" secondItem="Sxl-h8-okj" secondAttribute="bottom" constant="7" id="bgg-Rb-uc0"/>
+                            <constraint firstAttribute="trailing" secondItem="2KB-QT-zxt" secondAttribute="trailing" constant="15" id="sWf-0N-UDN"/>
+                            <constraint firstItem="Ilk-vi-R2l" firstAttribute="leading" secondItem="OD9-XK-Pqi" secondAttribute="leading" constant="15" id="tJp-cS-Xva"/>
+                            <constraint firstItem="sLR-9q-ehS" firstAttribute="centerY" secondItem="Ilk-vi-R2l" secondAttribute="centerY" id="xXp-nC-nvp"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstAttribute="trailing" secondItem="OD9-XK-Pqi" secondAttribute="trailing" id="0aa-Oe-DH5"/>
+                    <constraint firstItem="OD9-XK-Pqi" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="XpX-md-DuT"/>
+                    <constraint firstAttribute="bottom" secondItem="OD9-XK-Pqi" secondAttribute="bottom" id="iey-T8-wB3"/>
+                    <constraint firstItem="OD9-XK-Pqi" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="qzf-la-uwj"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
+            <connections>
+                <outlet property="bgView" destination="OD9-XK-Pqi" id="x1t-WP-FNc"/>
+                <outlet property="contant" destination="KWO-7e-g4x" id="yfM-WS-Gme"/>
+                <outlet property="countL" destination="sLR-9q-ehS" id="izc-TN-jK6"/>
+                <outlet property="moreBtn" destination="2KB-QT-zxt" id="QZy-Ev-7rs"/>
+                <outlet property="nameL" destination="Ilk-vi-R2l" id="kMP-sg-WkF"/>
+                <outlet property="subTableV" destination="Sxl-h8-okj" id="4Hf-cV-q9n"/>
+                <outlet property="topBtn" destination="PlR-IZ-cKa" id="kAI-Ip-r9U"/>
+            </connections>
+            <point key="canvasLocation" x="-807.24637681159425" y="107.8125"/>
+        </tableViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 27 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/IndexGoodBookCell.h

@@ -0,0 +1,27 @@
+//
+//  IndexGoodBookCell.h
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/18.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "HomeSubItemModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface IndexGoodBookCell : UITableViewCell
+@property (weak, nonatomic) IBOutlet UIImageView *imgV;
+@property (weak, nonatomic) IBOutlet UILabel *titleL;
+@property (weak, nonatomic) IBOutlet UILabel *nameL;
+@property (weak, nonatomic) IBOutlet UILabel *subtitleL;
+@property (weak, nonatomic) IBOutlet UIView *lineV;
+
++ (IndexGoodBookCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath;
++ (IndexGoodBookCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath;
+- (void)setDataWithModel:(HomeSubItemModel *)model searchText:(NSString *)text;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 53 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/IndexGoodBookCell.m

@@ -0,0 +1,53 @@
+//
+//  IndexGoodBookCell.m
+//  smartRhino
+//
+//  Created by niuzhen on 2020/9/18.
+//  Copyright © 2020 tederen. All rights reserved.
+//
+
+#import "IndexGoodBookCell.h"
+
+@implementation IndexGoodBookCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
++ (IndexGoodBookCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
+    static NSString *cellIdentifer = @"IndexGoodBookCell0";
+    IndexGoodBookCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
+    if (cell == nil) {
+        cell = [[[NSBundle mainBundle] loadNibNamed:@"IndexGoodBookCell" owner:nil options:nil] objectAtIndex:0];
+    }
+    return cell;
+}
++ (IndexGoodBookCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
+    static NSString *cellIdentifer = @"IndexGoodBookCell1";
+    IndexGoodBookCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
+    if (cell == nil) {
+        cell = [[[NSBundle mainBundle] loadNibNamed:@"IndexGoodBookCell" owner:nil options:nil] objectAtIndex:1];
+    }
+    return cell;
+}
+- (void)setDataWithModel:(HomeSubItemModel *)model searchText:(NSString *)text
+{
+    [self.imgV sd_setImageWithURL:[NSURL URLWithString:model.ImageUrls] placeholderImage:IMG(@"img_placeHolder")];
+    self.titleL.attributedText = [ZYCTool checkOfString:model.Title withSearchText:text withColor:UIColorHex(0xFF5252)];
+    CGFloat height = [self.titleL sizeThatFits:CGSizeMake(SCREEN_WIDTH - 143, MAXFLOAT)].height;
+    if (height > 30) {
+        self.subtitleL.numberOfLines = 1;
+    }else{
+        self.subtitleL.numberOfLines = 2;
+    }
+    self.nameL.text = model.Author;
+    self.subtitleL.text = model.Summary;
+}
+
+@end

+ 182 - 0
smartRhino/Project/VCModel/Home/VC/View/Cell/IndexGoodBookCell.xib

@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_1" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="IndexGoodBookCell0" rowHeight="175" id="KGk-i7-Jjw" customClass="IndexGoodBookCell">
+            <rect key="frame" x="0.0" y="0.0" width="320" height="120"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
+                <rect key="frame" x="0.0" y="0.0" width="320" height="120"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="oIl-J0-2MZ">
+                        <rect key="frame" x="23" y="15" width="68" height="90"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="68" id="j9p-2D-rvV"/>
+                            <constraint firstAttribute="height" constant="90" id="xfq-rZ-dxX"/>
+                        </constraints>
+                    </imageView>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1xU-dr-7fJ">
+                        <rect key="frame" x="0.0" y="119.5" width="320" height="0.5"/>
+                        <color key="backgroundColor" red="0.89803921568627454" green="0.89803921568627454" blue="0.89803921568627454" alpha="1" colorSpace="calibratedRGB"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="0.5" id="c3t-Bm-0iL"/>
+                        </constraints>
+                    </view>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="c50-k4-XQG">
+                        <rect key="frame" x="113" y="20" width="192" height="80"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eS3-vH-1iS">
+                                <rect key="frame" x="0.0" y="0.0" width="192" height="18"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                <color key="textColor" red="0.043137254901960784" green="0.043137254901960784" blue="0.043137254901960784" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XUf-sf-KJ3">
+                                <rect key="frame" x="0.0" y="32" width="192" height="17"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="w9g-8g-jKR">
+                                <rect key="frame" x="0.0" y="63" width="192" height="17"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                        </subviews>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstAttribute="trailing" secondItem="w9g-8g-jKR" secondAttribute="trailing" id="12u-bC-agB"/>
+                            <constraint firstAttribute="trailing" secondItem="eS3-vH-1iS" secondAttribute="trailing" id="2ZV-4P-wTl"/>
+                            <constraint firstItem="XUf-sf-KJ3" firstAttribute="top" secondItem="eS3-vH-1iS" secondAttribute="bottom" constant="14" id="6Sy-uC-r4D"/>
+                            <constraint firstAttribute="bottom" secondItem="w9g-8g-jKR" secondAttribute="bottom" id="PWO-Ge-KFF"/>
+                            <constraint firstItem="eS3-vH-1iS" firstAttribute="leading" secondItem="c50-k4-XQG" secondAttribute="leading" id="Wxr-Uc-c6J"/>
+                            <constraint firstItem="w9g-8g-jKR" firstAttribute="top" secondItem="XUf-sf-KJ3" secondAttribute="bottom" constant="14" id="aU5-2f-vN7"/>
+                            <constraint firstItem="w9g-8g-jKR" firstAttribute="leading" secondItem="eS3-vH-1iS" secondAttribute="leading" id="jZh-YO-TSr"/>
+                            <constraint firstItem="XUf-sf-KJ3" firstAttribute="leading" secondItem="eS3-vH-1iS" secondAttribute="leading" id="n7s-GV-xUV"/>
+                            <constraint firstItem="eS3-vH-1iS" firstAttribute="top" secondItem="c50-k4-XQG" secondAttribute="top" id="nDq-s5-3aZ"/>
+                            <constraint firstAttribute="trailing" secondItem="XUf-sf-KJ3" secondAttribute="trailing" id="yit-iR-v3b"/>
+                            <constraint firstAttribute="height" relation="lessThanOrEqual" constant="90" id="zzo-7R-Os6"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="oIl-J0-2MZ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="23" id="Lzj-hT-z0E"/>
+                    <constraint firstAttribute="trailing" secondItem="c50-k4-XQG" secondAttribute="trailing" constant="15" id="MaY-jo-GIi"/>
+                    <constraint firstItem="oIl-J0-2MZ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="T4m-ea-LF1"/>
+                    <constraint firstItem="1xU-dr-7fJ" firstAttribute="top" secondItem="oIl-J0-2MZ" secondAttribute="bottom" constant="14.5" id="Ufq-Y8-57A"/>
+                    <constraint firstItem="c50-k4-XQG" firstAttribute="leading" secondItem="oIl-J0-2MZ" secondAttribute="trailing" constant="22" id="aJr-YC-WX7"/>
+                    <constraint firstItem="c50-k4-XQG" firstAttribute="centerY" secondItem="oIl-J0-2MZ" secondAttribute="centerY" id="aYa-3S-n6s"/>
+                    <constraint firstItem="1xU-dr-7fJ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="eLi-tk-2NB"/>
+                    <constraint firstAttribute="trailing" secondItem="1xU-dr-7fJ" secondAttribute="trailing" id="gw9-Te-xVZ"/>
+                    <constraint firstAttribute="bottom" secondItem="1xU-dr-7fJ" secondAttribute="bottom" id="ksn-Ge-lMh"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
+            <connections>
+                <outlet property="imgV" destination="oIl-J0-2MZ" id="Aqc-zq-Qsh"/>
+                <outlet property="lineV" destination="1xU-dr-7fJ" id="Oqs-1F-sS7"/>
+                <outlet property="nameL" destination="XUf-sf-KJ3" id="qtl-EB-OJD"/>
+                <outlet property="subtitleL" destination="w9g-8g-jKR" id="GDp-R9-urW"/>
+                <outlet property="titleL" destination="eS3-vH-1iS" id="EGa-DN-WbE"/>
+            </connections>
+            <point key="canvasLocation" x="138" y="40"/>
+        </tableViewCell>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="IndexGoodBookCell1" rowHeight="175" id="jcU-0n-Ew2" customClass="IndexGoodBookCell">
+            <rect key="frame" x="0.0" y="0.0" width="320" height="120"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="jcU-0n-Ew2" id="f8i-kb-TLA">
+                <rect key="frame" x="0.0" y="0.0" width="320" height="120"/>
+                <autoresizingMask key="autoresizingMask"/>
+                <subviews>
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="yeq-u5-OI9">
+                        <rect key="frame" x="15" y="20" width="80" height="80"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="80" id="32s-km-FXE"/>
+                            <constraint firstAttribute="width" constant="80" id="sdj-0q-qpT"/>
+                        </constraints>
+                    </imageView>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hBh-Ki-uut">
+                        <rect key="frame" x="0.0" y="119.5" width="320" height="0.5"/>
+                        <color key="backgroundColor" red="0.8980392157" green="0.8980392157" blue="0.8980392157" alpha="1" colorSpace="calibratedRGB"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="0.5" id="Icv-d3-zk6"/>
+                        </constraints>
+                    </view>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hYT-ts-h4t">
+                        <rect key="frame" x="110" y="20" width="195" height="80"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AcU-2T-bLG">
+                                <rect key="frame" x="0.0" y="0.0" width="195" height="18"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                <color key="textColor" red="0.043137254899999998" green="0.043137254899999998" blue="0.043137254899999998" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1vU-Ro-BLW">
+                                <rect key="frame" x="0.0" y="32" width="195" height="17"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Y7h-mW-kkg">
+                                <rect key="frame" x="0.0" y="63" width="195" height="17"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                        </subviews>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstAttribute="height" relation="lessThanOrEqual" constant="90" id="9Je-rh-nWG"/>
+                            <constraint firstAttribute="trailing" secondItem="Y7h-mW-kkg" secondAttribute="trailing" id="J77-hS-ers"/>
+                            <constraint firstItem="1vU-Ro-BLW" firstAttribute="leading" secondItem="Y7h-mW-kkg" secondAttribute="leading" id="fFm-lb-qYL"/>
+                            <constraint firstItem="AcU-2T-bLG" firstAttribute="top" secondItem="hYT-ts-h4t" secondAttribute="top" id="fqn-4y-boW"/>
+                            <constraint firstItem="Y7h-mW-kkg" firstAttribute="top" secondItem="1vU-Ro-BLW" secondAttribute="bottom" constant="14" id="hgd-D4-h7u"/>
+                            <constraint firstItem="Y7h-mW-kkg" firstAttribute="leading" secondItem="AcU-2T-bLG" secondAttribute="leading" id="noF-k8-Jd9"/>
+                            <constraint firstAttribute="bottom" secondItem="Y7h-mW-kkg" secondAttribute="bottom" id="uLl-N3-97M"/>
+                            <constraint firstItem="AcU-2T-bLG" firstAttribute="leading" secondItem="hYT-ts-h4t" secondAttribute="leading" id="w6N-PO-cWg"/>
+                            <constraint firstAttribute="trailing" secondItem="1vU-Ro-BLW" secondAttribute="trailing" id="xaz-7N-gkJ"/>
+                            <constraint firstAttribute="trailing" secondItem="AcU-2T-bLG" secondAttribute="trailing" id="xtx-9l-jwf"/>
+                            <constraint firstItem="1vU-Ro-BLW" firstAttribute="top" secondItem="AcU-2T-bLG" secondAttribute="bottom" constant="14" id="yoZ-d2-7TK"/>
+                        </constraints>
+                    </view>
+                </subviews>
+                <constraints>
+                    <constraint firstItem="yeq-u5-OI9" firstAttribute="top" secondItem="f8i-kb-TLA" secondAttribute="top" constant="20" id="6Xd-As-9PA"/>
+                    <constraint firstAttribute="trailing" secondItem="hBh-Ki-uut" secondAttribute="trailing" id="AM9-oP-dAu"/>
+                    <constraint firstItem="hYT-ts-h4t" firstAttribute="leading" secondItem="yeq-u5-OI9" secondAttribute="trailing" constant="15" id="GqK-5E-LTq"/>
+                    <constraint firstItem="hYT-ts-h4t" firstAttribute="centerY" secondItem="yeq-u5-OI9" secondAttribute="centerY" id="TAr-0W-Nj0"/>
+                    <constraint firstAttribute="trailing" secondItem="hYT-ts-h4t" secondAttribute="trailing" constant="15" id="bJW-IH-u8q"/>
+                    <constraint firstAttribute="bottom" secondItem="hBh-Ki-uut" secondAttribute="bottom" id="kVd-en-1SO"/>
+                    <constraint firstItem="yeq-u5-OI9" firstAttribute="leading" secondItem="f8i-kb-TLA" secondAttribute="leading" constant="15" id="nc1-TZ-hjQ"/>
+                    <constraint firstItem="hBh-Ki-uut" firstAttribute="leading" secondItem="f8i-kb-TLA" secondAttribute="leading" id="tf2-kI-Kc6"/>
+                    <constraint firstItem="hBh-Ki-uut" firstAttribute="top" secondItem="yeq-u5-OI9" secondAttribute="bottom" constant="19.5" id="zE7-Wf-cI7"/>
+                </constraints>
+            </tableViewCellContentView>
+            <viewLayoutGuide key="safeArea" id="gUa-4t-m84"/>
+            <connections>
+                <outlet property="imgV" destination="yeq-u5-OI9" id="PAq-ao-IFV"/>
+                <outlet property="lineV" destination="hBh-Ki-uut" id="8xa-kn-Zue"/>
+                <outlet property="nameL" destination="Y7h-mW-kkg" id="aMT-Qr-IxO"/>
+                <outlet property="subtitleL" destination="1vU-Ro-BLW" id="oD7-ug-Ek5"/>
+                <outlet property="titleL" destination="AcU-2T-bLG" id="hdR-8G-qf7"/>
+            </connections>
+            <point key="canvasLocation" x="138" y="181"/>
+        </tableViewCell>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 55 - 0
smartRhino/Project/VCModel/Home/VC/View/SegmentViewController.h

@@ -0,0 +1,55 @@
+//
+//  SegmentViewController.h
+//  CLSegment
+//
+//  Created by CL on 2018/4/9.
+//  Copyright © 2018年 cl. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef NS_ENUM(NSInteger, SegmentHeaderType) {
+    SegmentHeaderTypeScroll, //标签栏可滚动
+    SegmentHeaderTypeFixed   //标签栏固定
+};
+
+typedef NS_ENUM(NSInteger, SegmentControlStyle) {
+    SegmentControlTypeScroll, //内容部分可滚动
+    SegmentControlTypeFixed   //内容部分固定
+};
+
+@interface SegmentViewController : UIViewController
+//标签栏标题数组
+@property (nonatomic, strong) NSArray *titleArray;
+//每个标签对应ViewController数组
+@property (nonatomic, strong) NSArray *subViewControllers;
+//标签栏背景色
+@property (nonatomic, strong) UIColor *headViewBackgroundColor;
+//非选中状态下标签字体颜色
+@property (nonatomic, strong) UIColor *titleColor;
+//选中标签字体颜色
+@property (nonatomic, strong) UIColor *titleSelectedColor;
+//标签字体大小
+@property (nonatomic, assign) CGFloat fontSize;
+//标签栏每个按钮高度
+@property (nonatomic, assign) CGFloat buttonHeight;
+//标签栏每个按钮宽度
+@property (nonatomic, assign) CGFloat buttonWidth;
+//选中标签下划线高度
+@property (nonatomic, assign) CGFloat bottomLineHeight;
+//选中标签按钮数量
+@property (nonatomic, assign) CGFloat bottomCount;
+//选中标签底部划线颜色
+@property (nonatomic, strong) UIColor *bottomLineColor;
+//标签栏类型,默认为滚动
+@property (nonatomic, assign) SegmentHeaderType segmentHeaderType;
+//内容类型,默认为滚动
+//@property (nonatomic, assign) SegmentControlStyle segmentControlType;
+@property (nonatomic, assign) NSInteger     selectIndex;
+//初始化方法
+- (void)initSegment:(CGFloat)height;
+//点击标签栏按钮调用方法
+- (void)didSelectSegmentIndex:(NSInteger)index;
+- (void)addParentController:(UIViewController *)viewController;
+
+@end

+ 231 - 0
smartRhino/Project/VCModel/Home/VC/View/SegmentViewController.m

@@ -0,0 +1,231 @@
+//
+//  SegmentViewController.m
+//  CLSegment
+//
+//  Created by CL on 2018/4/9.
+//  Copyright © 2018年 cl. All rights reserved.
+//
+
+#import "SegmentViewController.h"
+
+#define HEADBTN_TAG              10000
+
+@interface SegmentViewController ()
+
+@property (nonatomic, strong) UIScrollView  *headerView;
+@property (nonatomic, strong) UIScrollView  *mainScrollView;
+
+@end
+
+@implementation SegmentViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+}
+
+- (void)initSegment:(CGFloat)height
+{
+    [self addButtonInScrollHeader:_titleArray height:height];
+    [self addContentViewScrollView:_subViewControllers height:height];
+}
+
+/*!
+ *  @brief  根据传入的title数组新建button显示在顶部scrollView上
+ *
+ *  @param titleArray  title数组
+ */
+- (void)addButtonInScrollHeader:(NSArray *)titleArray height:(CGFloat)height
+{
+    self.headerView.frame = CGRectMake(0, height, SCREEN_WIDTH, self.buttonHeight);
+    if (_segmentHeaderType == 0) {
+        self.headerView.contentSize = CGSizeMake(self.buttonWidth * titleArray.count, self.buttonHeight);
+    }
+    else {
+        self.headerView.contentSize = CGSizeMake(SCREEN_WIDTH, self.buttonHeight);
+    }
+    [self.view addSubview:self.headerView];
+    
+    for (NSInteger index = 0; index < titleArray.count; index++) {
+        UIButton *segmentBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        segmentBtn.frame = CGRectMake(self.buttonWidth * index, 0, self.buttonWidth, self.buttonHeight);
+        [segmentBtn setTitle:titleArray[index] forState:UIControlStateNormal];
+        segmentBtn.titleLabel.font = [UIFont systemFontOfSize:self.fontSize];
+        segmentBtn.tag = index + HEADBTN_TAG;
+        [segmentBtn setTitleColor:self.titleColor forState:UIControlStateNormal];
+        [segmentBtn setTitleColor:self.titleSelectedColor forState:UIControlStateSelected];
+        [segmentBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
+        [self.headerView addSubview:segmentBtn];
+        if (index == 0) {
+            segmentBtn.selected = YES;
+            self.selectIndex = segmentBtn.tag;
+        }
+    }
+}
+
+/*!
+ *  @brief  根据传入的viewController数组,将viewController的view添加到显示内容的scrollView
+ *
+ *  @param subViewControllers  viewController数组
+ */
+- (void)addContentViewScrollView:(NSArray *)subViewControllers height:(CGFloat)height
+{
+    _mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, self.buttonHeight + height , SCREEN_WIDTH, SCREEN_HEIGHT - height - self.buttonHeight)];
+    _mainScrollView.contentSize = CGSizeMake(SCREEN_WIDTH * subViewControllers.count, SCREEN_HEIGHT - height - self.buttonHeight);
+    [_mainScrollView setScrollEnabled:NO];
+    
+    [_mainScrollView setShowsVerticalScrollIndicator:NO];
+    [_mainScrollView setShowsHorizontalScrollIndicator:NO];
+    _mainScrollView.bounces = NO;
+    
+    [self.view addSubview:_mainScrollView];
+    
+    [subViewControllers enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop){
+        
+        UIViewController *viewController = (UIViewController *)_subViewControllers[idx];
+        viewController.view.frame = CGRectMake(idx * SCREEN_WIDTH, 0, SCREEN_WIDTH, _mainScrollView.frame.size.height);
+        
+        [_mainScrollView addSubview:viewController.view];
+        [self addChildViewController:viewController];
+    }];
+}
+
+- (void)addParentController:(UIViewController *)viewController
+{
+    if ([viewController respondsToSelector:@selector(edgesForExtendedLayout)])
+    {
+        viewController.edgesForExtendedLayout = UIRectEdgeNone;
+    }
+    [viewController addChildViewController:self];
+    [viewController.view addSubview:self.view];
+}
+
+#pragma mark 点击按钮方法
+
+- (void)btnClick:(UIButton *)button
+{
+    [_mainScrollView scrollRectToVisible:CGRectMake((button.tag - HEADBTN_TAG) *SCREEN_WIDTH, 0, SCREEN_WIDTH, _mainScrollView.frame.size.height) animated:NO];
+    [self didSelectSegmentIndex:button.tag];
+}
+
+/*!
+ *  @brief  设置顶部选中button下方线条位置
+ *
+ *  @param index 第几个
+ */
+- (void)didSelectSegmentIndex:(NSInteger)index
+{
+    UIButton *btn = (UIButton *)[self.view viewWithTag:self.selectIndex];
+    btn.selected = NO;
+    self.selectIndex = index;
+    UIButton *currentSelectBtn = (UIButton *)[self.view viewWithTag:index];
+    currentSelectBtn.selected = YES;
+}
+
+#pragma mark - ScrollViewDelegate
+
+//- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
+//{
+//    if (scrollView.contentOffset.x<=960) {
+//        if (scrollView == _mainScrollView) {
+//            float xx = scrollView.contentOffset.x * (_buttonWidth / SCREEN_WIDTH) - _buttonWidth;
+//            [_headerView scrollRectToVisible:CGRectMake(xx, 0, SCREEN_WIDTH, _headerView.frame.size.height) animated:YES];
+//            NSInteger currentIndex = scrollView.contentOffset.x / SCREEN_WIDTH;
+//            [self didSelectSegmentIndex:currentIndex + HEADBTN_TAG];
+//        }
+//    }else{
+//        [scrollView setScrollEnabled:NO];
+//    }
+//}
+//
+//- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView;
+//{
+//    float xx = scrollView.contentOffset.x * (_buttonWidth / SCREEN_WIDTH) - _buttonWidth;
+//    [_headerView scrollRectToVisible:CGRectMake(xx, 0, SCREEN_WIDTH, _headerView.frame.size.height) animated:YES];
+//}
+
+#pragma mark - setter/getter
+- (UIScrollView *)headerView
+{
+    if (_headerView == nil) {
+        _headerView = [[UIScrollView alloc] init];
+        [_headerView setShowsVerticalScrollIndicator:NO];
+        [_headerView setShowsHorizontalScrollIndicator:NO];
+        _headerView.bounces = NO;
+        _headerView.backgroundColor = self.headViewBackgroundColor;
+    }
+    return _headerView;
+}
+
+- (UIColor *)headViewBackgroundColor
+{
+    if (_headViewBackgroundColor == nil) {
+        _headViewBackgroundColor = UIColorHex(0xFFFFFF);
+    }
+    return _headViewBackgroundColor;
+}
+
+- (UIColor *)titleColor
+{
+    if (_titleColor == nil) {
+        _titleColor = UIColorHex(0x0A0A0A);
+    }
+    return _titleColor;
+}
+
+- (UIColor *)titleSelectedColor
+{
+    if (_titleSelectedColor == nil) {
+        _titleSelectedColor = UIColorHex(0x3979D3);
+    }
+    return _titleSelectedColor;
+}
+
+- (CGFloat)fontSize
+{
+    if (_fontSize == 0) {
+        _fontSize = 15.f;
+    }
+    return _fontSize;
+}
+
+- (CGFloat)buttonWidth
+{
+    if (_buttonWidth == 0) {
+        _buttonWidth = SCREEN_WIDTH / 4;
+    }
+    return _buttonWidth;
+}
+
+- (CGFloat)buttonHeight
+{
+    if (_buttonHeight == 0) {
+        _buttonHeight = 50.f;
+    }
+    return _buttonHeight;
+}
+
+- (CGFloat)bottomLineHeight
+{
+    if (_bottomLineHeight == 0) {
+        _bottomLineHeight = 1.f;
+    }
+    return _bottomLineHeight;
+}
+
+- (CGFloat)bottomCount
+{
+    if (_bottomCount == 0) {
+        _bottomCount = 1;
+    }
+    return _bottomCount;
+}
+
+- (UIColor *)bottomLineColor
+{
+    if (_bottomLineColor == nil) {
+        _bottomLineColor = [UIColor whiteColor];
+    }
+    return _bottomLineColor;
+}
+
+@end

+ 203 - 0
smartRhino/Project/VCModel/Home/home.storyboard

@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ap2-Fm-VRO">
+    <device id="retina5_5" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment version="4352" identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Navigation Controller-->
+        <scene sceneID="NtJ-7v-DCv">
+            <objects>
+                <navigationController navigationBarHidden="YES" id="ap2-Fm-VRO" sceneMemberID="viewController">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="5N9-fH-udg">
+                        <autoresizingMask key="autoresizingMask"/>
+                    </navigationBar>
+                    <connections>
+                        <segue destination="SHO-cN-RrV" kind="relationship" relationship="rootViewController" id="mLN-lO-ZNx"/>
+                    </connections>
+                </navigationController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="BPU-ZW-m87" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-968" y="96"/>
+        </scene>
+        <!--Index MoreVC-->
+        <scene sceneID="BFe-KM-Ft4">
+            <objects>
+                <viewController storyboardIdentifier="IndexMoreVC" id="SHO-cN-RrV" customClass="IndexMoreVC" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="DUl-bS-JUQ">
+                        <rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hCB-eT-rx4" customClass="WQNavigationBar">
+                                <rect key="frame" x="0.0" y="0.0" width="414" height="64"/>
+                                <subviews>
+                                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Y4w-6s-IN0" customClass="WQNavigationBar">
+                                        <rect key="frame" x="0.0" y="0.0" width="414" height="64"/>
+                                        <subviews>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vUj-TN-FzZ">
+                                                <rect key="frame" x="0.0" y="20" width="414" height="44"/>
+                                                <subviews>
+                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lpy-eQ-A52">
+                                                        <rect key="frame" x="0.0" y="0.0" width="50" height="44"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="50" id="1jY-Tk-A3Z"/>
+                                                            <constraint firstAttribute="height" constant="44" id="zaq-rS-HgZ"/>
+                                                        </constraints>
+                                                        <state key="normal" image="back_black_icon"/>
+                                                        <connections>
+                                                            <action selector="backAction:" destination="SHO-cN-RrV" eventType="touchUpInside" id="oVS-ry-6yF"/>
+                                                        </connections>
+                                                    </button>
+                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QVX-kq-bV5">
+                                                        <rect key="frame" x="50" y="0.0" width="35" height="44"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="35" id="A5h-yi-h1A"/>
+                                                            <constraint firstAttribute="height" constant="44" id="R3l-Lo-8Vr"/>
+                                                        </constraints>
+                                                        <state key="normal" image="menu_black_icon"/>
+                                                        <connections>
+                                                            <action selector="menuAction:" destination="SHO-cN-RrV" eventType="touchUpInside" id="6X5-tG-4NF"/>
+                                                        </connections>
+                                                    </button>
+                                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aW8-Mw-1lx">
+                                                        <rect key="frame" x="207" y="22" width="0.0" height="0.0"/>
+                                                        <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                                                        <color key="textColor" red="0.039215686270000001" green="0.039215686270000001" blue="0.039215686270000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                        <nil key="highlightedColor"/>
+                                                    </label>
+                                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vhv-Im-Jy4">
+                                                        <rect key="frame" x="370" y="0.0" width="44" height="44"/>
+                                                        <constraints>
+                                                            <constraint firstAttribute="width" constant="44" id="38y-bh-ZZm"/>
+                                                            <constraint firstAttribute="height" constant="44" id="Yxq-ro-897"/>
+                                                        </constraints>
+                                                        <state key="normal" image="icon_share"/>
+                                                    </button>
+                                                </subviews>
+                                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                <constraints>
+                                                    <constraint firstItem="QVX-kq-bV5" firstAttribute="bottom" secondItem="lpy-eQ-A52" secondAttribute="bottom" id="M4I-9j-l5M"/>
+                                                    <constraint firstItem="aW8-Mw-1lx" firstAttribute="centerY" secondItem="lpy-eQ-A52" secondAttribute="centerY" id="NGC-p3-mLM"/>
+                                                    <constraint firstItem="vhv-Im-Jy4" firstAttribute="centerY" secondItem="vUj-TN-FzZ" secondAttribute="centerY" id="RSl-Hh-6sg"/>
+                                                    <constraint firstItem="QVX-kq-bV5" firstAttribute="top" secondItem="lpy-eQ-A52" secondAttribute="top" id="bUG-A4-qbj"/>
+                                                    <constraint firstAttribute="bottom" secondItem="lpy-eQ-A52" secondAttribute="bottom" id="isZ-tS-oX6"/>
+                                                    <constraint firstAttribute="height" constant="44" id="ked-zE-jXQ"/>
+                                                    <constraint firstItem="aW8-Mw-1lx" firstAttribute="centerX" secondItem="vUj-TN-FzZ" secondAttribute="centerX" id="qwq-9o-jJh"/>
+                                                    <constraint firstItem="QVX-kq-bV5" firstAttribute="leading" secondItem="lpy-eQ-A52" secondAttribute="trailing" id="rxp-eT-PA2"/>
+                                                    <constraint firstAttribute="trailing" secondItem="vhv-Im-Jy4" secondAttribute="trailing" id="ssA-FG-akv"/>
+                                                    <constraint firstItem="lpy-eQ-A52" firstAttribute="leading" secondItem="vUj-TN-FzZ" secondAttribute="leading" id="vXm-a9-VPl"/>
+                                                </constraints>
+                                            </view>
+                                        </subviews>
+                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                        <constraints>
+                                            <constraint firstItem="vUj-TN-FzZ" firstAttribute="trailing" secondItem="Y4w-6s-IN0" secondAttribute="trailing" id="02f-73-5FS"/>
+                                            <constraint firstAttribute="bottom" secondItem="vUj-TN-FzZ" secondAttribute="bottom" id="4tk-sc-E2R"/>
+                                            <constraint firstAttribute="height" constant="64" id="6xe-jb-vD4"/>
+                                            <constraint firstItem="vUj-TN-FzZ" firstAttribute="leading" secondItem="Y4w-6s-IN0" secondAttribute="leading" id="ygy-ks-wil"/>
+                                        </constraints>
+                                        <connections>
+                                            <outlet property="height" destination="6xe-jb-vD4" id="KJ1-fy-vcA"/>
+                                        </connections>
+                                    </view>
+                                </subviews>
+                                <viewLayoutGuide key="safeArea" id="N9b-tS-8Mg"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <constraints>
+                                    <constraint firstItem="Y4w-6s-IN0" firstAttribute="leading" secondItem="N9b-tS-8Mg" secondAttribute="leading" id="02H-RC-LPM"/>
+                                    <constraint firstAttribute="height" constant="64" id="4EF-wU-gZO"/>
+                                    <constraint firstItem="Y4w-6s-IN0" firstAttribute="bottom" secondItem="N9b-tS-8Mg" secondAttribute="bottom" id="bqD-hw-EvF"/>
+                                    <constraint firstItem="Y4w-6s-IN0" firstAttribute="trailing" secondItem="N9b-tS-8Mg" secondAttribute="trailing" id="fUn-4B-K7W"/>
+                                </constraints>
+                                <connections>
+                                    <outlet property="height" destination="4EF-wU-gZO" id="qe0-R5-HtA"/>
+                                </connections>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VJs-Ew-MX3">
+                                <rect key="frame" x="0.0" y="64" width="414" height="58"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="58" id="tcX-XS-3pF"/>
+                                </constraints>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ynm-hy-TaP">
+                                <rect key="frame" x="0.0" y="122" width="414" height="35"/>
+                                <subviews>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="为你找到相关结果为0个" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dQe-fi-B08">
+                                        <rect key="frame" x="15" y="9" width="151.66666666666666" height="17"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                        <color key="textColor" red="0.60392156862745094" green="0.60392156862745094" blue="0.60392156862745094" alpha="1" colorSpace="calibratedRGB"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lEc-do-xGr">
+                                        <rect key="frame" x="369" y="3" width="30" height="29"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                        <state key="normal" title="筛选">
+                                            <color key="titleColor" red="0.22745098039215686" green="0.47843137254901957" blue="0.83137254901960778" alpha="1" colorSpace="calibratedRGB"/>
+                                        </state>
+                                    </button>
+                                </subviews>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstItem="dQe-fi-B08" firstAttribute="leading" secondItem="Ynm-hy-TaP" secondAttribute="leading" constant="15" id="0Bx-dL-DOU"/>
+                                    <constraint firstAttribute="trailing" secondItem="lEc-do-xGr" secondAttribute="trailing" constant="15" id="6Ek-5G-N46"/>
+                                    <constraint firstItem="dQe-fi-B08" firstAttribute="centerY" secondItem="Ynm-hy-TaP" secondAttribute="centerY" id="6F5-EN-3vX"/>
+                                    <constraint firstItem="lEc-do-xGr" firstAttribute="centerY" secondItem="Ynm-hy-TaP" secondAttribute="centerY" id="nVp-IH-EVF"/>
+                                    <constraint firstAttribute="height" constant="35" id="piS-lq-x5c"/>
+                                </constraints>
+                            </view>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="21c-Oq-9yZ">
+                                <rect key="frame" x="15" y="172" width="384" height="549"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                <connections>
+                                    <outlet property="dataSource" destination="SHO-cN-RrV" id="yWm-GY-3mZ"/>
+                                    <outlet property="delegate" destination="SHO-cN-RrV" id="e33-Qi-YrG"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <viewLayoutGuide key="safeArea" id="7c1-e0-9St"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstItem="21c-Oq-9yZ" firstAttribute="trailing" secondItem="7c1-e0-9St" secondAttribute="trailing" constant="-15" id="15G-2Y-pBc"/>
+                            <constraint firstItem="Ynm-hy-TaP" firstAttribute="leading" secondItem="7c1-e0-9St" secondAttribute="leading" id="2hr-7b-3hv"/>
+                            <constraint firstItem="21c-Oq-9yZ" firstAttribute="leading" secondItem="7c1-e0-9St" secondAttribute="leading" constant="15" id="Cz2-IN-Jz9"/>
+                            <constraint firstItem="21c-Oq-9yZ" firstAttribute="top" secondItem="Ynm-hy-TaP" secondAttribute="bottom" constant="15" id="Uxj-XV-hjI"/>
+                            <constraint firstItem="hCB-eT-rx4" firstAttribute="trailing" secondItem="7c1-e0-9St" secondAttribute="trailing" id="aeX-EI-pWy"/>
+                            <constraint firstItem="Ynm-hy-TaP" firstAttribute="trailing" secondItem="7c1-e0-9St" secondAttribute="trailing" id="bb3-sF-4gT"/>
+                            <constraint firstItem="VJs-Ew-MX3" firstAttribute="top" secondItem="hCB-eT-rx4" secondAttribute="bottom" id="bn0-Gn-4dC"/>
+                            <constraint firstItem="hCB-eT-rx4" firstAttribute="top" secondItem="DUl-bS-JUQ" secondAttribute="top" id="dLA-cp-dy0"/>
+                            <constraint firstItem="VJs-Ew-MX3" firstAttribute="leading" secondItem="7c1-e0-9St" secondAttribute="leading" id="iba-2d-8R8"/>
+                            <constraint firstItem="7c1-e0-9St" firstAttribute="bottom" secondItem="21c-Oq-9yZ" secondAttribute="bottom" constant="15" id="lcZ-ht-cLv"/>
+                            <constraint firstItem="hCB-eT-rx4" firstAttribute="leading" secondItem="7c1-e0-9St" secondAttribute="leading" id="rMd-z6-kZq"/>
+                            <constraint firstItem="7c1-e0-9St" firstAttribute="trailing" secondItem="VJs-Ew-MX3" secondAttribute="trailing" id="rZv-Kh-7wM"/>
+                            <constraint firstItem="Ynm-hy-TaP" firstAttribute="top" secondItem="VJs-Ew-MX3" secondAttribute="bottom" id="rva-Bc-5Yr"/>
+                        </constraints>
+                    </view>
+                    <navigationItem key="navigationItem" id="NKA-Hb-T1U"/>
+                    <connections>
+                        <outlet property="cateBtn" destination="lEc-do-xGr" id="Ggt-fx-pMJ"/>
+                        <outlet property="countL" destination="dQe-fi-B08" id="FrO-qG-CSU"/>
+                        <outlet property="searchView" destination="VJs-Ew-MX3" id="e25-ji-A6f"/>
+                        <outlet property="shareBtn" destination="vhv-Im-Jy4" id="bXZ-yv-VRL"/>
+                        <outlet property="tableView" destination="21c-Oq-9yZ" id="t5Z-48-iZj"/>
+                        <outlet property="titleL" destination="aW8-Mw-1lx" id="fjW-sK-VlD"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="QVI-Va-6oy" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-252.17391304347828" y="95.380434782608702"/>
+        </scene>
+    </scenes>
+    <resources>
+        <image name="back_black_icon" width="11" height="20"/>
+        <image name="icon_share" width="19" height="17"/>
+        <image name="menu_black_icon" width="16.666666030883789" height="14.666666984558105"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 18 - 18
smartRhino/Project/VCModel/common/View/CommonListCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -20,15 +20,15 @@
             <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
             <point key="canvasLocation" x="139" y="153"/>
         </tableViewCell>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonListCell1" rowHeight="387" id="mKl-Yw-yJJ" customClass="CommonListCell">
-            <rect key="frame" x="0.0" y="0.0" width="338" height="88"/>
+        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonListCell1" rowHeight="402" id="mKl-Yw-yJJ" customClass="CommonListCell">
+            <rect key="frame" x="0.0" y="0.0" width="338" height="103"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="mKl-Yw-yJJ" id="8Mf-6v-eUM">
-                <rect key="frame" x="0.0" y="0.0" width="338" height="88"/>
+                <rect key="frame" x="0.0" y="0.0" width="338" height="103"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="文件夹类型" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7id-tv-Nnd">
-                        <rect key="frame" x="70" y="8" width="90.5" height="40"/>
+                        <rect key="frame" x="70" y="8" width="90.5" height="48"/>
                         <constraints>
                             <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="Gea-xa-rYg"/>
                         </constraints>
@@ -37,7 +37,7 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_placeHolder" translatesAutoresizingMaskIntoConstraints="NO" id="cCf-ee-0J6">
-                        <rect key="frame" x="15" y="18" width="40" height="40"/>
+                        <rect key="frame" x="15" y="22" width="40" height="40"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="40" id="RiD-jb-W1S"/>
                             <constraint firstAttribute="height" constant="40" id="nyC-oA-kE5"/>
@@ -50,7 +50,7 @@
                         </userDefinedRuntimeAttributes>
                     </imageView>
                     <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="文 章" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QgS-Mw-Nc4">
-                        <rect key="frame" x="15" y="46" width="40" height="12"/>
+                        <rect key="frame" x="15" y="50" width="40" height="12"/>
                         <color key="backgroundColor" red="0.29411764705882354" green="0.67450980392156867" blue="0.77647058823529413" alpha="1" colorSpace="calibratedRGB"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="12" id="LN8-pi-p7z"/>
@@ -60,23 +60,23 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3d7-xH-uiA">
-                        <rect key="frame" x="0.0" y="87.5" width="338" height="0.5"/>
+                        <rect key="frame" x="0.0" y="102.5" width="338" height="0.5"/>
                         <color key="backgroundColor" red="0.93333333330000001" green="0.93333333330000001" blue="0.93333333330000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="0.5" id="RZC-vB-DvE"/>
                         </constraints>
                     </view>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="84L-UB-7zZ">
-                        <rect key="frame" x="70" y="61.5" width="0.0" height="0.0"/>
+                        <rect key="frame" x="70" y="69.5" width="0.0" height="0.0"/>
                         <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="置顶" translatesAutoresizingMaskIntoConstraints="NO" id="QxE-nS-rLu">
-                        <rect key="frame" x="170.5" y="20" width="30" height="16"/>
+                        <rect key="frame" x="170.5" y="24" width="30" height="16"/>
                     </imageView>
-                    <button opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Fd-9i-Mm0">
-                        <rect key="frame" x="15" y="68" width="30" height="12"/>
+                    <button opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Fd-9i-Mm0">
+                        <rect key="frame" x="15" y="83" width="30" height="12"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="12" id="dYy-1f-dUU"/>
                         </constraints>
@@ -85,8 +85,8 @@
                             <color key="titleColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
                         </state>
                     </button>
-                    <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hv5-8I-1dA">
-                        <rect key="frame" x="80" y="54" width="38" height="15"/>
+                    <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hv5-8I-1dA">
+                        <rect key="frame" x="80" y="62" width="38" height="15"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="15" id="wWw-hv-UIU"/>
                         </constraints>
@@ -102,7 +102,7 @@
                     <constraint firstItem="QxE-nS-rLu" firstAttribute="leading" secondItem="7id-tv-Nnd" secondAttribute="trailing" constant="10" id="LDS-P6-o7G"/>
                     <constraint firstItem="QgS-Mw-Nc4" firstAttribute="trailing" secondItem="cCf-ee-0J6" secondAttribute="trailing" id="OUq-VP-o2f"/>
                     <constraint firstItem="hv5-8I-1dA" firstAttribute="top" secondItem="7id-tv-Nnd" secondAttribute="bottom" constant="6" id="WeL-ZT-SjY"/>
-                    <constraint firstItem="3Fd-9i-Mm0" firstAttribute="top" secondItem="cCf-ee-0J6" secondAttribute="bottom" constant="10" id="Wvh-yD-7dj"/>
+                    <constraint firstItem="3Fd-9i-Mm0" firstAttribute="top" secondItem="hv5-8I-1dA" secondAttribute="bottom" constant="6" id="Wvh-yD-7dj"/>
                     <constraint firstItem="84L-UB-7zZ" firstAttribute="centerY" secondItem="hv5-8I-1dA" secondAttribute="centerY" id="bRe-Zz-ZgI"/>
                     <constraint firstItem="cCf-ee-0J6" firstAttribute="leading" secondItem="8Mf-6v-eUM" secondAttribute="leading" constant="15" id="dVe-Nj-QOF"/>
                     <constraint firstItem="84L-UB-7zZ" firstAttribute="leading" secondItem="7id-tv-Nnd" secondAttribute="leading" id="daM-2t-Cwl"/>
@@ -128,7 +128,7 @@
                 <outlet property="nameL" destination="84L-UB-7zZ" id="Hy8-Pa-Bvn"/>
                 <outlet property="titleL" destination="7id-tv-Nnd" id="zn3-Jw-E2C"/>
             </connections>
-            <point key="canvasLocation" x="150.72463768115944" y="348.88392857142856"/>
+            <point key="canvasLocation" x="150.72463768115944" y="353.90625"/>
         </tableViewCell>
         <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonListCell2" rowHeight="393" id="nR4-Z3-Hmt" customClass="CommonListCell">
             <rect key="frame" x="0.0" y="0.0" width="338" height="81"/>
@@ -169,7 +169,7 @@
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="置顶" translatesAutoresizingMaskIntoConstraints="NO" id="RfI-UG-K7A">
                         <rect key="frame" x="170.5" y="22" width="30" height="16"/>
                     </imageView>
-                    <button opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="65H-IX-fPd">
+                    <button opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="65H-IX-fPd">
                         <rect key="frame" x="15" y="60" width="30" height="12"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="12" id="XX2-gK-skj"/>