I have created a UIActionSheet
UIActionSheet
UIActionSheet * action = [[UIActionSheet alloc]initWithTitle:@\"\"
@ton1n8o 's solution worked for me. Here is the implementation in swift:
UIApplication.sharedApplication().sendAction(barButtonItem.action, to: barButtonItem.target, from: nil, forEvent: nil)