bawn / Aquaman
Licence: mit
A pure-Swift library for nested display of horizontal and vertical scrolling views
Stars: ✭ 228
Programming Languages
swift
15916 projects
Projects that are alternatives of or similar to Aquaman
Jxpagelistview
高仿闲鱼、转转、京东、中央天气预报等主流APP列表底部分页滚动视图
Stars: ✭ 377 (+65.35%)
Mutual labels: scrollview, page
Jxsegmentedview
A powerful and easy to use segmented view (segmentedcontrol, pagingview, pagerview, pagecontrol, categoryview) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 1,905 (+735.53%)
Mutual labels: scrollview, page
Jxcategoryview
A powerful and easy to use category view (segmentedcontrol, segmentview, pagingview, pagerview, pagecontrol) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 5,561 (+2339.04%)
Mutual labels: scrollview, page
Shazam
A pure-Swift library for nested display of horizontal and vertical scrolling views
Stars: ✭ 69 (-69.74%)
Mutual labels: scrollview, page
Jxpagingview
类似微博主页、简书主页等效果。多页面嵌套,既可以上下滑动,也可以左右滑动切换页面。支持HeaderView悬浮、支持下拉刷新、上拉加载更多。
Stars: ✭ 2,309 (+912.72%)
Mutual labels: scrollview, page
Nginx Error Pages
Cute Error Pages for your nginx web server
Stars: ✭ 166 (-27.19%)
Mutual labels: page
Letteravatarkit
📦 An extension that generates letter-based avatars/placeholders
Stars: ✭ 180 (-21.05%)
Mutual labels: swift-framework
Unitydynamicscrollrect
An optimized approach to lists with dozens of elements and a Pooling system
Stars: ✭ 157 (-31.14%)
Mutual labels: scrollview
Simplycoreaudio
A Swift framework that aims to make Core Audio use less tedious in macOS
Stars: ✭ 167 (-26.75%)
Mutual labels: swift-framework
Sonatapagebundle
This bundle provides a Site and Page management through container and block services
Stars: ✭ 181 (-20.61%)
Mutual labels: page
Shift
Animate gradient changes with time or motion for iOS Swift
Stars: ✭ 165 (-27.63%)
Mutual labels: swift-framework
Perfect
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)
Stars: ✭ 13,890 (+5992.11%)
Mutual labels: swift-framework
Llsegmentviewcontroller
可添加header的多控制器列表,主流APP分类切换滚动视图(京东,网易新闻,爱奇艺,QQ弹性小球等,可高度自定义,项目结构清晰);UIScrollView 嵌套,可做个人详情页,商品详情页,页面多tableView滑动悬停
Stars: ✭ 176 (-22.81%)
Mutual labels: page
Notautolayout
Layout your views without Auto Layout constraints, in a much more swifty way.
Stars: ✭ 171 (-25%)
Mutual labels: swift-framework
Aquaman
类似于淘票票首页,抖音、简书个人主页的嵌套滚动库
Requirements
- iOS 9.0+
- Swift 4.2+
- Xcode 10+
Installation
CocoaPods (recommended)
use_frameworks!
pod 'Aquaman'
Usage
首先需要导入 Aquaman
import Aquaman
创建 AquamanPageViewController 子类
import Aquaman
class PageViewController: AquamanPageViewController {
// ...
}
重写以下协议方法以提供 viewController 和相应的数量
override func numberOfViewControllers(in pageController: AquamanPageViewController) -> Int {
return count
}
override func pageController(_ pageController: AquamanPageViewController, viewControllerAt index: Int) -> (UIViewController & AquamanChildViewController) {
// ...
return viewController
}
注意: 所提供的 viewController 必须都遵守 AquamanChildViewController
协议,并实现 func aquamanChildScrollView() -> UIScrollView
方法
import Aquaman
class ChildViewController: UIViewController, AquamanChildViewController {
@IBOutlet weak var tableView: UITableView!
func aquamanChildScrollView() -> UIScrollView {
return tableView
}
// ...
}
重写以下协议方法以提供 headerView 及其高度
override func headerViewFor(_ pageController: AquamanPageViewController) -> UIView {
return HeaderView()
}
override func headerViewHeightFor(_ pageController: AquamanPageViewController) -> CGFloat {
return headerViewHeight
}
重写以下协议方法以提供 menuView 及其高度
override func menuViewFor(_ pageController: AquamanPageViewController) -> UIView {
return menuView
}
override func menuViewHeightFor(_ pageController: AquamanPageViewController) -> CGFloat {
return menuViewHeight
}
Aquaman 采用的是 menuView 和主体功能分离的设计,以满足 menuView 有时候需要深度定制的需求,所以 menuView 需要开发者自己实现,当然这里也提供了现成的 menuView 库:Trident
更新 menuView 的布局
override func pageController(_ pageController: AquamanPageViewController, contentScrollViewDidScroll scrollView: UIScrollView) {
menuView.updateLayout(scrollView)
}
override func pageController(_ pageController: AquamanPageViewController, didDisplay viewController: (UIViewController & AquamanChildViewController), forItemAt index: Int) {
menuView.checkState(animation: true)
}
由于 menuView 和 pageController 不存在强关联关系,所以在滚动的时候需要更新 menuView 布局,在显示相应的 viewController 的时候需要检查 menuView 的状态,具体参考 demo
Examples
Follow these 4 steps to run Example project:
- Clone Aquaman repository
- Run the
pod install
command - Open Aquaman workspace
- Run the Aquaman-Demo project.
License
Aquaman is released under the MIT license. See LICENSE for details.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].