Get Updates By E-mail 

Article Written By:
Johann Dowa

Open Source Component Extending UIMenuItem With Image Support And A Blocks Based Syntax

  •  
  •  
  •  
  •  
  •  

Some time ago I mentioned Chen Xian-an’s UIMenuItem+CXAImageSupport library that extends UIMenuItem using swizzling to add support for images.

Here’s an open source component submitted by Chen Xian-an that updates UIMenuItem+CXAImageSUpport called MenuItemKit that extends UIMenuItem with support for images along with a nice blocks based syntax that works with both Swift and Objective-C.

Here’s a code snippet showing how to use an image with UIMenuItem with MenuItemKit

let image = UIImage(named: "Image")!
let imageItem = UIMenuITem(image: image) { [weak self] _ in
  self?.showAlertWithTitle("image item tapped")

You can find MenuItemKit on Github here.

A nice extension to UIMenuItem.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments