管理UIScrollView嵌套滑动的一个小组件Swift版。 通过KVO实现,无UI布局,低耦合。
Objective-C版本->XMixScrollManager
- 支持滑动进度条可选择是否显示;
- 支持嵌套主次UIScrollView可选择是否允许下拉;
- 支持点击状态栏可选择主次UIScrollView回到顶部;
- 支持主次UIScrollView滑动过渡可选择惯性模拟移动。
简单使用
scrollManager = XMixScrollManager(scrollView: scrollView, contentScrollViews: [contentScrollView1,contentScrollView2])
scrollManager.contentScrollDistance = CGFloat(300)
XMixScrollManager不关注UI布局,contentScrollDistance需要传入准确的值。 其他可选属性的使用可见demo。
- 在 Podfile 中添加
pod 'XMixScrollManager_swift'
。 - 执行
pod install
或pod update
。
依次点击 Xcode 的菜单 File > Swift Packages > Add Package Dependency,填入 https://github.com/xing3523/XMixScrollManager_swift
iOS 9.0+
A widget Swift version that manages nested sliding of UIScrollView. Implemented through KVO, no UI layout, low coupling.
- Support sliding progress bar to choose whether to display or not;
- Support nested primary and secondary UIScrollView to choose whether to allow drop-down;
- Support clicking on the status bar to select the primary and secondary UIScrollView back to the top;
- Support primary and secondary UIScrollView sliding transition to select inertial simulation movement.
Simple to use
scrollManager = XMixScrollManager(scrollView: scrollView, contentScrollViews: [contentScrollView1,contentScrollView2])
scrollManager.contentScrollDistance = CGFloat(300)
XMixScrollManager does not pay attention to UI layout, contentScrollDistance needs to pass in accurate values. The use of other optional properties can be seen in the demo.
- Add
pod 'XMixScrollManager_swift'
to the Podfile. - Execute
pod install
orpod update
.
Click Xcode's menu File > Swift Packages > Add Package Dependency, fill in https://github.com/xing3523/XMixScrollManager_swift
iOS 9.0+