Reputation: 272164
I want one of the options to do nothing when clicked. It's basically a placeholder. It won't have a title, and it's just white.
func actionSheet(sheet: UIActionSheet, clickedButtonAtIndex buttonIndex: Int) {
if sheet.tag == 1 {
var title = sheet.buttonTitleAtIndex(buttonIndex)
if title == Constants.EmptyTitleActionSheetItem{
//do nothing. don't dismiss.
}else{
//something real was clicked. perform actions and continue dismissal
}
}
}
Upvotes: 2
Views: 584
Reputation: 498
There a are 2 choices I see.
Upvotes: 5
Reputation: 38249
Only option is to create a custom
or use third party
Third party Action Sheet are given below:
JGActionSheet - A feature-rich and modern action sheet for iOS.
AHKActionSheet - An alternative to the UIActionSheet with a block-based API and a customizable look. Inspired by the Spotify app. It looks a lot better live than on the GIF (because compression).
Upvotes: 0
Reputation: 41
put return statement in that if block.
if title == Constants.EmptyTitleActionSheetItem{
//do nothing. don't dismiss.
return;
}
Upvotes: -1