I am creating a UIActionSheet using the Swift programming language with SDK8.1 targeting iOS7.0+. The below code shows my action sheet creation:
//Opens action sheet for image selection
@IBAction func showActionSheet(){
if(UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera)){
if(images.count >= Numbers.LIMIT_IMAGES){
lblError.displayMessage(FAUErrorLabel.MessageLevel.INFO, message: Messages.MAXIMAGES)
}
else{
var actionSheet = UIActionSheet(title: "Choose a Picture Method", delegate: self, cancelButtonTitle: "Cancel", destructiveButtonTitle: nil, otherButtonTitles: "Gallery", "Take Photo")
actionSheet.showInView(self.view)
}
}
else{
lblError.displayMessage(FAUErrorLabel.MessageLevel.ERROR, message: Messages.NOCAMERA)
}
}
However, it displays as if there is a cancel button and another single button, which is a combination of the two "otherButtonTitles". The "Take Photo" button is not touchable. In iOS8.0, there is a separation between the two buttons and the "Take Photo" button is touchable.
iOS7.1
iOS8.1
How do I get the two buttons to both be touchable in iOS7.1?
Thanks!
I was using a tab bar but presenting from a view, causing the tab bar to hide the bottom button from user action, although it did not hide it visual. Using the below line instead of displaying from view fixed the problem. This appears to be a iOS7.1 bug, as it does not occur in iOS8.1.
actionSheet.showFromTabBar(self.tabBarController?.tabBar)