{"id":2611,"url":"https://github.com/cxa/MenuItemKit","last_synced_at":"2025-08-06T16:31:14.473Z","repository":{"id":51415625,"uuid":"49804170","full_name":"cxa/MenuItemKit","owner":"cxa","description":"UIMenuItem with image and closure(block) action","archived":false,"fork":false,"pushed_at":"2023-05-07T15:21:09.000Z","size":707,"stargazers_count":850,"open_issues_count":0,"forks_count":67,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-11-25T05:32:58.815Z","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/cxa.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-01-17T05:17:58.000Z","updated_at":"2024-06-17T13:17:43.000Z","dependencies_parsed_at":"2024-01-05T20:20:00.681Z","dependency_job_id":"8959c0ca-2ed2-47b9-964f-98e277575b08","html_url":"https://github.com/cxa/MenuItemKit","commit_stats":{"total_commits":67,"total_committers":7,"mean_commits":9.571428571428571,"dds":"0.14925373134328357","last_synced_commit":"22c027e9cdd89a8e449c714b5a5f64c8976b54ac"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxa%2FMenuItemKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxa%2FMenuItemKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxa%2FMenuItemKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxa%2FMenuItemKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cxa","download_url":"https://codeload.github.com/cxa/MenuItemKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227222645,"owners_count":17750191,"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.289Z","updated_at":"2024-12-09T16:31:02.613Z","avatar_url":"https://github.com/cxa.png","language":"Swift","funding_links":[],"categories":["UI","Libs","Swift","UI [🔝](#readme)","OOM-Leaks-Crash"],"sub_categories":["Menu","UI","Layout","Other free courses","Menu-PopupView"],"readme":"\u003e **Warning**\n\u003e `UIMenuController` is deprecated from iOS 16. Use `UIEditMenuInteraction` instead.\n\n# MenuItemKit\n\n`MenuItemKit` provides image and block(closure) support for `UIMenuItem`.\n\n`MenuItemKit` is a Swift project but Objective-C is supported without any doubt.\n\n![Screenshot](Screenshot.png)\n\n## Install\n\n### Swift Package\n\nAdd this repo URL to your Swift package dependencies.\n\n### CocoaPods\n\n```ruby\npod 'MenuItemKit', '~\u003e 4.0.0'\n```\n\n### Xcode subproject\n1. Add the `MenuItemKit` repository as a submodule of your application’s repository.\n2. Drag and drop `MenuItemKit.xcodeproj` into your application’s Xcode project or workspace.\n3. On the “General” tab of your application target’s settings, add `MenuItemKit.framework` to the “Embedded Binaries” section.\n\nIf you would prefer to use Carthage, please pull request.\n\n## How to use\n\n`MenuItemKit` is very easy to adopt, it provides only 2 APIs:\n\n``` swift\ntypealias MenuItemAction = (UIMenuItem) -\u003e ()\n\nextension UIMenuItem {\n    convenience init(title: String, image: UIImage?, action: MenuItemAction)\n    convenience init(title: String, action: MenuItemAction)\n}\n```\n\nFor Objective-C, `MenuItemKit` provides prefixed API names for safe reasons:\n\n```objc\n@interface UIMenuItem (SWIFT_EXTENSION(MenuItemKit))\n- (nonnull instancetype)mik_initWithTitle:(NSString * _Nonnull)title image:(UIImage * _Nullable)image action:(MenuItemAction _Nonnull)action;\n- (nonnull instancetype)mik_initWithTitle:(NSString * _Nonnull)title action:(MenuItemAction _Nonnull)action;\n@end\n```\n\nJust init `UIMenuItem`s with above APIs, and set them to `menuItems` of `UIMenuItemController`. `MenuItemKit` will take care of the rest parts, you don't need to add any code related to responder chain in your view or view controller.\n\nCheck dome projects (both Swift and Objective-C are provided) for more details.\n\n## Advance Usage\n\nFor menu items out of your control, you can use `static func installTo(responder: UIResponder, shouldShowForAction: @escaping (Selector, Bool) -\u003e Bool = default)` to configure items visibility. Check [AutoPopupMenuControllerDemo](AutoPopupMenuControllerDemo).\n\n## About Me\n\n* Twitter: [@_realazy](https://twitter.com/_realazy)\n* Apps available in App Store: \u003chttp://lazyapps.com\u003e\n* PayPal: xianan.chen+paypal 📧 gmail.com, buy me a cup of coffee if you find it's useful for you, thanks.\n\n## License\n\n`MenuItemKit` is released under the MIT license. In short, it's royalty-free but you must keep the copyright notice in your code or software distribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxa%2FMenuItemKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcxa%2FMenuItemKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxa%2FMenuItemKit/lists"}