Commit d39eb576206f2bb125e2182a64def633f2af038a
1 parent
c4bfaf2c
滑动监听添加
Showing
10 changed files
with
284 additions
and
38 deletions
CNLiveVideoClassifyKit.podspec
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Controller/CNLiveListController.h
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Controller/CNLiveListController.m
| ... | ... | @@ -6,16 +6,21 @@ |
| 6 | 6 | // |
| 7 | 7 | |
| 8 | 8 | #import "CNLiveListController.h" |
| 9 | +#import <webKit/webKit.h> | |
| 10 | +#import "CNLiveListManager.h" | |
| 9 | 11 | |
| 10 | 12 | @interface CNLiveListController () |
| 11 | 13 | @property (nonatomic, strong)NSDictionary * paramDic; |
| 12 | 14 | @property (nonatomic, strong)CNCategoryGetChannelModel *model; |
| 15 | +@property (nonatomic, assign) CGFloat contentOffetY; | |
| 16 | +@property (nonatomic, assign) BOOL isLoading; | |
| 13 | 17 | @end |
| 14 | 18 | |
| 15 | 19 | @implementation CNLiveListController |
| 16 | 20 | -(instancetype)initWithModel:(CNCategoryGetChannelModel *)model black:(BOOL)black bgImage:(NSString *)bgImage bgColor:(NSString *)bgColor bgImageH5:(NSString *)bgImageH5 |
| 17 | 21 | { |
| 18 | 22 | if (self = [super init]) { |
| 23 | + self.contentOffetY = 0; | |
| 19 | 24 | _model = model; |
| 20 | 25 | if ([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){ |
| 21 | 26 | self.paramDic= @{ |
| ... | ... | @@ -55,9 +60,88 @@ |
| 55 | 60 | [CNLiveClassifyJumpBridge listViewRefreshWithVC:subVC pageType:_model.pageType.integerValue param:_paramDic refreshTime:time]; |
| 56 | 61 | // Do any additional setup after loading the view. |
| 57 | 62 | } |
| 58 | --(void)viewDidLayoutSubviews | |
| 63 | +- (void)viewDidAppear:(BOOL)animated | |
| 59 | 64 | { |
| 60 | - [super viewDidLayoutSubviews]; | |
| 65 | + [super viewDidAppear:animated]; | |
| 66 | + NSLog(@"%@",self.childViewControllers[0]); | |
| 67 | + UIViewController *vc = self.childViewControllers[0]; | |
| 68 | + if (([CNLiveListController searchProperties:[vc class] string:@"webView"]||[CNLiveListController searchProperties:[vc.superclass class] string:@"webView"])&&[vc valueForKey:@"webView"]&&[[vc valueForKey:@"webView"] isKindOfClass:[WKWebView class]]) { | |
| 69 | + WKWebView *webView = (WKWebView *)[vc valueForKey:@"webView"]; | |
| 70 | + [webView.scrollView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil]; | |
| 71 | + if ([webView.scrollView valueForKey:@"mj_header"]) { | |
| 72 | + id header = [webView.scrollView valueForKey:@"mj_header"]; | |
| 73 | + [header addObserver:self forKeyPath:@"state" options:NSKeyValueObservingOptionNew context:nil]; | |
| 74 | + } | |
| 75 | + | |
| 76 | + }else if ([CNLiveListController searchProperties:[vc class] string:@"collectionView"]&&[vc valueForKey:@"collectionView"] && [[vc valueForKey:@"collectionView"] isKindOfClass:[UICollectionView class]]){ | |
| 77 | + UICollectionView *collectionView = (UICollectionView *)[vc valueForKey:@"collectionView"]; | |
| 78 | + [collectionView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew context:nil]; | |
| 79 | + if ([collectionView valueForKey:@"mj_header"]) { | |
| 80 | + id header = [collectionView valueForKey:@"mj_header"]; | |
| 81 | + [header addObserver:self forKeyPath:@"state" options:NSKeyValueObservingOptionNew context:nil]; | |
| 82 | + } | |
| 83 | + } | |
| 84 | +} | |
| 85 | +- (void)viewDidDisappear:(BOOL)animated | |
| 86 | +{ | |
| 87 | + [super viewDidDisappear:animated]; | |
| 88 | + UIViewController *vc = self.childViewControllers[0]; | |
| 89 | + if (([CNLiveListController searchProperties:[vc class] string:@"webView"]||[CNLiveListController searchProperties:[vc.superclass class] string:@"webView"])&&[vc valueForKey:@"webView"]&&[[vc valueForKey:@"webView"] isKindOfClass:[WKWebView class]]) { | |
| 90 | + WKWebView *webView = (WKWebView *)[vc valueForKey:@"webView"]; | |
| 91 | + [webView.scrollView removeObserver:self forKeyPath:@"contentOffset"]; | |
| 92 | + if ([webView.scrollView valueForKey:@"mj_header"]) { | |
| 93 | + id header = [webView.scrollView valueForKey:@"mj_header"]; | |
| 94 | + [header removeObserver:self forKeyPath:@"state"]; | |
| 95 | + } | |
| 96 | + | |
| 97 | + }else if ([CNLiveListController searchProperties:[vc class] string:@"collectionView"]&&[vc valueForKey:@"collectionView"] && [[vc valueForKey:@"collectionView"] isKindOfClass:[UICollectionView class]]){ | |
| 98 | + UICollectionView *collectionView = (UICollectionView *)[vc valueForKey:@"collectionView"]; | |
| 99 | + [collectionView removeObserver:self forKeyPath:@"contentOffset"]; | |
| 100 | + if ([collectionView valueForKey:@"mj_header"]) { | |
| 101 | + id header = [collectionView valueForKey:@"mj_header"]; | |
| 102 | + [header removeObserver:self forKeyPath:@"state"]; | |
| 103 | + } | |
| 104 | + } | |
| 105 | +} | |
| 106 | ++ (BOOL)searchProperties:(Class)cls string:(NSString *)key | |
| 107 | +{ | |
| 108 | + unsigned int count; | |
| 109 | + objc_property_t *properties = class_copyPropertyList(cls, &count); | |
| 110 | + for (int i = 0; i < count; i++) { | |
| 111 | + objc_property_t property = properties[i]; | |
| 112 | + const char *cName = property_getName(property); | |
| 113 | + NSString *name = [NSString stringWithCString:cName encoding:NSUTF8StringEncoding]; | |
| 114 | + if ([name isEqualToString:key]) { | |
| 115 | + return YES; | |
| 116 | + } | |
| 117 | + } | |
| 118 | + return NO; | |
| 119 | +} | |
| 120 | +#pragma mark - KVO | |
| 121 | +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context | |
| 122 | +{ | |
| 123 | + NSLog(@"%@:%@",object,change); | |
| 124 | + if ([keyPath isEqualToString:@"state"]) { | |
| 125 | + NSString *state = change[NSKeyValueChangeNewKey]; | |
| 126 | + if (state.integerValue == 1) { | |
| 127 | + self.isLoading = NO; | |
| 128 | + }else{ | |
| 129 | + self.isLoading = YES; | |
| 130 | + } | |
| 131 | + }else if ([keyPath isEqualToString:@"contentOffset"]) { | |
| 132 | + if (self.isLoading) { | |
| 133 | + return; | |
| 134 | + } | |
| 135 | + NSValue *newValue = change[NSKeyValueChangeNewKey]; | |
| 136 | + CGFloat contentPointY = newValue.UIOffsetValue.vertical; | |
| 137 | + if (contentPointY>self.contentOffetY&&contentPointY>0) { | |
| 138 | + [[CNLiveListManager shareListManager] firstHeaderUp:YES]; | |
| 139 | + self.contentOffetY = contentPointY; | |
| 140 | + }else if (self.contentOffetY > contentPointY){ | |
| 141 | + self.contentOffetY = contentPointY; | |
| 142 | + [[CNLiveListManager shareListManager] firstHeaderUp:NO]; | |
| 143 | + } | |
| 144 | + } | |
| 61 | 145 | } |
| 62 | 146 | #pragma mark - JXCategoryListContentViewDelegate |
| 63 | 147 | -(UIView *)listView | ... | ... |
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Manager/CNLiveListManager.h
| ... | ... | @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN |
| 15 | 15 | |
| 16 | 16 | +(instancetype)shareListManager; |
| 17 | 17 | |
| 18 | -- (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging; | |
| 18 | +- (void)firstHeaderUp:(BOOL)isUp; | |
| 19 | 19 | |
| 20 | 20 | + (CNCategoryBaseViewController *)CNCategoryBaseViewController; |
| 21 | 21 | @end | ... | ... |
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Manager/CNLiveListManager.m
| ... | ... | @@ -29,24 +29,15 @@ |
| 29 | 29 | { |
| 30 | 30 | return [[CNLiveClassifySegmentController alloc] init]; |
| 31 | 31 | } |
| 32 | -- (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging | |
| 32 | +- (void)firstHeaderUp:(BOOL)isUp | |
| 33 | 33 | { |
| 34 | - if (isBeginDragging) { | |
| 35 | - beginoffsetY = scrollView.offsetY; | |
| 36 | - }else | |
| 37 | - { | |
| 38 | - CGFloat hight = scrollView.frame.size.height; | |
| 39 | - CGFloat contentOffset = scrollView.contentOffset.y; | |
| 40 | - CGFloat distanceFromBottom = scrollView.contentSize.height - contentOffset; | |
| 41 | - CGFloat offset = contentOffset - beginoffsetY; | |
| 42 | - if (offset > 0 && contentOffset > 0 && !self.isHiddenFirst) { | |
| 34 | + if (isUp&& !self.isHiddenFirst) { | |
| 43 | 35 | self.isHiddenFirst = YES; |
| 44 | 36 | !self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(YES); |
| 45 | - }else if (offset < 0 && ((scrollView.contentSize.height<hight && contentOffset<0) || distanceFromBottom>hight+1) && self.isHiddenFirst) { | |
| 37 | + }else if (!isUp&& self.isHiddenFirst) { | |
| 46 | 38 | self.isHiddenFirst = NO; |
| 47 | 39 | !self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(NO); |
| 48 | 40 | } |
| 49 | - } | |
| 50 | 41 | } |
| 51 | 42 | - (void)setIsHiddenFirst:(BOOL)isHiddenFirst |
| 52 | 43 | { | ... | ... |
Example/CNLiveVideoClassifyKit.xcodeproj/project.pbxproj
| ... | ... | @@ -11,6 +11,7 @@ |
| 11 | 11 | 08DAFBDE26E8A2660099999A /* CNTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DAFBDC26E8A2660099999A /* CNTools.m */; }; |
| 12 | 12 | 08DAFBEA26E9E99C0099999A /* CNLiveClassifyKitImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DAFBE926E9E99C0099999A /* CNLiveClassifyKitImpl.m */; }; |
| 13 | 13 | 08DAFBED26E9EA7E0099999A /* CNLIVEDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DAFBEC26E9EA7E0099999A /* CNLIVEDemoViewController.m */; }; |
| 14 | + 08FFE8E12744AACE00E39E0D /* CNLiveWebViewModuleImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FFE8DF2744AACE00E39E0D /* CNLiveWebViewModuleImpl.m */; }; | |
| 14 | 15 | 14963F4E510A1E5865D15ED8 /* Pods_CNLiveVideoClassifyKit_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7743536FE5FB6796BFAA55B5 /* Pods_CNLiveVideoClassifyKit_Tests.framework */; }; |
| 15 | 16 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; |
| 16 | 17 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; |
| ... | ... | @@ -49,6 +50,8 @@ |
| 49 | 50 | 08DAFBE926E9E99C0099999A /* CNLiveClassifyKitImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLiveClassifyKitImpl.m; sourceTree = "<group>"; }; |
| 50 | 51 | 08DAFBEB26E9EA7E0099999A /* CNLIVEDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLIVEDemoViewController.h; sourceTree = "<group>"; }; |
| 51 | 52 | 08DAFBEC26E9EA7E0099999A /* CNLIVEDemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNLIVEDemoViewController.m; sourceTree = "<group>"; }; |
| 53 | + 08FFE8DF2744AACE00E39E0D /* CNLiveWebViewModuleImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveWebViewModuleImpl.m; sourceTree = "<group>"; }; | |
| 54 | + 08FFE8E02744AACE00E39E0D /* CNLiveWebViewModuleImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveWebViewModuleImpl.h; sourceTree = "<group>"; }; | |
| 52 | 55 | 24BF123CDE580DC9CCCE1718 /* Pods-CNLiveVideoClassifyKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveVideoClassifyKit_Example.release.xcconfig"; path = "Target Support Files/Pods-CNLiveVideoClassifyKit_Example/Pods-CNLiveVideoClassifyKit_Example.release.xcconfig"; sourceTree = "<group>"; }; |
| 53 | 56 | 3A8AB8DB19B4EF9ACF33573D /* Pods-CNLiveVideoClassifyKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveVideoClassifyKit_Tests.release.xcconfig"; path = "Target Support Files/Pods-CNLiveVideoClassifyKit_Tests/Pods-CNLiveVideoClassifyKit_Tests.release.xcconfig"; sourceTree = "<group>"; }; |
| 54 | 57 | 5793570C0C400C4B3B4942CE /* Pods-CNLiveVideoClassifyKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CNLiveVideoClassifyKit_Example.debug.xcconfig"; path = "Target Support Files/Pods-CNLiveVideoClassifyKit_Example/Pods-CNLiveVideoClassifyKit_Example.debug.xcconfig"; sourceTree = "<group>"; }; |
| ... | ... | @@ -157,6 +160,8 @@ |
| 157 | 160 | 08DAFBDC26E8A2660099999A /* CNTools.m */, |
| 158 | 161 | 08DAFBE826E9E99C0099999A /* CNLiveClassifyKitImpl.h */, |
| 159 | 162 | 08DAFBE926E9E99C0099999A /* CNLiveClassifyKitImpl.m */, |
| 163 | + 08FFE8E02744AACE00E39E0D /* CNLiveWebViewModuleImpl.h */, | |
| 164 | + 08FFE8DF2744AACE00E39E0D /* CNLiveWebViewModuleImpl.m */, | |
| 160 | 165 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, |
| 161 | 166 | 6003F5A8195388D20070C39A /* Images.xcassets */, |
| 162 | 167 | 6003F594195388D20070C39A /* Supporting Files */, |
| ... | ... | @@ -374,8 +379,11 @@ |
| 374 | 379 | "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", |
| 375 | 380 | "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework", |
| 376 | 381 | "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework", |
| 382 | + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework", | |
| 383 | + "${BUILT_PRODUCTS_DIR}/CNLiveCWebViewModule/CNLiveCWebViewModule.framework", | |
| 377 | 384 | "${BUILT_PRODUCTS_DIR}/CNLiveCategory/CNLiveCategory.framework", |
| 378 | 385 | "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework", |
| 386 | + "${BUILT_PRODUCTS_DIR}/CNLiveCustomUI/CNLiveCustomUI.framework", | |
| 379 | 387 | "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework", |
| 380 | 388 | "${BUILT_PRODUCTS_DIR}/CNLiveNewTripartiteManagement/CNLiveNewTripartiteManagement.framework", |
| 381 | 389 | "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", |
| ... | ... | @@ -383,19 +391,31 @@ |
| 383 | 391 | "${BUILT_PRODUCTS_DIR}/FWDebug/FWDebug.framework", |
| 384 | 392 | "${BUILT_PRODUCTS_DIR}/JXCategoryView/JXCategoryView.framework", |
| 385 | 393 | "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", |
| 394 | + "${BUILT_PRODUCTS_DIR}/MJRefresh/MJRefresh.framework", | |
| 386 | 395 | "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", |
| 387 | 396 | "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework", |
| 388 | 397 | "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", |
| 398 | + "${BUILT_PRODUCTS_DIR}/WebViewJavascriptBridge/WebViewJavascriptBridge.framework", | |
| 399 | + "${BUILT_PRODUCTS_DIR}/YYAsyncLayer/YYAsyncLayer.framework", | |
| 389 | 400 | "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework", |
| 390 | 401 | "${BUILT_PRODUCTS_DIR}/YYCategories/YYCategories.framework", |
| 402 | + "${BUILT_PRODUCTS_DIR}/YYDispatchQueuePool/YYDispatchQueuePool.framework", | |
| 403 | + "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework", | |
| 404 | + "${BUILT_PRODUCTS_DIR}/YYKeyboardManager/YYKeyboardManager.framework", | |
| 405 | + "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework", | |
| 406 | + "${BUILT_PRODUCTS_DIR}/YYText/YYText.framework", | |
| 407 | + "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework", | |
| 391 | 408 | ); |
| 392 | 409 | name = "[CP] Embed Pods Frameworks"; |
| 393 | 410 | outputPaths = ( |
| 394 | 411 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", |
| 395 | 412 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework", |
| 396 | 413 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework", |
| 414 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework", | |
| 415 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCWebViewModule.framework", | |
| 397 | 416 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCategory.framework", |
| 398 | 417 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework", |
| 418 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomUI.framework", | |
| 399 | 419 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework", |
| 400 | 420 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveNewTripartiteManagement.framework", |
| 401 | 421 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", |
| ... | ... | @@ -403,11 +423,20 @@ |
| 403 | 423 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FWDebug.framework", |
| 404 | 424 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JXCategoryView.framework", |
| 405 | 425 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", |
| 426 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJRefresh.framework", | |
| 406 | 427 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", |
| 407 | 428 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework", |
| 408 | 429 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", |
| 430 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebViewJavascriptBridge.framework", | |
| 431 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYAsyncLayer.framework", | |
| 409 | 432 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework", |
| 410 | 433 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCategories.framework", |
| 434 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYDispatchQueuePool.framework", | |
| 435 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework", | |
| 436 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYKeyboardManager.framework", | |
| 437 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework", | |
| 438 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYText.framework", | |
| 439 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework", | |
| 411 | 440 | ); |
| 412 | 441 | runOnlyForDeploymentPostprocessing = 0; |
| 413 | 442 | shellPath = /bin/sh; |
| ... | ... | @@ -445,6 +474,7 @@ |
| 445 | 474 | 6003F59E195388D20070C39A /* CNLIVEAppDelegate.m in Sources */, |
| 446 | 475 | 6003F5A7195388D20070C39A /* CNLIVEViewController.m in Sources */, |
| 447 | 476 | 6003F59A195388D20070C39A /* main.m in Sources */, |
| 477 | + 08FFE8E12744AACE00E39E0D /* CNLiveWebViewModuleImpl.m in Sources */, | |
| 448 | 478 | 08DAFBDE26E8A2660099999A /* CNTools.m in Sources */, |
| 449 | 479 | ); |
| 450 | 480 | runOnlyForDeploymentPostprocessing = 0; | ... | ... |
Example/CNLiveVideoClassifyKit/CNLiveClassifyKitImpl.m
| ... | ... | @@ -9,7 +9,8 @@ |
| 9 | 9 | #import "CNLiveClassifyKitImpl.h" |
| 10 | 10 | #import "CNLIVEDemoViewController.h" |
| 11 | 11 | #import "CNLIVEViewController.h" |
| 12 | - | |
| 12 | +#import <CNLiveCWebViewModule/CNLiveCWebViewModule.h> | |
| 13 | +#import <CNLiveCWebViewModule/CNLiveSubWebViewController.h> | |
| 13 | 14 | #import <CNLiveCommonCategory/NSString+CNLiveUrlEncode.h> |
| 14 | 15 | |
| 15 | 16 | @implementation CNLiveClassifyKitImpl |
| ... | ... | @@ -22,9 +23,22 @@ |
| 22 | 23 | }else if (pageType == 2){ |
| 23 | 24 | CNLIVEViewController *demo = [CNLIVEViewController new]; |
| 24 | 25 | return demo; |
| 25 | - }else{ | |
| 26 | + }else if (pageType == 7){ | |
| 26 | 27 | CNLIVEViewController *demo = [CNLIVEViewController new]; |
| 27 | 28 | return demo; |
| 29 | + }else{ | |
| 30 | + NSString *thirdUrl = param[@"thirdUrl"]; | |
| 31 | + NSString *backgroundColor = param[@"backgroundColor"]; | |
| 32 | + NSString *backImageH5 = param[@"backgroundImgH5"]; | |
| 33 | + if (!CNLiveStringIsEmpty(thirdUrl)) { | |
| 34 | + NSString *andStr = @"&"; | |
| 35 | + if (![thirdUrl cn_containsString:@"?"]) { | |
| 36 | + andStr = @"?"; | |
| 37 | + } | |
| 38 | + thirdUrl = [thirdUrl stringByAppendingFormat:@"%@backgroundColor=%@&backgroundImgH5=%@",andStr,backgroundColor?[backgroundColor urlEncode]:@"",backImageH5?[backImageH5 urlEncode]:@""]; | |
| 39 | + } | |
| 40 | + CNLiveSubWebViewController *subVC = [CNLiveCWebViewModule showWebVCWithLunchForWebURL:thirdUrl ParamDict:param ShowType:CNLiveWebViewLunchShowTypeHidden]; | |
| 41 | + return subVC; | |
| 28 | 42 | } |
| 29 | 43 | |
| 30 | 44 | } | ... | ... |
Example/CNLiveVideoClassifyKit/CNLiveWebViewModuleImpl.m
| ... | ... | @@ -116,7 +116,7 @@ |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | - (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging { |
| 119 | - [[CNLiveListManager shareListManager] requestWebViewForScrollView:scrollView isBeginDragging:isBeginDragging]; | |
| 119 | + | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | ... | ... |
Example/Podfile
| ... | ... | @@ -8,24 +8,24 @@ target 'CNLiveVideoClassifyKit_Example' do |
| 8 | 8 | pod 'CNLiveVideoClassifyKit', :path => '../' |
| 9 | 9 | pod 'CNLiveEnvironment' |
| 10 | 10 | pod 'CNLiveRequestBastKit' |
| 11 | -# pod 'CNLiveCWebViewModule' | |
| 11 | + pod 'CNLiveCWebViewModule' | |
| 12 | 12 | pod 'FWDebug', :configurations => ['Debug'] |
| 13 | 13 | # #依赖三方私有库,如果里面有.a的时候加上这个 |
| 14 | -# pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} | |
| 15 | - ############################################ #删除WebViewJavascriptBridge中的WebViewJavascriptBridge.h和WebViewJavascriptBridge.m文件 | |
| 14 | + pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} | |
| 15 | + ########################################### #删除WebViewJavascriptBridge中的WebViewJavascriptBridge.h和WebViewJavascriptBridge.m文件 | |
| 16 | 16 | |
| 17 | -# dir_web = File.join(installer.sandbox.pod_dir('WebViewJavascriptBridge'), 'WebViewJavascriptBridge') | |
| 18 | -# Dir.foreach(dir_web) {|x| | |
| 19 | -# real_path = File.join(dir_web, x) | |
| 20 | -# if (!File.directory?(real_path) && File.exists?(real_path)) | |
| 21 | -# if(x == 'WebViewJavascriptBridge.h' || x == 'WebViewJavascriptBridge.m') | |
| 22 | -# File.delete(real_path) | |
| 23 | -# end | |
| 24 | -# end | |
| 25 | -# } | |
| 26 | -# #删除WebViewJavascriptBridge中的WebViewJavascriptBridge.h和WebViewJavascriptBridge.m文件 | |
| 27 | -# ################################################# | |
| 28 | -# end | |
| 17 | + dir_web = File.join(installer.sandbox.pod_dir('WebViewJavascriptBridge'), 'WebViewJavascriptBridge') | |
| 18 | + Dir.foreach(dir_web) {|x| | |
| 19 | + real_path = File.join(dir_web, x) | |
| 20 | + if (!File.directory?(real_path) && File.exists?(real_path)) | |
| 21 | + if(x == 'WebViewJavascriptBridge.h' || x == 'WebViewJavascriptBridge.m') | |
| 22 | + File.delete(real_path) | |
| 23 | + end | |
| 24 | + end | |
| 25 | + } | |
| 26 | + #删除WebViewJavascriptBridge中的WebViewJavascriptBridge.h和WebViewJavascriptBridge.m文件 | |
| 27 | + ################################################# | |
| 28 | + end | |
| 29 | 29 | |
| 30 | 30 | post_install do |installer_representation| |
| 31 | 31 | installer_representation.pods_project.targets.each do |target| | ... | ... |
Example/Podfile.lock
| ... | ... | @@ -17,6 +17,20 @@ PODS: |
| 17 | 17 | - CNLiveBaseKit (0.1.23): |
| 18 | 18 | - CNLiveNewTripartiteManagement/MJExtension |
| 19 | 19 | - CNLiveBeeHive (0.1.9) |
| 20 | + - CNLiveBusinessTools (0.1.27): | |
| 21 | + - CNLiveBaseKit | |
| 22 | + - CNLiveEnvironment | |
| 23 | + - CNLiveNewTripartiteManagement/QMUIKit | |
| 24 | + - CNLiveNewTripartiteManagement/YYCache | |
| 25 | + - CNLiveNewTripartiteManagement/YYImage | |
| 26 | + - CNLiveNewTripartiteManagement/YYModel | |
| 27 | + - CNLiveNewTripartiteManagement/YYText | |
| 28 | + - CNLiveNewTripartiteManagement/YYWebImage | |
| 29 | + - CNLiveRequestBastKit | |
| 30 | + - CNLiveUserManagement | |
| 31 | + - YYAsyncLayer | |
| 32 | + - YYCategories | |
| 33 | + - YYDispatchQueuePool | |
| 20 | 34 | - CNLiveCategory (0.0.2): |
| 21 | 35 | - CNLiveCategory/Object (= 0.0.2) |
| 22 | 36 | - CNLiveCategory/Object (0.0.2) |
| ... | ... | @@ -25,24 +39,96 @@ PODS: |
| 25 | 39 | - CNLiveCommonCategory/ImageInBundle (= 0.5.2) |
| 26 | 40 | - CNLiveCommonCategory/ARC (0.5.2) |
| 27 | 41 | - CNLiveCommonCategory/ImageInBundle (0.5.2) |
| 42 | + - CNLiveCustomUI (0.5.6): | |
| 43 | + - CNLiveBaseKit | |
| 44 | + - CNLiveBusinessTools | |
| 45 | + - CNLiveCustomUI/CNLiveBasicsUI (= 0.5.6) | |
| 46 | + - CNLiveCustomUI/CNLiveContentToolTextView (= 0.5.6) | |
| 47 | + - CNLiveCustomUI/CNLiveCycleScrollView (= 0.5.6) | |
| 48 | + - CNLiveCustomUI/CNLiveGetImage (= 0.5.6) | |
| 49 | + - CNLiveCustomUI/CNLivePopView (= 0.5.6) | |
| 50 | + - CNLiveCustomUI/CNLiveRefresh (= 0.5.6) | |
| 51 | + - CNLiveCustomUI/CNLiveBasicsUI (0.5.6): | |
| 52 | + - CNLiveBaseKit | |
| 53 | + - CNLiveBusinessTools | |
| 54 | + - CNLiveCustomUI/CNLiveGetImage | |
| 55 | + - CNLiveNewTripartiteManagement/Masonry | |
| 56 | + - CNLiveNewTripartiteManagement/QMUIKit | |
| 57 | + - CNLiveNewTripartiteManagement/YYAsyncLayer | |
| 58 | + - CNLiveNewTripartiteManagement/YYCache | |
| 59 | + - CNLiveNewTripartiteManagement/YYCategories | |
| 60 | + - CNLiveNewTripartiteManagement/YYDispatchQueuePool | |
| 61 | + - CNLiveNewTripartiteManagement/YYImage | |
| 62 | + - CNLiveNewTripartiteManagement/YYKeyboardManager | |
| 63 | + - CNLiveNewTripartiteManagement/YYModel | |
| 64 | + - CNLiveNewTripartiteManagement/YYText | |
| 65 | + - CNLiveNewTripartiteManagement/YYWebImage | |
| 66 | + - CNLiveCustomUI/CNLiveContentToolTextView (0.5.6): | |
| 67 | + - CNLiveBaseKit | |
| 68 | + - CNLiveBusinessTools | |
| 69 | + - CNLiveNewTripartiteManagement/Masonry | |
| 70 | + - CNLiveNewTripartiteManagement/QMUIKit | |
| 71 | + - CNLiveCustomUI/CNLiveCycleScrollView (0.5.6): | |
| 72 | + - CNLiveBaseKit | |
| 73 | + - CNLiveBusinessTools | |
| 74 | + - CNLiveNewTripartiteManagement/SDWebImage | |
| 75 | + - CNLiveCustomUI/CNLiveGetImage (0.5.6): | |
| 76 | + - CNLiveBaseKit | |
| 77 | + - CNLiveBusinessTools | |
| 78 | + - CNLiveCustomUI/CNLivePopView (0.5.6): | |
| 79 | + - CNLiveBaseKit | |
| 80 | + - CNLiveBusinessTools | |
| 81 | + - CNLiveNewTripartiteManagement/QMUIKit | |
| 82 | + - CNLiveCustomUI/CNLiveRefresh (0.5.6): | |
| 83 | + - CNLiveBaseKit | |
| 84 | + - CNLiveBusinessTools | |
| 85 | + - CNLiveCustomUI/CNLiveGetImage | |
| 86 | + - CNLiveNewTripartiteManagement/MJRefresh | |
| 87 | + - CNLiveCWebViewModule (0.0.15): | |
| 88 | + - CNLiveCustomUI | |
| 89 | + - CNLiveEnvironment | |
| 90 | + - CNLiveNewTripartiteManagement/Masonry | |
| 91 | + - CNLiveNewTripartiteManagement/QMUIKit | |
| 92 | + - CNLiveNewTripartiteManagement/YYText | |
| 93 | + - CNLiveRequestBastKit | |
| 94 | + - CNLiveSDK/CNLiveStat | |
| 95 | + - CNLiveUserManagement | |
| 96 | + - WebViewJavascriptBridge | |
| 28 | 97 | - CNLiveEnvironment (0.3.3) |
| 29 | 98 | - CNLiveNewTripartiteManagement/Masonry (0.2.0.5): |
| 30 | 99 | - Masonry (= 1.1.0) |
| 31 | 100 | - CNLiveNewTripartiteManagement/MJExtension (0.2.0.5): |
| 32 | 101 | - MJExtension (= 3.2.1) |
| 102 | + - CNLiveNewTripartiteManagement/MJRefresh (0.2.0.6): | |
| 103 | + - MJRefresh (= 3.2.0) | |
| 33 | 104 | - CNLiveNewTripartiteManagement/QMUIKit (0.2.0.5): |
| 34 | 105 | - QMUIKit (= 4.2.1) |
| 35 | 106 | - CNLiveNewTripartiteManagement/SDWebImage (0.2.0.5): |
| 36 | 107 | - SDWebImage (= 5.2.3) |
| 108 | + - CNLiveNewTripartiteManagement/YYAsyncLayer (0.2.0.6): | |
| 109 | + - YYAsyncLayer (= 1.0) | |
| 37 | 110 | - CNLiveNewTripartiteManagement/YYCache (0.2.0.5): |
| 38 | 111 | - YYCache (= 1.0.4) |
| 39 | 112 | - CNLiveNewTripartiteManagement/YYCategories (0.2.0.5): |
| 40 | 113 | - YYCategories (= 1.0.4) |
| 114 | + - CNLiveNewTripartiteManagement/YYDispatchQueuePool (0.2.0.6): | |
| 115 | + - YYDispatchQueuePool (= 1.0) | |
| 116 | + - CNLiveNewTripartiteManagement/YYImage (0.2.0.6): | |
| 117 | + - YYImage (= 1.0.4) | |
| 118 | + - CNLiveNewTripartiteManagement/YYKeyboardManager (0.2.0.6): | |
| 119 | + - YYKeyboardManager (= 1.0.1) | |
| 120 | + - CNLiveNewTripartiteManagement/YYModel (0.2.0.6): | |
| 121 | + - YYModel (= 1.0.4) | |
| 122 | + - CNLiveNewTripartiteManagement/YYText (0.2.0.6): | |
| 123 | + - YYText (= 1.0.7) | |
| 124 | + - CNLiveNewTripartiteManagement/YYWebImage (0.2.0.6): | |
| 125 | + - YYWebImage (= 1.0.5) | |
| 41 | 126 | - CNLiveRequestBastKit (0.2.5.6): |
| 42 | 127 | - AFNetworking |
| 128 | + - CNLiveSDK/CNLiveStat (0.3.4.8) | |
| 43 | 129 | - CNLiveUserManagement (0.1.5): |
| 44 | 130 | - CNLiveNewTripartiteManagement/MJExtension |
| 45 | - - CNLiveVideoClassifyKit (0.0.17): | |
| 131 | + - CNLiveVideoClassifyKit (0.0.20): | |
| 46 | 132 | - CNLiveBaseKit |
| 47 | 133 | - CNLiveBeeHive |
| 48 | 134 | - CNLiveCategory |
| ... | ... | @@ -61,6 +147,7 @@ PODS: |
| 61 | 147 | - JXCategoryView (1.5.9) |
| 62 | 148 | - Masonry (1.1.0) |
| 63 | 149 | - MJExtension (3.2.1) |
| 150 | + - MJRefresh (3.2.0) | |
| 64 | 151 | - QMUIKit (4.2.1): |
| 65 | 152 | - QMUIKit/QMUIComponents (= 4.2.1) |
| 66 | 153 | - QMUIKit/QMUICore (= 4.2.1) |
| ... | ... | @@ -386,12 +473,25 @@ PODS: |
| 386 | 473 | - UMAPM |
| 387 | 474 | - UMDevice |
| 388 | 475 | - UMDevice (2.0.5) |
| 476 | + - WebViewJavascriptBridge (6.0.3) | |
| 477 | + - YYAsyncLayer (1.0) | |
| 389 | 478 | - YYCache (1.0.4) |
| 390 | 479 | - YYCategories (1.0.4): |
| 391 | 480 | - YYCategories/no-arc (= 1.0.4) |
| 392 | 481 | - YYCategories/no-arc (1.0.4) |
| 482 | + - YYDispatchQueuePool (1.0) | |
| 483 | + - YYImage (1.0.4): | |
| 484 | + - YYImage/Core (= 1.0.4) | |
| 485 | + - YYImage/Core (1.0.4) | |
| 486 | + - YYKeyboardManager (1.0.1) | |
| 487 | + - YYModel (1.0.4) | |
| 488 | + - YYText (1.0.7) | |
| 489 | + - YYWebImage (1.0.5): | |
| 490 | + - YYCache | |
| 491 | + - YYImage | |
| 393 | 492 | |
| 394 | 493 | DEPENDENCIES: |
| 494 | + - CNLiveCWebViewModule | |
| 395 | 495 | - CNLiveEnvironment |
| 396 | 496 | - CNLiveRequestBastKit |
| 397 | 497 | - CNLiveVideoClassifyKit (from `../`) |
| ... | ... | @@ -401,25 +501,38 @@ SPEC REPOS: |
| 401 | 501 | http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git: |
| 402 | 502 | - CNLiveBaseKit |
| 403 | 503 | - CNLiveBeeHive |
| 504 | + - CNLiveBusinessTools | |
| 404 | 505 | - CNLiveCategory |
| 405 | 506 | - CNLiveCommonCategory |
| 507 | + - CNLiveCustomUI | |
| 508 | + - CNLiveCWebViewModule | |
| 406 | 509 | - CNLiveEnvironment |
| 407 | 510 | - CNLiveNewTripartiteManagement |
| 408 | 511 | - CNLiveRequestBastKit |
| 409 | 512 | - CNLiveUserManagement |
| 410 | 513 | https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git: |
| 411 | 514 | - AFNetworking |
| 515 | + - CNLiveSDK | |
| 412 | 516 | - FWDebug |
| 413 | 517 | - JXCategoryView |
| 414 | 518 | - Masonry |
| 415 | 519 | - MJExtension |
| 520 | + - MJRefresh | |
| 416 | 521 | - QMUIKit |
| 417 | 522 | - SDWebImage |
| 418 | 523 | - UMAPM |
| 419 | 524 | - UMCCommon |
| 420 | 525 | - UMDevice |
| 526 | + - WebViewJavascriptBridge | |
| 527 | + - YYAsyncLayer | |
| 421 | 528 | - YYCache |
| 422 | 529 | - YYCategories |
| 530 | + - YYDispatchQueuePool | |
| 531 | + - YYImage | |
| 532 | + - YYKeyboardManager | |
| 533 | + - YYModel | |
| 534 | + - YYText | |
| 535 | + - YYWebImage | |
| 423 | 536 | |
| 424 | 537 | EXTERNAL SOURCES: |
| 425 | 538 | CNLiveVideoClassifyKit: |
| ... | ... | @@ -429,25 +542,38 @@ SPEC CHECKSUMS: |
| 429 | 542 | AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce |
| 430 | 543 | CNLiveBaseKit: 44e5fc573cbca78a86b704cf77c886ef53889807 |
| 431 | 544 | CNLiveBeeHive: 1e105b15b6ccaad546258fcf91231563beb853d4 |
| 545 | + CNLiveBusinessTools: dfd3270d885523be2599bdc3a95a416277682d0d | |
| 432 | 546 | CNLiveCategory: c90a01af1e20cd89f47d4f551d47d2ddc9ca96f3 |
| 433 | 547 | CNLiveCommonCategory: 22c9842b31f2087803ae69e983b2c944fb80eae1 |
| 548 | + CNLiveCustomUI: 55057d1da8c3b6987d8b427ae251db1dc71a3a19 | |
| 549 | + CNLiveCWebViewModule: 27d1bbc10be19f90830a1671983d42eb4d34d7d8 | |
| 434 | 550 | CNLiveEnvironment: 6af0a2f332b704ffdec67106b4ba044c7f8da371 |
| 435 | - CNLiveNewTripartiteManagement: db7e1ba0a79312520194fde2fb78026a0f5e3eea | |
| 551 | + CNLiveNewTripartiteManagement: 29ddb2d23ee77bcd42ba5eaf5f1322ed37db5baa | |
| 436 | 552 | CNLiveRequestBastKit: c6ae13843ee0f96082c58230dc92c249edd6220f |
| 553 | + CNLiveSDK: 75bafaafbb8c09dcb4420adfe0f05130405b25e7 | |
| 437 | 554 | CNLiveUserManagement: ead053f2d701b01ea8fb5f1da572be788f2dd3cf |
| 438 | - CNLiveVideoClassifyKit: bfe369aa1ddd5b4939b34624f4f31e01ae30b702 | |
| 555 | + CNLiveVideoClassifyKit: fe003a79396501afaaafbb80020fffeb8275612d | |
| 439 | 556 | FWDebug: 5a20d089a300517153de1438d8128ad4c4690951 |
| 440 | 557 | JXCategoryView: 2ef9ecfd3735158d009ce02d1f29811aa822da65 |
| 441 | 558 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 |
| 442 | 559 | MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545 |
| 560 | + MJRefresh: ed450d6eb9d3346a2cb033ab7eb6de090aeef437 | |
| 443 | 561 | QMUIKit: 15294d6a350466e4a6f4df0333eac5bff474f995 |
| 444 | 562 | SDWebImage: 46a7f73228f84ce80990c786e4372cf4db5875ce |
| 445 | 563 | UMAPM: 163962b8a6ec1a10a3034468da070b28ca510d5b |
| 446 | 564 | UMCCommon: 3c535e9e3958f72df075cc6fe4776fb5e403c8bc |
| 447 | 565 | UMDevice: c13bbb2e8ca6c67d1e23e03162553e3ec5a8b5b0 |
| 566 | + WebViewJavascriptBridge: 7f5bc4d3581e672e8f32bd0f812d54bc69bb8e29 | |
| 567 | + YYAsyncLayer: df6b01ebc695c5f6b4c15dd5c23fa3e081eb25c0 | |
| 448 | 568 | YYCache: 8105b6638f5e849296c71f331ff83891a4942952 |
| 449 | 569 | YYCategories: 6bcd4314c6661a561410dce4a793379ebd306abd |
| 570 | + YYDispatchQueuePool: 3dfb2274bcc74207688dde8ac6f7bdd46871dd7b | |
| 571 | + YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 | |
| 572 | + YYKeyboardManager: ff53d2e80d1808567a7f004028bd200d9469a89f | |
| 573 | + YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 | |
| 574 | + YYText: 5c461d709e24d55a182d1441c41dc639a18a4849 | |
| 575 | + YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928 | |
| 450 | 576 | |
| 451 | -PODFILE CHECKSUM: 3d349bf575390d6c2eb71885b6cb8e87236d6ba9 | |
| 577 | +PODFILE CHECKSUM: 8b9baccf9e475fa95c919cdeef4cb1daa577c0d6 | |
| 452 | 578 | |
| 453 | 579 | COCOAPODS: 1.11.2 | ... | ... |