CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.
TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Dec 2017 |
SwiftSwift Version | 4.0 |
SPMSupports SPM | ✗ |
Maintained by Kevin Malkic.
MKCubeController is used to create a rotating 3D cube navigation in Swift 2.1. (translated from @nicklockwood CubeController) here the link https://github.com/nicklockwood/CubeController Pretty much the same logic.
Pretty easy !
let controller = MKCubeViewController()
controller.dataSource = self
controller.wrapEnabled = true
And implement MKCubeViewControllerDataSource
func numberOfViewControllersInCubeController(cubeController: MKCubeViewController) -> Int {
return 3
}
func cubeController(cubeController: MKCubeViewController, viewControllerAtIndex index: Int) -> UIViewController {
switch index % 3 {
case 0:
return ViewController(nibName: "RedViewController", bundle: nil)
case 1:
return ViewController(nibName: "GreenViewController", bundle: nil)
case 2:
return ViewController(nibName: "BlueViewController", bundle: nil)
default:
break
}
return ViewController()
}
Embedded frameworks require a minimum deployment target of iOS 8.
cd
into your top-level project directory, and run the following command “if” your project is not initialized as a git repository:$ git init
$ git submodule add https://github.com/kmalkic/MKCubeController.git
Open the new MKCubeController
folder, and drag the MKCubeController.xcodeproj
into the Project Navigator of your application’s Xcode project.
It should appear nested underneath your application’s blue project icon. Whether it is above or below all the other Xcode groups does not matter.
Select the MKCubeController.xcodeproj
in the Project Navigator and verify the deployment target matches that of your application target.
+
button under the “Embedded Binaries” section.You will see two different MKCubeController.xcodeproj
folders each with two different versions of the MKCubeController.framework
nested inside a Products
folder.
It does not matter which
Products
folder you choose from, but it does matter whether you choose the top or bottomMKCubeController.framework
.
And that’s it!
The
MKCubeController.framework
is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.
Kevin Malkic
MKCubeController is released under the MIT license. See LICENSE for details.