{"id":21013855,"url":"https://github.com/pyro2927/gklcubeviewcontroller","last_synced_at":"2025-05-15T04:34:38.744Z","repository":{"id":5700198,"uuid":"6910792","full_name":"pyro2927/GKLCubeViewController","owner":"pyro2927","description":"Cube-ular view controller that can be rotated by a pan gesture","archived":false,"fork":false,"pushed_at":"2013-07-24T02:12:30.000Z","size":2115,"stargazers_count":70,"open_issues_count":5,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-12T16:17:41.756Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyro2927.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-28T21:59:32.000Z","updated_at":"2024-05-31T23:27:32.000Z","dependencies_parsed_at":"2022-07-07T11:02:48.913Z","dependency_job_id":null,"html_url":"https://github.com/pyro2927/GKLCubeViewController","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyro2927%2FGKLCubeViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyro2927%2FGKLCubeViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyro2927%2FGKLCubeViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyro2927%2FGKLCubeViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyro2927","download_url":"https://codeload.github.com/pyro2927/GKLCubeViewController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254274693,"owners_count":22043568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T09:44:21.547Z","updated_at":"2025-05-15T04:34:38.398Z","avatar_url":"https://github.com/pyro2927.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"GKLCubeViewController\n===================\n\n### Introduction\n\nThis project was originally started as a UI proof-of-concept at [GoKart Labs](http://gokartlabs.com/), which is where the `GKL` prefix comes from. The project was scrapped, and I decided to release the code so it wouldn't be wasted.\n\nThis is custom container controller that lets you navigate through a series of child view controllers represented as sides of a cube that you swipe/pan to rotate to navigate from one view to another. This is a simplied user interface rendition of the user interface popularized by the [WeatherCube](http://www.weathercube.com) app (except this rotates the entire view, not just a portion of a view).\n\n### How To Use\n\n#### Installation\n\n##### Hard way\nCopy `GKLCubeViewController.h` and `GKLCubeViewController.m` to your project. Add `QuartzCore.framework` to your project. See [Linking to a Library or Framework](http://developer.apple.com/library/ios/#recipes/xcode_help-project_editor/Articles/AddingaLibrarytoaTarget.html).\n\n##### Easy way\nUse [CocoaPods](http://cocoapods.org/): `pod 'GKLCubeViewController', :git =\u003e \"https://github.com/pyro2927/GKLCubeViewController.git\"`\n\n#### Code\n\n2. Initialize an instance of `GKLCubeViewController`. You could simply create an instance of it in your app delegate:\n\n    \tGKLCubeViewController *cubeViewController = [[GKLCubeViewController alloc] initWithNibName:nil bundle:nil];\n        \n Or, as this demonstration does, you could create your own subclass of `GKLCubeViewController` and use that in your storyboard/NIB.\n\t\n3. Add the child view controllers representing the four sides of the cube:\n\n        [cubeViewController addCubeSideForChildController:childController];\n\n For example, this demonstration implementation creates four blank view controllers in `DemonstrationViewController.m`:\n\n        - (void)viewDidLoad\n        {\n            [super viewDidLoad];\n\n            [self configureDemonstrationChildViewControllers];\n        }\n\n        - (void)configureDemonstrationChildViewControllers\n        {\n            UIViewController *controller;\n            \n            controller = [self.storyboard instantiateViewControllerWithIdentifier:@\"child1\"];\n            [self addCubeSideForChildController:controller];\n            \n            controller = [self.storyboard instantiateViewControllerWithIdentifier:@\"child2\"];\n            [self addCubeSideForChildController:controller];\n            \n            controller = [self.storyboard instantiateViewControllerWithIdentifier:@\"child3\"];\n            [self addCubeSideForChildController:controller];\n            \n            controller = [self.storyboard instantiateViewControllerWithIdentifier:@\"child4\"];\n            [self addCubeSideForChildController:controller];\n        }\n        \n4. If needed, child view controllers can conform to the `GKLCubeViewControllerDelegate` protocol and implement either `cubeViewDidUnhide` or `cubeViewDidHide` to be notified as the view appears. Note, as you start to rotate a controller into view, you may see these methods be called a little before you can actually see the view (because of perspective, the front of the cube will continue to obscure the side for a bit).\n\nAnd that's it! You can start spinning your view cube (OK, I guess technically it's a rectangular prism) by sliding your finger left/right on the app.\n\nThis demonstration project uses four random scenes from a storyboard. In this case, they:\n\n- The first is largely blank;\n- The second has a table view populated by `ChildTwoViewController`;\n- The third uses a `NSTimer` to update the time (and illustrates the use of `GKLCubeViewControllerDelegate` protocol in `ChildThreeViewController`); and\n- The fourth simply draws a circle on the view (in `ChildFourViewController`).\n\n### Change history\n\n23 July 2013. Updating README, adding in Podspec\n\n20 July 2013. Robert M. Ryan. Addressing a number of issues:\n\n1. There was a serious performance penalty resulting from using a `CATransformLayer` in conjunction with views that already had `transform` properties on their layers. When performing gesture, it was very sluggish.\n\n2. Also added the necessary view controller containment calls.\n\n3. Modified to handle \"flick\".\n\n4. Only perform transforms on the two visible sides of the cube (since only two are visible at any given time) and hide the others.\n\n5. Add `GKLCubeViewControllerDelegate` protocol. If the child controllers implement `cubeViewDidHide` and/or `cubeViewDidUnhide`, that will be called as the view rotates out of view and back into view.\n\n In the demonstration project, the third child view controller employs this protocol to identify when to start and stop a repeating timer.\n\n28 November 2012. [pyro2927](https://github.com/pyro2927). Created, inspired by [augustjoki](https://github.com/augustjoki)'s original [CubeTabBarController](https://github.com/augustjoki/CubeTabBarController)\n\n### Known limitations\n\nThis expects four child view controllers. It won't work if you have more than four, and you'll see a \"blank\" side of the cube if you have less than that.  We are [working on supporting](https://github.com/pyro2927/GKLCubeViewController/tree/non-cube-support) an arbitrary number of sides.\n\n### Example\n\n![](https://raw.github.com/pyro2927/GKLCubeViewController/master/cube.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyro2927%2Fgklcubeviewcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyro2927%2Fgklcubeviewcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyro2927%2Fgklcubeviewcontroller/lists"}