All Projects → bawn → Shazam

bawn / Shazam

Licence: mit
A pure-Swift library for nested display of horizontal and vertical scrolling views

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Shazam

Aquaman
A pure-Swift library for nested display of horizontal and vertical scrolling views
Stars: ✭ 228 (+230.43%)
Mutual labels:  scrollview, page
Jxsegmentedview
A powerful and easy to use segmented view (segmentedcontrol, pagingview, pagerview, pagecontrol, categoryview) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 1,905 (+2660.87%)
Mutual labels:  scrollview, page
Hvscrollview
这不是框架,只是3个示例程序,给大家提供一个实现这种布局的思路
Stars: ✭ 584 (+746.38%)
Mutual labels:  scrollview, page
Jxpagingview
类似微博主页、简书主页等效果。多页面嵌套,既可以上下滑动,也可以左右滑动切换页面。支持HeaderView悬浮、支持下拉刷新、上拉加载更多。
Stars: ✭ 2,309 (+3246.38%)
Mutual labels:  scrollview, page
Jxpagelistview
高仿闲鱼、转转、京东、中央天气预报等主流APP列表底部分页滚动视图
Stars: ✭ 377 (+446.38%)
Mutual labels:  scrollview, page
Sppagemenu
分页菜单,功能非常齐全,满足绝大多数APP,简书地址:
Stars: ✭ 402 (+482.61%)
Mutual labels:  scrollview, page
Jxcategoryview
A powerful and easy to use category view (segmentedcontrol, segmentview, pagingview, pagerview, pagecontrol) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 5,561 (+7959.42%)
Mutual labels:  scrollview, page
Tailwind Landing Page Template
Simple Light is a free landing page template built on top of TailwindCSS and fully coded in React. Made by
Stars: ✭ 797 (+1055.07%)
Mutual labels:  page
Create Wxapp Page
创建微信小程序页面的命令行工具
Stars: ✭ 37 (-46.38%)
Mutual labels:  page
Txscrolllabelview
🌭TXScrollLabelView, the best way to show & display information such as adverts / boardcast / onsale e.g. with a customView.
Stars: ✭ 714 (+934.78%)
Mutual labels:  scrollview
Vue Page Designer
Vue component for drag-and-drop to design and build mobile website.
Stars: ✭ 702 (+917.39%)
Mutual labels:  page
Parallaxheader
Simple way to add parallax header to UIScrollView/UITableView written in Swift.
Stars: ✭ 808 (+1071.01%)
Mutual labels:  scrollview
Ultimate Page Builder
📦 Ultimate Page Builder for WordPress
Stars: ✭ 39 (-43.48%)
Mutual labels:  page
Liquidswipe
Android LiquidSwipe Library
Stars: ✭ 721 (+944.93%)
Mutual labels:  page
Ynpageviewcontroller
特斯拉组件、QQ联系人布局、多页面嵌套滚动、悬停效果、美团、淘宝、京东、微博、腾讯新闻、网易新闻、今日头条等标题滚动视图
Stars: ✭ 1,067 (+1446.38%)
Mutual labels:  scrollview
Tysnapshotscroll
一句代码保存截图,将 UIScrollView UITableView UICollectionView UIWebView WKWebView 网页 保存 为 长图 查看。Save the scroll view page as an image,support UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView.(Support iOS13)
Stars: ✭ 709 (+927.54%)
Mutual labels:  scrollview
Hybridpagekit
A high-performance、high-extensibility、easy integration framework for Hybrid content page. Support most content page types of News App.
Stars: ✭ 1,101 (+1495.65%)
Mutual labels:  scrollview
Frontend Mentor Challenge
Here you will find all the challenges that we took from frontend-mentor.
Stars: ✭ 47 (-31.88%)
Mutual labels:  page
Smkcyclescrollview
SMKCycleScrollView - An awesome advertisement cycleScrollView
Stars: ✭ 11 (-84.06%)
Mutual labels:  scrollview
Rsdayflow
iOS 7+ Calendar (Date Picker) with Infinite Scrolling.
Stars: ✭ 843 (+1121.74%)
Mutual labels:  scrollview

Shazam

License MIT Pod version Platform info Support Swift 4.2

A pure-Swift library for nested display of horizontal and vertical scrolling views.

demo

Requirements

  • iOS 9.0+
  • Swift 4.2+
  • Xcode 10+

Installation

CocoaPods (recommended)

use_frameworks!

pod 'Shazam'

Usage

中文文档

First make sure to import the framework:

import Shazam

Basically, we just need to provide the list of child view controllers to show. Then call some necessary methods.

Let's see the steps to do this:

Create a ShazamPageViewController subclass

import Shazam

class PageViewController: ShazamPageViewController {
  // ...
}

Provide the view controllers that will appear embedded into the ShazamPageViewController

override func numberOfViewControllers(in pageController: ShazamPageViewController) -> Int {
    return count
}
    
override func pageController(_ pageController: ShazamPageViewController, viewControllerAt index: Int) -> (UIViewController & ShazamChildViewController) {
    // ...
    return viewController
}
    

Every UIViewController that will appear within the ShazamPageViewController should conform to ShazamChildViewController by implementing func shazamChildScrollView() -> UIScrollView

import Shazam
class ChildViewController: UIViewController, ShazamChildViewController {

    @IBOutlet weak var tableView: UITableView!
    func shazamChildScrollView() -> UIScrollView {
        return tableView
    }
    // ...
}

Note: The scrollview of ChildViewController must reserve the height of headerView + menuView at the top. For example, in BatmanViewController in Demo, you need to set the height of Header of collectionView.

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
        guard let pageViewContoller = szPageViewContoller else {
            return .zero
        }
        let headerViewHeight = pageViewContoller.headerViewHeightFor(pageViewContoller)
        let menuViewHeight = pageViewContoller.menuViewHeightFor(pageViewContoller)
        return CGSize(width: collectionView.bounds.width, height: headerViewHeight + menuViewHeight)
    }

Provide the headerView and headerView height

override func headerViewFor(_ pageController: ShazamPageViewController) -> UIView & ShazamHeaderView {
    return HeaderView()
}

override func headerViewHeightFor(_ pageController: ShazamPageViewController) -> CGFloat {
    return headerViewHeight
}

The headerView should conform to ShazamHeaderView by implementing func userInteractionViews() -> [UIView]?

func userInteractionViews() -> [UIView]? {
    return [button]
}

Provide the menuView and menuView height

override func menuViewFor(_ pageController: ShazamPageViewController) -> UIView {
    return menuView
}

override func menuViewHeightFor(_ pageController: ShazamPageViewController) -> CGFloat {
    return menuViewHeight
}

Update menuView's layout when main scroll view did scroll and check state when did end scoll

override func pageController(_ pageController: ShazamPageViewController, mainScrollViewDidScroll scrollView: UIScrollView) {
    menuView.updateLayout(scrollView)
}

override func pageController(_ pageController: ShazamPageViewController,
                                 mainScrollViewDidEndScroll scrollView: UIScrollView) {
    menuView.checkState()
}

Examples

Follow these 4 steps to run Example project:

  1. Clone Shazam repository
  2. Run the pod install command
  3. Open Shazam workspace
  4. Run the Shazam-Demo project.

License

Shazam 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].