Skip to content

Swift component for sliding out and changing UIViewControllers easily.

License

Notifications You must be signed in to change notification settings

trafi/SlideOutable

Repository files navigation

Swift Package Manager compatible Carthage compatible

SlideOutable

Swift component for sliding content above other views easily.

Usage

From code

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)

From Interface Builder

See example project.

Installation

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"