CaseContainer is Container View Controller
CaseContainer requires iOS 9 or above and is written in Swift 4.2
CaseContainer is available through CocoaPods. To install it, simply add the following line to your podfile:
pod 'CaseContainer', '~> 0.9.0'
And run pod install
.
CaseContainer is available through Carthage. Simply install carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
add CaseContainer to your Cartfile
:
github "devmjun/CaseContainer" ~> 0.9.0
And run carthage update
.
- Create an instance of a
ParallaxTableViewController
,ParallaxCollectionViewController
orYourSomeViewController
import CaseContainer
// 1
class YourChildTableViewController: ParallaxTableViewController {
}
class YourChildTableViewController: ParallaxCollectionViewController {
}
// or 1
class YourSomeViewController: UIViewController {
}
- Create an instance of a
CaseContainerViewController
and provide it with aParallaxTableViewDelegate
if you useParallaxTableViewController
- and then provide
Appearance
toappearance
// 2
class YourContainerViewController: CaseContainerViewController {
required init() {
super.init()
let tableViewController = YourChildTableViewController()
tableViewController.title = "My Table View Controller"
tableViewController.delegate = self
let someViewController = YourSomeViewController()
someViewController.title = "My Some View Controller"
// 3
appearance = Appearance(
headerViewHegiht: 150,
tabScrollViewHeight: 50,
indicatorColor: .green,
tabButtonColor: (normal: .gray, highLight: .black))
// 4
viewContorllers = [tableViewController, someViewController]
}
}
Tells the delegate when the Container scroll view is about to start scrolling the content.
func caseContainer(
caseContainerViewController: CaseContainerViewController,
scrollViewWillBeginDragging scrollView: UIScrollView)
Tells the delegate when the user scrolls the Container content view within the receiver.
func caseContainer(
caseContainerViewController: CaseContainerViewController,
progress: CGFloat,
index: Int,
scrollViewDidScroll scrollView: UIScrollView)
Tells the delegate when dragging ended in the Container scroll view.
func caseContainer(
caseContainerViewController: CaseContainerViewController,
index: Int,
scrollViewDidEndDragging scrollView: UIScrollView)
Tells the delegate that the Container scroll view has ended decelerating the scrolling movement
func caseContainer(
caseContainerViewController: CaseContainerViewController,
index: Int,
scrollViewDidEndDecelerating scrollView: UIScrollView)
Tells the delegate when tabButton is clicked
func caseContainer(
caseContainerViewController: CaseContainerViewController,
didSelectTabButton tabButton: TabButton,
prevIndex: Int,
index: Int)
Tells the delegate When the header view is covered by the container scroll view
func caseContainer(parallaxHeader progress: CGFloat)
Bug reports, pull request and any discussion are welcome
CaseContainer is available as open source under the terms of the MIT License