cxa / MenuItemKit

UIMenuItem with image and closure(block) action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App crash when assigning nil to menuItems *Fix inside*

opened this issue · comments

I can't pull request the branch so this it the problem and fix

private extension UIMenuController {
@objc class func _mik_load() {
if true {
## guard UIMenuController.shared.menuItems != nil else { return }
let selector = #selector(setter: menuItems)
let origIMP = class_getMethodImplementation(self, selector)
typealias IMPType = @convention(c) (AnyObject, Selector, AnyObject) -> ()