Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

ScrollableTabController is tab based ContainerViewController with shrink-able upper content area.

License

Notifications You must be signed in to change notification settings

speee/ScrollableTabController

Repository files navigation

ScrollableTabController

MIT License Carthage compatible

ScrollableTabController is tab based ContainerViewController with shrinkable and expandable upper content area.

Demo

Requirement

iOS10+

Usage

Instantiation by code

let scrollableTabController = ScrollableTabController()

scrollableTabController.viewControllers = [
someScrollableViewController1,
someScrollableViewController2
]
scrollableTabController.upperContentViewController = someContentViewController

Restrictions for ContentViewControllers

There're some restrictions to use it properly.

UpperContentViewController

  • UpperContentViewController.view has to define its height with 900 to 950 constraints priority.
  • First, ScrollableTabController observes the height and set it as default height(the upper content height when the scrollable area is not scrolled).
  • Then when the user scrolls, the upper content area shrinks / expands,
  • The default view height(the height when the scrollable area is not scrolled) should be fixed when viewDidLoad is called. Changing the height is not supported.
  • If you want to allow users to scroll over upper content area, consider using TouchTransparentView that passes touch events to views below it.

ScrollableViewController

  • It has to conform to Scrollable protocol to make ScrollableTabController can observe scrolling.
  • Its scrollView.contentSize.height must not be smaller than scrollView.frame.height. If the contentSize.height is too small, the upper content area can't shrink. See the screenshot below.

  • priority 900 - 950
  • conflicting xx to achieve
  • example

Installation

Carthage

github "speee/ScrollableTabController"

Contribution

Welcome!!

Licence

MIT

Author

Mitsuyoshi Yamazaki

About

ScrollableTabController is tab based ContainerViewController with shrink-able upper content area.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published