ScrollableTabController is tab based ContainerViewController with shrinkable and expandable upper content area.
iOS10+
let scrollableTabController = ScrollableTabController()
scrollableTabController.viewControllers = [
someScrollableViewController1,
someScrollableViewController2
]
scrollableTabController.upperContentViewController = someContentViewController
There're some restrictions to use it properly.
- 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.
- 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
github "speee/ScrollableTabController"
Welcome!!