Swift component for sliding content above other views easily.
As with any other view do these 3 steps:
let scroll = UITableView()
let header = UIView()
header.frame.size.height = 50 // header's `frame.size.height` should be set.
// `scroll` and `header` will be added and layed out inside `SlideOutable` instance.
// 1. Initialize
let slideOutable = SlideOutable(scroll: scroll, header: header)
// 2. Layout
slideOutable.frame = view.bounds
slideOutable.autoresizingMask = [.flexibleWidth, .flexibleHeight] // Or use constraints
// 3. Add to view hierarchy
view.addSubview(slideOutable)
See example project.
Open your project in Xcode and select File > Swift Packages > Add Package Dependency. There enter https://github.com/trafi/SlideOutable
as the repository URL.
Using Carthage. Add the following line to your Cartfile:
github "Trafi/SlideOutable"