{"id":20010100,"url":"https://github.com/cxa/menuitemkit","last_synced_at":"2025-04-08T15:12:46.148Z","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":851,"open_issues_count":0,"forks_count":63,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-01T14:12:08.902Z","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":"2025-03-30T03:20:50.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":247867362,"owners_count":21009240,"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-13T07:18:28.260Z","updated_at":"2025-04-08T15:12:46.129Z","avatar_url":"https://github.com/cxa.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"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"}