CubicCube
CubicCube copied to clipboard
CubicCube is a Swift GUI library for embedding view controllers on faces of cube (well, technically it's a parallelepiped, but we'll call it a cube)

CubicCube is a Swift GUI library for embedding view controllers on faces of cube (well, technically it's a parallelepiped, but we'll call it a cube)
Installation
Manual
Just clone and add CubicViewController.swift to your project.
Carthage
touch Cartfilenano Cartfile- put
github "peterprokop/CubicCube"into Cartfile - Save it:
ctrl-x,y,enter - Run
carthage update - Copy
CubicCube.frameworkfromCarthage/Build/iOSto your project - Make sure that
CubicCubeis added inEmbedded Binariessection of your target (or else you will getdyld library not loaded referenced from ... reason image not founderror) - Add
import CubicCubeon top of your view controller's code
Cocoapods
Stop using this piece of crap. Seriously.
Requirements
- Xcode 9.4.1+
- Swift 4.1
Usage
Minimal working example is following:
import CubicCube
class ViewController: CubicViewController {
required init(coder aDecoder: NSCoder) {
let makeViewController = { (color: UIColor) -> UIViewController in
let vc = UIViewController()
vc.view.backgroundColor = color
return vc
}
super.init(
firstViewController: makeViewController(.red),
secondViewController: makeViewController(.green),
thirdViewController: makeViewController(.purple),
fourthViewController: makeViewController(.orange)
)
}
}
Also please check example project in the repo.