     // `NSInvocation` is not allowed in Swift, so we just use AnyObject
     let selector = NSSelectorFromString("forwardInvocation:")
     let origIMP = class_getMethodImplementation(klass, selector)
-    typealias IMPType = @convention(c) (AnyObject, Selector, AnyObject) -> ()
-    let origIMPC = unsafeBitCast(origIMP, to: IMPType.self)
-    let block: @convention(block) (AnyObject, AnyObject) -> () = {
+    typealias IMPType = @convention(c) (AnyObject, Selector, AnyObject) -> Void
+    let origIMPC = unsafeBitCast(origIMP, to: IMPType.self)
+    let block: @convention(block) (AnyObject, AnyObject) -> Void = {
       if UIMenuItem.isMenuItemKitSelector($1.selector) {
         guard let item = UIMenuController.shared.findMenuItemBySelector($1.selector) else { return }
         item.actionBox.value?(item)

    if true {
      let selector = #selector(layoutSubviews)
      let origIMP = class_getMethodImplementation(self, selector)
      typealias IMPType = @convention(c) (UILabel, Selector) -> ()
      let origIMPC = unsafeBitCast(origIMP, to: IMPType.self)
      let block: @convention(block) (UILabel) -> () = { label in
        guard
          let item = UIMenuController.shared.findImageItemByTitle(label.text),
          let image = item.imageBox.value

    if true {
      let selector = #selector(setTargetRect(_:in:))
      let origIMP = class_getMethodImplementation(self, selector)
      typealias IMPType = @convention(c) (AnyObject, Selector, CGRect, UIView) -> Void
      let origIMPC = unsafeBitCast(origIMP, to: IMPType.self)
      let block: @convention(block) (AnyObject, CGRect, UIView) -> Void = {
        swizzleUIObject($2);
        origIMPC($0, selector, $1, $2)
      }

      setNewIMPWithBlock(block, forSelector: selector, toClass: self)
    }

    if #available(iOS 13.0, *) {
      let selector = #selector(showMenu(from:rect:))
      let origIMP = class_getMethodImplementation(self, selector)
      typealias IMPType = @convention(c) (AnyObject, Selector, UIView, CGRect) -> Void
      let origIMPC = unsafeBitCast(origIMP, to: IMPType.self)
      let block: @convention(block) (AnyObject, UIView, CGRect) -> Void = {
        swizzleUIObject($1);
        origIMPC($0, selector, $1, $2)
      }

