diff --git a/GKPageScrollView.podspec b/GKPageScrollView.podspec index 3f36a7e..83f86aa 100644 --- a/GKPageScrollView.podspec +++ b/GKPageScrollView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'GKPageScrollView' - s.version = '1.6.8' + s.version = '1.6.9' s.summary = 'iOS UIScrollView嵌套滑动分页视图' s.homepage = 'https://github.com/QuintGao/GKPageScrollView' s.license = { :type => "MIT", :file => "LICENSE" } diff --git a/GKPageSmoothView.podspec b/GKPageSmoothView.podspec index 9577176..f1002b0 100644 --- a/GKPageSmoothView.podspec +++ b/GKPageSmoothView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'GKPageSmoothView' - s.version = '1.6.8' + s.version = '1.6.9' s.summary = 'iOS UIScrollView嵌套滑动分页视图' s.homepage = 'https://github.com/QuintGao/GKPageScrollView' s.license = { :type => "MIT", :file => "LICENSE" } diff --git a/ObjcExample/ObjcExample/Demo/Base/GKBaseListViewController.m b/ObjcExample/ObjcExample/Demo/Base/GKBaseListViewController.m index a2c9efb..0176a5f 100644 --- a/ObjcExample/ObjcExample/Demo/Base/GKBaseListViewController.m +++ b/ObjcExample/ObjcExample/Demo/Base/GKBaseListViewController.m @@ -74,7 +74,9 @@ - (void)viewDidLoad { } if (self.listType != GKBaseListType_WKWebView) { + __weak __typeof(self) weakSelf = self; self.currentScrollView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ + __strong __typeof(weakSelf) self = weakSelf; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(kRefreshDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self loadMoreData]; }); @@ -147,7 +149,11 @@ - (void)loadMoreData { } - (void)addCellToScrollView { - [self.scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; + [self.scrollView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if ([obj isKindOfClass:UILabel.class]) { + [obj removeFromSuperview]; + } + }]; UIView *lastView = nil; for (NSInteger i = 0; i < self.count; i++) { @@ -186,7 +192,9 @@ - (void)hideLoading { } - (void)addHeaderRefresh { + __weak __typeof(self) weakSelf = self; self.currentScrollView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + __strong __typeof(weakSelf) self = weakSelf; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(kRefreshDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.currentScrollView.mj_header endRefreshing]; diff --git a/ObjcExample/ObjcExample/Demo/GKPageSmoothView/Smooth/GKSmoothViewController.m b/ObjcExample/ObjcExample/Demo/GKPageSmoothView/Smooth/GKSmoothViewController.m index 83aca01..c332747 100644 --- a/ObjcExample/ObjcExample/Demo/GKPageSmoothView/Smooth/GKSmoothViewController.m +++ b/ObjcExample/ObjcExample/Demo/GKPageSmoothView/Smooth/GKSmoothViewController.m @@ -84,7 +84,7 @@ - (NSInteger)numberOfListsInSmoothView:(GKPageSmoothView *)smoothView { // listVC.delegate = self; // listVC.index = index; // return listVC; - GKBaseListViewController *listVC = [[GKBaseListViewController alloc] initWithListType:0]; + GKBaseListViewController *listVC = [[GKBaseListViewController alloc] initWithListType:index]; listVC.shouldLoadData = YES; return listVC; } diff --git "a/ObjcExample/ObjcExample/Demo/GKPageSmoothView/\350\261\206\347\223\243/GKDBViewController.m" "b/ObjcExample/ObjcExample/Demo/GKPageSmoothView/\350\261\206\347\223\243/GKDBViewController.m" index 5905d02..24e10aa 100644 --- "a/ObjcExample/ObjcExample/Demo/GKPageSmoothView/\350\261\206\347\223\243/GKDBViewController.m" +++ "b/ObjcExample/ObjcExample/Demo/GKPageSmoothView/\350\261\206\347\223\243/GKDBViewController.m" @@ -67,11 +67,11 @@ - (NSInteger)numberOfListsInSmoothView:(GKPageSmoothView *)smoothView { } - (id)smoothView:(GKPageSmoothView *)smoothView initListAtIndex:(NSInteger)index { -// GKDBListView *listView = [GKDBListView new]; -// return listView; - GKBaseListViewController *listVC = [[GKBaseListViewController alloc] initWithListType:index]; - listVC.shouldLoadData = YES; - return listVC; + GKDBListView *listView = [GKDBListView new]; + return listView; +// GKBaseListViewController *listVC = [[GKBaseListViewController alloc] initWithListType:index]; +// listVC.shouldLoadData = YES; +// return listVC; } #pragma mark - GKPageSmoothViewDelegate @@ -213,7 +213,7 @@ - (JXCategorySubTitleView *)categoryView { lineView.indicatorColor = UIColor.blackColor; _categoryView.indicators = @[self.lineView]; - _categoryView.contentScrollView = self.smoothView.listCollectionView; +// _categoryView.contentScrollView = self.smoothView.listCollectionView; } return _categoryView; } diff --git a/Podfile.lock b/Podfile.lock index 219513a..6750014 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,18 +1,18 @@ PODS: - - GKNavigationBar (1.6.0): - - GKNavigationBar/GestureHandle (= 1.6.0) - - GKNavigationBar/NavigationBar (= 1.6.0) - - GKNavigationBar/GestureHandle (1.6.0) - - GKNavigationBar/NavigationBar (1.6.0) + - GKNavigationBar (1.6.1): + - GKNavigationBar/GestureHandle (= 1.6.1) + - GKNavigationBar/NavigationBar (= 1.6.1) + - GKNavigationBar/GestureHandle (1.6.1) + - GKNavigationBar/NavigationBar (1.6.1) - GKNavigationBarSwift (1.3.1) - - GKPageScrollView (1.6.6): - - GKPageScrollView/Objc (= 1.6.6) - - GKPageScrollView/Objc (1.6.6) - - GKPageScrollView/Swift (1.6.6) - - GKPageSmoothView (1.6.6): - - GKPageSmoothView/Objc (= 1.6.6) - - GKPageSmoothView/Objc (1.6.6) - - GKPageSmoothView/Swift (1.6.6) + - GKPageScrollView (1.6.9): + - GKPageScrollView/Objc (= 1.6.9) + - GKPageScrollView/Objc (1.6.9) + - GKPageScrollView/Swift (1.6.9) + - GKPageSmoothView (1.6.9): + - GKPageSmoothView/Objc (= 1.6.9) + - GKPageSmoothView/Objc (1.6.9) + - GKPageSmoothView/Swift (1.6.9) - JXCategoryViewExt/Core (1.1.4) - JXCategoryViewExt/Indicator/AlignmentLine (1.1.4): - JXCategoryViewExt/Indicator/Line @@ -68,10 +68,10 @@ EXTERNAL SOURCES: :path: "../GKPageScrollView" SPEC CHECKSUMS: - GKNavigationBar: 777b10cebaa1026d9aa392859c42e389895eb744 + GKNavigationBar: 4b63ee7d9337d3c1b5057fa324730a083c828fda GKNavigationBarSwift: f3d1a977b4397f43bb7e5769c92609795090edb2 - GKPageScrollView: af9750e3ac29cbceb3ec7dacfdb323b06a5f07fd - GKPageSmoothView: 2b2dbd4a71840fcab60ecee486cd6bab9003491a + GKPageScrollView: 8c3e8e9c35f1f4117bf94e5556b351917cb3df14 + GKPageSmoothView: 8eae3929aa6e6a80b1dc93f4b539f890e63b5df1 JXCategoryViewExt: 4fa0ec4d1c05e4a02c61c7c94f1059fbf06ceeca JXSegmentedView: eb1cad21f57c2543c00c3e08b8fd3c7ca54f5acd Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 diff --git a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKBaseAnimatedTransition.h b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKBaseAnimatedTransition.h index ee3556f..9979410 100644 --- a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKBaseAnimatedTransition.h +++ b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKBaseAnimatedTransition.h @@ -41,11 +41,6 @@ NS_ASSUME_NONNULL_BEGIN /// 动画完成 - (void)completeTransition; - -/// 获取某个view的截图 -/// @param view 截图 -- (UIImage *)getCaptureWithView:(UIView *)view; - @end @interface UIViewController (GKCapture) diff --git a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKBaseAnimatedTransition.m b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKBaseAnimatedTransition.m index 546a582..d83ad57 100644 --- a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKBaseAnimatedTransition.m +++ b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKBaseAnimatedTransition.m @@ -53,14 +53,6 @@ - (void)completeTransition { [self.transitionContext completeTransition:!self.transitionContext.transitionWasCancelled]; } -- (UIImage *)getCaptureWithView:(UIView *)view { - UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0); - [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO]; - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - @end @implementation UIViewController (GKCapture) diff --git a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKGestureHandleConfigure.h b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKGestureHandleConfigure.h index 4de915d..a4d5198 100644 --- a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKGestureHandleConfigure.h +++ b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKGestureHandleConfigure.h @@ -42,6 +42,9 @@ NS_ASSUME_NONNULL_BEGIN // 如果设置为YES,可在单个UIScrollView中通过设置gk_openGestureHandle关闭 @property (nonatomic, assign) BOOL gk_openScrollViewGestureHandle; +// 设置push时是否隐藏tabbar,默认NO +@property (nonatomic, assign) BOOL gk_hidesBottomBarWhenPushed; + /// 设置默认配置 - (void)setupDefaultConfigure; @@ -56,6 +59,10 @@ NS_ASSUME_NONNULL_BEGIN // 内部方法 - (BOOL)isVelocityInSensitivity:(CGFloat)velocity; +/// 获取某个view的截图 +/// @param view view +- (UIImage *)getCaptureWithView:(UIView *)view; + @end NS_ASSUME_NONNULL_END diff --git a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKGestureHandleConfigure.m b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKGestureHandleConfigure.m index 1b3ac53..c8ca1f8 100644 --- a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKGestureHandleConfigure.m +++ b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKGestureHandleConfigure.m @@ -56,4 +56,12 @@ - (BOOL)isVelocityInSensitivity:(CGFloat)velocity { return (fabs(velocity) - (1000.0f * (1 - self.gk_snapMovementSensitivity))) > 0; } +- (UIImage *)getCaptureWithView:(UIView *)view { + UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0); + [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO]; + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return image; +} + @end diff --git a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKPushAnimatedTransition.m b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKPushAnimatedTransition.m index f04061a..b2c3904 100644 --- a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKPushAnimatedTransition.m +++ b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/GKPushAnimatedTransition.m @@ -21,7 +21,7 @@ - (void)animateTransition { __block UIView *fromView = nil; if (self.isHideTabBar) { // 获取fromViewController的截图 - UIImage *captureImage = [self getCaptureWithView:self.fromViewController.view.window]; + UIImage *captureImage = [GKGestureConfigure getCaptureWithView:self.fromViewController.view.window]; UIImageView *captureView = [[UIImageView alloc] initWithImage:captureImage]; captureView.frame = CGRectMake(0, 0, screenW, screenH); [self.containerView addSubview:captureView]; diff --git a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/UINavigationController+GKGestureHandle.m b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/UINavigationController+GKGestureHandle.m index 3463e8a..8bcbd07 100644 --- a/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/UINavigationController+GKGestureHandle.m +++ b/Pods/GKNavigationBar/GKNavigationBar/GestureHandle/UINavigationController+GKGestureHandle.m @@ -64,15 +64,16 @@ + (void)load { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ NSArray *oriSels = @[@"viewDidLoad", + @"pushViewController:animated:", @"navigationBar:shouldPopItem:", @"dealloc"]; [oriSels enumerateObjectsUsingBlock:^(NSString * _Nonnull oriSel, NSUInteger idx, BOOL * _Nonnull stop) { - gk_gestureHandle_swizzled_instanceMethod(@"gkNav", self, oriSel, self); + gk_gestureHandle_swizzled_instanceMethod(@"gkGesture", self, oriSel, self); }]; }); } -- (void)gkNav_viewDidLoad { +- (void)gkGesture_viewDidLoad { if (self.gk_openGestureHandle) { // 处理特殊控制器 if ([self isKindOfClass:[UIImagePickerController class]]) return; @@ -88,11 +89,26 @@ - (void)gkNav_viewDidLoad { // 注册控制器属性改变通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(propertyChangeNotification:) name:GKViewControllerPropertyChangedNotification object:nil]; } - [self gkNav_viewDidLoad]; + [self gkGesture_viewDidLoad]; +} + +- (void)gkGesture_pushViewController:(UIViewController *)viewController animated:(BOOL)animated { + if (self.childViewControllers.count > 0) { + UIViewController *rootVC = self.childViewControllers.firstObject; + // 获取tabbar截图 + if (viewController.gk_systemGestureHandleDisabled && !rootVC.gk_captureImage) { + rootVC.gk_captureImage = [GKGestureConfigure getCaptureWithView:rootVC.view.window]; + } + // 设置push时是否隐藏tabbar + if (GKGestureConfigure.gk_hidesBottomBarWhenPushed && rootVC != viewController) { + viewController.hidesBottomBarWhenPushed = YES; + } + } + [self gkGesture_pushViewController:viewController animated:animated]; } // source:https://github.com/onegray/UIViewController-BackButtonHandler -- (BOOL)gkNav_navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item { +- (BOOL)gkGesture_navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item { if ([self.viewControllers count] < [navigationBar.items count]) { return YES; } @@ -119,11 +135,11 @@ - (BOOL)gkNav_navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINa return NO; } -- (void)gkNav_dealloc { +- (void)gkGesture_dealloc { if (self.gk_openGestureHandle) { [[NSNotificationCenter defaultCenter] removeObserver:self name:GKViewControllerPropertyChangedNotification object:nil]; } - [self gkNav_dealloc]; + [self gkGesture_dealloc]; } - (UIViewController *)childViewControllerForStatusBarHidden { diff --git a/Pods/GKNavigationBar/README.md b/Pods/GKNavigationBar/README.md index d3deca2..529252f 100644 --- a/Pods/GKNavigationBar/README.md +++ b/Pods/GKNavigationBar/README.md @@ -206,6 +206,8 @@ configure.shiledGuestureVCs = @[NSClassFromString(@"TZPhotoPickerController"), @ 最近更新 ``` +1.6.1 - 2021.11.08 1、修复设置gk_systemGestureHandleDisabled后TabBar偏移问题 #90 + 2、新增gk_hidesBottomBarWhenPushed,可全局配置push时是否隐藏TabBar 1.6.0 - 2021.09.09 修复visibleViewController方法返回错误问题 1.5.9 - 2021.06.25 配置类增加backgroundImage,可设置全局导航图片 1.5.8 - 2021.06.09 增加恢复系统导航栏显示的逻辑及方法 #86 diff --git a/Pods/Local Podspecs/GKPageScrollView.podspec.json b/Pods/Local Podspecs/GKPageScrollView.podspec.json index 8ad6589..928bf24 100644 --- a/Pods/Local Podspecs/GKPageScrollView.podspec.json +++ b/Pods/Local Podspecs/GKPageScrollView.podspec.json @@ -1,6 +1,6 @@ { "name": "GKPageScrollView", - "version": "1.6.6", + "version": "1.6.9", "summary": "iOS UIScrollView嵌套滑动分页视图", "homepage": "https://github.com/QuintGao/GKPageScrollView", "license": { @@ -16,7 +16,7 @@ }, "source": { "git": "https://github.com/QuintGao/GKPageScrollView.git", - "tag": "1.6.6" + "tag": "1.6.9" }, "swift_versions": "5.0", "default_subspecs": "Objc", diff --git a/Pods/Local Podspecs/GKPageSmoothView.podspec.json b/Pods/Local Podspecs/GKPageSmoothView.podspec.json index 2b2b843..08933c0 100644 --- a/Pods/Local Podspecs/GKPageSmoothView.podspec.json +++ b/Pods/Local Podspecs/GKPageSmoothView.podspec.json @@ -1,6 +1,6 @@ { "name": "GKPageSmoothView", - "version": "1.6.6", + "version": "1.6.9", "summary": "iOS UIScrollView嵌套滑动分页视图", "homepage": "https://github.com/QuintGao/GKPageScrollView", "license": { @@ -16,7 +16,7 @@ }, "source": { "git": "https://github.com/QuintGao/GKPageScrollView.git", - "tag": "1.6.6" + "tag": "1.6.9" }, "swift_versions": "5.0", "default_subspecs": "Objc", diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 219513a..6750014 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -1,18 +1,18 @@ PODS: - - GKNavigationBar (1.6.0): - - GKNavigationBar/GestureHandle (= 1.6.0) - - GKNavigationBar/NavigationBar (= 1.6.0) - - GKNavigationBar/GestureHandle (1.6.0) - - GKNavigationBar/NavigationBar (1.6.0) + - GKNavigationBar (1.6.1): + - GKNavigationBar/GestureHandle (= 1.6.1) + - GKNavigationBar/NavigationBar (= 1.6.1) + - GKNavigationBar/GestureHandle (1.6.1) + - GKNavigationBar/NavigationBar (1.6.1) - GKNavigationBarSwift (1.3.1) - - GKPageScrollView (1.6.6): - - GKPageScrollView/Objc (= 1.6.6) - - GKPageScrollView/Objc (1.6.6) - - GKPageScrollView/Swift (1.6.6) - - GKPageSmoothView (1.6.6): - - GKPageSmoothView/Objc (= 1.6.6) - - GKPageSmoothView/Objc (1.6.6) - - GKPageSmoothView/Swift (1.6.6) + - GKPageScrollView (1.6.9): + - GKPageScrollView/Objc (= 1.6.9) + - GKPageScrollView/Objc (1.6.9) + - GKPageScrollView/Swift (1.6.9) + - GKPageSmoothView (1.6.9): + - GKPageSmoothView/Objc (= 1.6.9) + - GKPageSmoothView/Objc (1.6.9) + - GKPageSmoothView/Swift (1.6.9) - JXCategoryViewExt/Core (1.1.4) - JXCategoryViewExt/Indicator/AlignmentLine (1.1.4): - JXCategoryViewExt/Indicator/Line @@ -68,10 +68,10 @@ EXTERNAL SOURCES: :path: "../GKPageScrollView" SPEC CHECKSUMS: - GKNavigationBar: 777b10cebaa1026d9aa392859c42e389895eb744 + GKNavigationBar: 4b63ee7d9337d3c1b5057fa324730a083c828fda GKNavigationBarSwift: f3d1a977b4397f43bb7e5769c92609795090edb2 - GKPageScrollView: af9750e3ac29cbceb3ec7dacfdb323b06a5f07fd - GKPageSmoothView: 2b2dbd4a71840fcab60ecee486cd6bab9003491a + GKPageScrollView: 8c3e8e9c35f1f4117bf94e5556b351917cb3df14 + GKPageSmoothView: 8eae3929aa6e6a80b1dc93f4b539f890e63b5df1 JXCategoryViewExt: 4fa0ec4d1c05e4a02c61c7c94f1059fbf06ceeca JXSegmentedView: eb1cad21f57c2543c00c3e08b8fd3c7ca54f5acd Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 diff --git a/Pods/Target Support Files/GKPageScrollView-Swift/GKPageScrollView-Swift-Info.plist b/Pods/Target Support Files/GKPageScrollView-Swift/GKPageScrollView-Swift-Info.plist index cbd8b34..df601f2 100644 --- a/Pods/Target Support Files/GKPageScrollView-Swift/GKPageScrollView-Swift-Info.plist +++ b/Pods/Target Support Files/GKPageScrollView-Swift/GKPageScrollView-Swift-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.6.6 + 1.6.9 CFBundleSignature ???? CFBundleVersion diff --git a/Pods/Target Support Files/GKPageSmoothView-Swift/GKPageSmoothView-Swift-Info.plist b/Pods/Target Support Files/GKPageSmoothView-Swift/GKPageSmoothView-Swift-Info.plist index cbd8b34..df601f2 100644 --- a/Pods/Target Support Files/GKPageSmoothView-Swift/GKPageSmoothView-Swift-Info.plist +++ b/Pods/Target Support Files/GKPageSmoothView-Swift/GKPageSmoothView-Swift-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.6.6 + 1.6.9 CFBundleSignature ???? CFBundleVersion diff --git a/README.md b/README.md index ec30d77..cde7d7c 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,9 @@ GKPageSmoothView是一个可延续滑动的UIScrollView嵌套滑动库 ## 版本更新 +* 2021.11.08 1.6.9 - 1、修复低版本xcode报错问题 #87 + 2、修复内存泄漏问题 #88 + 3、修复cell高度无法自适应问题 #89 * 2021.10.29 1.6.8 - GKSmoothView优化,修复吸顶后点击切换显示异常问题 #87 * 2021.10.20 1.6.7 - GKSmoothView frame变化优化 * 2021.10.15 1.6.6 - 优化更新,增加设置cell属性代理 #81 diff --git a/Sources/GKPageScrollView/GKPageScrollView.m b/Sources/GKPageScrollView/GKPageScrollView.m index b30e539..a05c593 100644 --- a/Sources/GKPageScrollView/GKPageScrollView.m +++ b/Sources/GKPageScrollView/GKPageScrollView.m @@ -88,7 +88,7 @@ - (void)initSubviews { self.mainTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } if (@available(iOS 15.0, *)) { - self.mainTableView.sectionHeaderTopPadding = 0; + [self.mainTableView setValue:@(0) forKey:@"sectionHeaderTopPadding"]; } [self addSubview:self.mainTableView]; [self refreshHeaderView]; diff --git a/Sources/GKPageScrollViewSwift/GKPageScrollView.swift b/Sources/GKPageScrollViewSwift/GKPageScrollView.swift index f2d3e91..eff2d6b 100644 --- a/Sources/GKPageScrollViewSwift/GKPageScrollView.swift +++ b/Sources/GKPageScrollViewSwift/GKPageScrollView.swift @@ -231,7 +231,7 @@ open class GKPageScrollView: UIView { self.mainTableView.contentInsetAdjustmentBehavior = .never } if #available(iOS 15.0, *) { - self.mainTableView.sectionHeaderTopPadding = 0 + self.mainTableView.setValue(0, forKey: "sectionHeaderTopPadding") } self.addSubview(mainTableView) self.refreshHeaderView() diff --git a/Sources/GKPageSmoothView/GKPageSmoothView.m b/Sources/GKPageSmoothView/GKPageSmoothView.m index 040372b..c802b79 100644 --- a/Sources/GKPageSmoothView/GKPageSmoothView.m +++ b/Sources/GKPageSmoothView/GKPageSmoothView.m @@ -95,8 +95,6 @@ - (void)dealloc { [self.headerView removeFromSuperview]; [self.segmentedView removeFromSuperview]; - self.listDict = nil; - self.listHeaderDict = nil; self.listCollectionView.dataSource = nil; self.listCollectionView.delegate = nil; } @@ -337,7 +335,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView { if (!self.isMainScrollDisabled) { if (!self.isOnTop) { UIScrollView *listScrollView = self.listDict[@(index)].listScrollView; - if (index != self.currentIndex && indexPercent - index == 0 && !(scrollView.isTracking || scrollView.isDecelerating) && listScrollView.contentOffset.y <= -(self.segmentedHeight + self.ceilPointHeight)) { + if (index != self.currentIndex && indexPercent - index == 0 && !(scrollView.isDragging || scrollView.isDecelerating) && listScrollView.contentOffset.y <= -(self.segmentedHeight + self.ceilPointHeight)) { [self horizontalScrollDidEndAtIndex:index]; }else { // 左右滚动的时候,把headerContainerView添加到self,达到悬浮的效果 diff --git a/Sources/GKPageSmoothViewSwift/GKPageSmoothView.swift b/Sources/GKPageSmoothViewSwift/GKPageSmoothView.swift index a309654..c07f1a9 100644 --- a/Sources/GKPageSmoothViewSwift/GKPageSmoothView.swift +++ b/Sources/GKPageSmoothViewSwift/GKPageSmoothView.swift @@ -208,8 +208,6 @@ open class GKPageSmoothView: UIView, UIGestureRecognizerDelegate { } self.headerView?.removeFromSuperview() self.segmentedView?.removeFromSuperview() - self.listDict = nil - self.listHeaderDict = nil self.listCollectionView.dataSource = nil self.listCollectionView.delegate = nil } @@ -757,11 +755,6 @@ extension GKPageSmoothView: UICollectionViewDataSource, UICollectionViewDelegate list?.listView().setNeedsLayout() let listScrollView = list?.listScrollView() - if listScrollView?.isKind(of: UITableView.self) == true { - (listScrollView as? UITableView)?.estimatedRowHeight = 0 - (listScrollView as? UITableView)?.estimatedSectionHeaderHeight = 0 - (listScrollView as? UITableView)?.estimatedSectionFooterHeight = 0 - } if #available(iOS 11.0, *) { list?.listScrollView().contentInsetAdjustmentBehavior = .never }