CocoaPods trunk is moving to be read-only. Read more on the blog, there are 10 months to go.

KBScrollMagic 1.0.0

KBScrollMagic 1.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by liyang.



  • By
  • liuxingqipan

KBScrollMagic

KBScrollMagic is a solution for the gesture conflict between multiple scrollView when we have some scrollViews or tableViews that added to a superview that is also scrollView. Easy to use!

ScrollView嵌套时,相同方向时的手势冲突的解决方案

gif picture

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 8 +
  • Xcode 8
  • Swift 3

Installation

KBScrollMagic is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "KBScrollMagic"

Usage

easy use!

call the follow code at your scrollView that it’s a subview of another scrollView

// superScrollView: 外层的ScrollView
// insetY: 上边部分的高度
// delegate: SuperScrollView有下拉刷新时,建议实现此代理

tableView.kbs.set(superScrollView: <UIScrollView>, insetY: <CGFloat>, delegate: <KBScrollMagicDelegate>)

OR

tableView.kbs.setSuperScrollView(<UIScrollView>)
tableView.kbs.setinsetY(<CGFloat>)

if the SuperScrollView need to PullToRefresh, implement the following code SuperScrollView有下拉刷新时,建议实现此代理

tableView.kbs.setDelegate(<KBScrollMagicDelegate>)

//protocol KBScrollMagicDelegate
func scrollMagicDidEndDrag(when superScrollView: UIScrollView, offSetY: CGFloat){
    // call the RefreshCode
}

Author

Kirito, [email protected]

License

KBScrollMagic is available under the MIT license. See the LICENSE file for more info.