{"id":2638,"url":"https://github.com/anatoliyv/RevealMenuController","last_synced_at":"2025-08-03T00:32:19.406Z","repository":{"id":62452942,"uuid":"67118999","full_name":"anatoliyv/RevealMenuController","owner":"anatoliyv","description":"Menu controller with expandable item groups, custom position and appearance animation written with Swift. Similar to ActionSheet style of UIAlertController.","archived":false,"fork":false,"pushed_at":"2018-12-24T15:07:10.000Z","size":5984,"stargazers_count":23,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-24T17:12:07.219Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anatoliyv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-01T09:45:56.000Z","updated_at":"2023-04-24T07:38:44.000Z","dependencies_parsed_at":"2022-11-01T22:46:35.741Z","dependency_job_id":null,"html_url":"https://github.com/anatoliyv/RevealMenuController","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anatoliyv%2FRevealMenuController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anatoliyv%2FRevealMenuController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anatoliyv%2FRevealMenuController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anatoliyv%2FRevealMenuController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anatoliyv","download_url":"https://codeload.github.com/anatoliyv/RevealMenuController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510760,"owners_count":17931760,"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-01-05T20:16:18.965Z","updated_at":"2024-12-06T18:30:39.894Z","avatar_url":"https://github.com/anatoliyv.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["Menu","Layout","Other free courses"],"readme":"![RevealMenuController](https://cloud.githubusercontent.com/assets/1595032/18164385/37484428-7048-11e6-924d-2509b7d56131.png)\n\n![RevealMenuController](https://travis-ci.org/anatoliyv/RevealMenuController.svg?branch=master)\n[![Version](https://img.shields.io/cocoapods/v/RevealMenuController.svg?style=flat)](http://cocoapods.org/pods/RevealMenuController)\n[![License](https://img.shields.io/cocoapods/l/RevealMenuController.svg?style=flat)](http://cocoapods.org/pods/RevealMenuController)\n[![Platform](https://img.shields.io/cocoapods/p/RevealMenuController.svg?style=flat)](http://cocoapods.org/pods/RevealMenuController)\n![](https://img.shields.io/badge/Supported-iOS9-4BC51D.svg?style=flat)\n\nEasy to implement controller with expanding menu items. Design is very similar to iOS native ActionSheet presentation style of a UIAlertController. As an additional feature you can set small image icon beside menu item text. Take a look at example screenshot to see all available features.\n\nFeatures:\n- [x] Expandable menu groups\n- [x] Custom presentation position (top, center or bottom)\n- [x] Custom text alignment\n- [x] Menu items can have images\n\nHere are few screenshot with possible usage. I've added a [small video](https://github.com/anatoliyv/RevealMenuController/blob/master/Example/ExampleVideo.mov?raw=true) (~5Mb) also where you can see live example without installation and launching demo project.\n\n![RevealMenuController](https://cloud.githubusercontent.com/assets/1595032/18165230/bf610d0a-704c-11e6-860d-747a4002fc1b.png)\n\n## Installation\n\n#### CocoaPods\n\nRevealMenuController is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"RevealMenuController\"\n```\n\n#### Cartage\n\nSupport will be added in version 1.0\n\n## Usage\n\nInitialize `RevealMenuController` and set required properties:\n\n```swift\nlet revealController = RevealMenuController(title: \"Contact Support\", position: .Center)\nrevealController.displayCancel = true           // Display Cancel menu item\nrevealController.hideOnBackgorundTap = true     // Hide menu when user taps outside of items area\nrevealController.statusBarStyle = .LightContent // Status bar style\n```\n\nNow you can add actions to menu. Take a look at `image` property: this menu item will have small icon places beside a text.\n\n```swift\nlet webImage = UIImage(named: \"IconHome\")\nlet webAction = RevealMenuAction(title: \"Open web page\", image: webImage, handler: { (controller, action) in\n    // Code to support tap on this item\n})\nrevealController.addAction(webAction)\n```\n\nAdding of action groups is very similar:\n\n```swift\nlet emailImage = UIImage(named: \"IconEmail\")\nlet phoneImage = UIImage(named: \"IconCall\")\nlet techGroup = RevealMenuActionGroup(title: \"Contact support\", actions: [\n    RevealMenuAction(title: \"tech.support@apple.com\", image: emailImage, handler: { (controller, action) in\n        // Code to support tap on this item\n    }),\n    RevealMenuAction(title: \"1-866-752-7753\", image: phoneImage, handler: { (controller, action) in\n        // Code to support tap on this item\n    })\n])\nrevealController.addAction(techGroup)\n```\n\nWhen you're ready to present controller call:\n\n```swift\nrevealController.displayOnController(self)\n```\n\nAppearance animation depends on it's position:\n\n- Top: Controller appearance will have top-to-bottom slide animation.\n- Center: Appearance with fade-in animation\n- Bottom: Appearance with bottom-to-top slide animation.\n\nDisappearance will have reverse animation.\n\n#### Dismissing\n\nTo dismiss `RevealMenuController` call next method. Collapse animation will be reversed to appearance one.\n\n```swift\ncontroller.dismissViewControllerAnimated(true, completion: {\n    // Completion block\n})\n```\n\n#### RevealMenuAction\n\nRevealMenuAction can be initialized in few ways. Title is always required for action. Image is an optional value. Default text alignment is `Center`. Handler is also not required but if you will not specify this property there will be no response for user tap on this item.\n\nList of initializers:\n\n```swift\ninit(title: String, image: UIImage?, alignment: NSTextAlignment, handler: RevealControllerHandler?)\ninit(title: String, image: UIImage?, handler: RevealControllerHandler?)\ninit(title: String, alignment: NSTextAlignment, handler: RevealControllerHandler?)\ninit(title: String, handler: RevealControllerHandler?)\n```\n\n#### RevealMenuActionGroup\n\nAction groups will keep few `RevealMenuAction`s inside. When user press on such menu item group will expand and show list of available actions. Second tap will collapse actions list.\n\nTitle is also required for action group. It can have it's own icon image and text alignment, similar to `RevealMenuAction`. The only difference is that group has no tap handler but actions array instead of it.\n\nList of initializers:\n\n```swift\ninit(title: String, image: UIImage?, alignment: NSTextAlignment, actions: [RevealMenuAction])\ninit(title: String, alignment: NSTextAlignment, actions: [RevealMenuAction])\ninit(title: String, image: UIImage, actions: [RevealMenuAction])\ninit(title: String, actions: [RevealMenuAction])\n```\n\n## TODO\n\n- [ ] Custom sizes for iPad\n- [ ] Menu item labels customization (font, color)\n- [ ] Implement menu title\n- [ ] Support for multiline items\n\nWrite me or make a pull request if you have any ideas what else functionality could be useful for `RevealMenuController`.\n\n## Author\n\n- anatoliy.voropay@gmail.com\n- [@anatoliy_v](https://twitter.com/anatoliy_v)\n- [LinkedIn](https://www.linkedin.com/in/anatoliyvoropay)\n\n## License\n\n`RevealMenuController` is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanatoliyv%2FRevealMenuController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanatoliyv%2FRevealMenuController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanatoliyv%2FRevealMenuController/lists"}