{"id":13462691,"url":"https://github.com/umerjabbar/ContextMenuSwift","last_synced_at":"2025-03-25T05:32:13.455Z","repository":{"id":42727056,"uuid":"260326460","full_name":"umerjabbar/ContextMenuSwift","owner":"umerjabbar","description":"A better version of iOS 13 Context Menu","archived":false,"fork":false,"pushed_at":"2024-04-03T09:22:48.000Z","size":8513,"stargazers_count":319,"open_issues_count":2,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-06T19:46:19.610Z","etag":null,"topics":["context-menu","contextmenu","dropdown","dropdown-menus","dropdownlist","dropdownmenu","framework","ios","menu","menubar","menus","pod","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/umerjabbar.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-30T21:55:11.000Z","updated_at":"2025-03-06T02:16:41.000Z","dependencies_parsed_at":"2024-01-16T05:10:30.212Z","dependency_job_id":"f46cd443-9176-44e1-81bf-5ed600e23387","html_url":"https://github.com/umerjabbar/ContextMenuSwift","commit_stats":{"total_commits":46,"total_committers":4,"mean_commits":11.5,"dds":"0.15217391304347827","last_synced_commit":"d9a9d40dc5da19b07eddeaacdf6c7e80ba2281d7"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umerjabbar%2FContextMenuSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umerjabbar%2FContextMenuSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umerjabbar%2FContextMenuSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umerjabbar%2FContextMenuSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umerjabbar","download_url":"https://codeload.github.com/umerjabbar/ContextMenuSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407532,"owners_count":20610226,"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":["context-menu","contextmenu","dropdown","dropdown-menus","dropdownlist","dropdownmenu","framework","ios","menu","menubar","menus","pod","swift"],"created_at":"2024-07-31T13:00:18.981Z","updated_at":"2025-03-25T05:32:11.594Z","avatar_url":"https://github.com/umerjabbar.png","language":"Swift","funding_links":[],"categories":["Swift","swift","UI Component"],"sub_categories":[],"readme":"# ContextMenuSwift\n\n[![Linkedin: umerjabbar](http://img.shields.io/badge/linkedin-umerjabbar-70a1fb.svg?style=flat)](https://www.linkedin.com/in/umerjabbar)\n[![Twitter: @Umer_Jabbar](http://img.shields.io/badge/twitter-%40Umer_Jabbar-70a1fb.svg?style=flat)](https://twitter.com/Umer_Jabbar)\n![License](https://img.shields.io/cocoapods/l/Hero.svg?style=flat)\n![Xcode 10.0+](https://img.shields.io/badge/Xcode-9.0%2B-blue.svg)\n![iOS 10.0+](https://img.shields.io/badge/iOS-10.0%2B-blue.svg)\n![Swift 4.0+](https://img.shields.io/badge/Swift-4.0%2B-orange.svg)\n[![Cocoapods](http://img.shields.io/badge/Cocoapods-available-green.svg?style=flat)](https://cocoapods.org/pods/ContextMenuSwift)\n\n## Installation 📱\n\nJust add `ContextMenuSwift` to your Podfile and `pod install`. Done!\n\n```ruby\npod 'ContextMenuSwift'\n```\n\n## Usage ✨ \n\n### Example 1\n\n\u003cimg src=\"/Images/example1.gif\" height=\"520\" width=\"292\" /\u003e\n\nShow the menu of string values on your view\n\n```swift\nCM.items = [\"Item 1\", \"Item 2\", \"Item 3\"]\nCM.showMenu(viewTargeted: YourView, delegate: self, animated: true)\n```\n\n### Example 2\n\n\u003cimg src=\"/Images/example2.gif\" height=\"520\" width=\"292\" /\u003e\n\nUpdate menu items async\n\n```swift\nCM.items = [\"Item 1\", \"Item 2\", \"Item 3\"]\nCM.showMenu(viewTargeted: YourView, delegate: self, animated: true)\nDispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {\n    CM.items = [\"Item 1\"]\n    CM.updateView(animated: true)\n}\n```\n\n### Example 3\n\n\u003cimg src=\"/Images/example3.gif\" height=\"520\" width=\"292\" /\u003e\n\nUpdate targeted view async\n\n```swift\nCM.items = [\"Item 1\", \"Item 2\", \"Item 3\"]\nCM.showMenu(viewTargeted: YourView, delegate: self, animated: true)\nDispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {\n    CM.changeViewTargeted(newView: YourView)\n    CM.updateView(animated: true)\n}\n```\n\n### Example 4\n\n\u003cimg src=\"/Images/example4.png\" height=\"520\" width=\"239\" /\u003e\n\nChange the horizontal direction of menu\n\n```swift\nCM.MenuConstants.horizontalDirection = .right\nCM.items = [\"Item 1\", \"Item 2\", \"Item 3\"]\nCM.showMenu(viewTargeted: YourView, delegate: self, animated: true)\n```\n\n### Example 5\n\n\u003cimg src=\"/Images/menu_with_icons.jpeg\" height=\"520\" width=\"292\" /\u003e\n\nShow menu with icons\n\n```swift\nlet share = ContextMenuItemWithImage(title: \"Share\", image: #imageLiteral(resourceName: \"icons8-upload\"))\nlet edit = \"Edit\"\nlet delete = ContextMenuItemWithImage(title: \"Delete\", image: #imageLiteral(resourceName: \"icons8-trash\"))\nCM.items = [share, edit, delete]\nCM.showMenu(viewTargeted: YourView, delegate: self, animated: true)\n```\n\n### Delegate\n\nYou can check events by implement ContextMenuDelegate\n```swift\nextension ViewController : ContextMenuDelegate {\n    \n    func contextMenu(_ contextMenu: ContextMenu, targetedView: UIView, didSelect item: ContextMenuItem, forRowAt index: Int) -\u003e Bool {\n        print(item.title)\n        return true //should dismiss on tap\n    }\n    \n    func contextMenuDidAppear(_ contextMenu: ContextMenu) {\n        print(\"contextMenuDidAppear\")\n    }\n    \n    func contextMenuDidDisappear(_ contextMenu: ContextMenu) {\n        print(\"contextMenuDidDisappear\")\n    }\n \n}\n```\n\n## Requirements\n\n* Xcode 9+\n* Swift 4.0\n* iOS 10+\n\n## License\n\nThis project is under MIT license. For more information, see `LICENSE` file.\n\n## Credits \n\nContextMenuSwift was developed while trying to implement iOS 13 context menu with a tap gesture.\n\n\nIt will be updated when necessary and fixes will be done as soon as discovered to keep it up to date.\n\nYou can find me on Twitter [@Umer_Jabbar](https://twitter.com/Umer_Jabbar) and Linkedin [umerjabbar](https://www.linkedin.com/in/umerjabbar/).\n\nEnjoy! 🤓\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumerjabbar%2FContextMenuSwift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumerjabbar%2FContextMenuSwift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumerjabbar%2FContextMenuSwift/lists"}