{"id":2437,"url":"https://github.com/ntnhon/MaterialActionSheetController","last_synced_at":"2025-08-02T23:33:41.400Z","repository":{"id":62447611,"uuid":"65991606","full_name":"ntnhon/MaterialActionSheetController","owner":"ntnhon","description":"A Google like action sheet for iOS written in Swift.","archived":false,"fork":false,"pushed_at":"2019-07-29T12:52:25.000Z","size":2766,"stargazers_count":103,"open_issues_count":3,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-18T04:43:36.507Z","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/ntnhon.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-08-18T11:25:46.000Z","updated_at":"2023-10-13T13:15:00.000Z","dependencies_parsed_at":"2022-11-01T23:06:30.114Z","dependency_job_id":null,"html_url":"https://github.com/ntnhon/MaterialActionSheetController","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntnhon%2FMaterialActionSheetController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntnhon%2FMaterialActionSheetController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntnhon%2FMaterialActionSheetController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntnhon%2FMaterialActionSheetController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntnhon","download_url":"https://codeload.github.com/ntnhon/MaterialActionSheetController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503219,"owners_count":17930542,"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:13.769Z","updated_at":"2024-12-06T17:31:06.583Z","avatar_url":"https://github.com/ntnhon.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["Alert \u0026 Action Sheet","Other free courses"],"readme":"# MaterialActionSheetController\nLightweight and totally customizable. Create and present it the way you do with UIAlertController.\n\n\u003c!--[![CI Status](http://img.shields.io/travis/Thanh-Nhon Nguyen/MaterialActionSheetController.svg?style=flat)](https://travis-ci.org/Thanh-Nhon Nguyen/MaterialActionSheetController)--\u003e\n[![Version](https://img.shields.io/cocoapods/v/MaterialActionSheetController.svg?style=flat)](http://cocoapods.org/pods/MaterialActionSheetController)\n[![License](https://img.shields.io/cocoapods/l/MaterialActionSheetController.svg?style=flat)](http://cocoapods.org/pods/MaterialActionSheetController)\n[![Platform](https://img.shields.io/cocoapods/p/MaterialActionSheetController.svg?style=flat)](http://cocoapods.org/pods/MaterialActionSheetController)\n\n## Screenshots\n- Demo \u003cbr/\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/ntnhon/MaterialActionSheetController/6f438d03c118c8e19bac792bdeef9383f0991e67/Screenshots/Demo.gif\" width=\"300\"\u003e\n\n| Default light theme | Dark theme | Custom header |\n|---|---|---|---|---|\n| \u003cimg src=\"https://raw.githubusercontent.com/ntnhon/MaterialActionSheetController/6f438d03c118c8e19bac792bdeef9383f0991e67/Screenshots/Full_option_light.png\" width=\"250\"\u003e | \u003cimg src=\"https://raw.githubusercontent.com/ntnhon/MaterialActionSheetController/6f438d03c118c8e19bac792bdeef9383f0991e67/Screenshots/Full_option_dark.png\" width=\"250\"\u003e | \u003cimg src=\"https://raw.githubusercontent.com/ntnhon/MaterialActionSheetController/6f438d03c118c8e19bac792bdeef9383f0991e67/Screenshots/Custom_header_light.png\" width=\"250\"\u003e |\n\n## Features\n- [x] Using closures to configure actions\n- [x] Action with optional icon and accessory view\n- [x] Handling touch on accessory view\n- [x] Separate long action list in sections\n- [x] Using closures to callback when controller is about to dismiss\n- [x] 2 built-in themes: light \u0026 dark\n- [x] Customizable header\n- [x] Swift 3 compliant\n\n## Todos\n\n- Present on iPad as a pop-up\n- Documenting\n\n## Requirements\n\n- iOS 8.0+\n- Xcode 8\n- Swift 3\n\n## Installation\n\n#### CocoaPods\nMaterialActionSheetController is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:\n\n```ruby\npod 'MaterialActionSheetController'\n```\n\n#### Manually\n\nAdd `MaterialActionSheetController.swift` to your project\n\n## Usage\n\n```swift\n// Import MaterialActionSheetController if you're using CocoaPods\nimport MaterialActionSheetController\n```\n```swift\n// Create an action\nlet lightBulbAction = MaterialAction(\n        icon: UIImage(named: \"lightbulb\"),\n        title: \"Action with UISwitch as an accessory view\", handler: { [unowned self] (accessoryView) in\n            self.doSomething()\n        }, \n        accessoryView: UISwitch(), \n        dismissOnAccessoryTouch: true, \n        accessoryHandler: { [unowned self] (accessoryView) in\n            if let lightBulbSwitch = accessoryView as? UISwitch {\n                if accessoryView.on {\n                    print(\"Light is ON!\")\n                } else {\n                    print(\"Light is OFF!\")\n                }\n            }\n            self.doSomeOtherThing()\n    })\n```\n```swift\n// Then create your MaterialActionSheetController\n// parameter sections is a variadic which take a flexible list of section\nlet materialActionSheetController = MaterialActionSheetController(\n        title: \"A nice title\",\n        message: \"A friendly message\",\n        actionSections: [aCoolAction, anotherCoolAction], [cancelAction])\n```\n\n```swift\n// Or create \nlet materialActionSheetController = MaterialActionSheetController()\nmaterialActionSheetController.title = \"A nice title\"\nmaterialActionSheetController.message = \"A friendly message\"\nmaterialActionSheetController.actionSections.append([aCoolAction, anotherCoolAction])\nmaterialActionSheetController.actionSections.append([cancelAction])\n```\n\n```swift\n// Customize theme\nmaterialActionSheetController.theme = MaterialActionSheetTheme.dark()\n\n// Custom header view\nlet imageView = UIImageView(image: UIImage(named: \"myimage\"))\nimageView.bounds = CGRect(origin: CGPoint.zero, size: CGSize(width: 300, height: 100))\nmaterialActionSheetController.customHeaderView = imageView\n\n// Handler on \"will dismiss\" and \"did dismiss\" event\nmaterialActionSheetController.willDismiss = { [unowned self] in\n    print(\"I will dismiss.\")\n    self.doSomething()\n}\n\n// Finally present it\nmaterialActionSheetController.didDismiss = { [unowned self] in\n    print(\"I did dismiss.\")\n    self.doSomething()\n}\n\npresentViewController(materialActionSheetController, animated: true, completion: nil)\n```\nSee code in demo for more detailed examples.\n\n## Contribute\n\nFeel free to make PR, contributions are warmly welcome and appreciated.\n\n## License\n\nMaterialActionSheetController 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%2Fntnhon%2FMaterialActionSheetController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntnhon%2FMaterialActionSheetController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntnhon%2FMaterialActionSheetController/lists"}