uiactionsheet

Dismissing UIAlertViews when entering background state

倾然丶 夕夏残阳落幕 提交于 2019-11-27 10:30:24
Apple recommends dismissing any UIAlertViews/UIActionSheets when entering background state in iOS 4. This is to avoid any confusion on the user's part when he relaunches the application later. I wonder how I could elegantly dismiss all UIAlertViews at once, without retaining a reference to it everytime I set one up... Any idea ? Guillaume I was intrigued by Dad's answer (funny username :), and curious why it was down-voted. So I tried it. Here is the .m part of a subclass of UIAlertView. Edit: (Cédric) I have added a way to catch calls to delegate methods and remove the observer then to avoid

UIActionSheet iOS Swift

做~自己de王妃 提交于 2019-11-27 09:31:21
问题 How To Do UIActionSheet in iOS Swift? Here is my code for coding UIActionSheet. @IBAction func downloadSheet(sender: AnyObject) { let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .actionSheet) let saveAction = UIAlertAction(title: "Save", style: .default, handler: { (alert: UIAlertAction!) -> Void in println("Saved") }) let deleteAction = UIAlertAction(title: "Delete", style: .default, handler: { (alert: UIAlertAction!) -> Void in println("Deleted") })

Presenting a view controller modally from an action sheet's delegate in iOS8 - iOS11

本秂侑毒 提交于 2019-11-27 06:47:32
So I noticed that in iOS8 beta 3 ( Update : still happens in iOS 11.2) on iPad, when attempting to present a view controller from within a delegate method of a UIActionSheet , "nothing" happens and a log message is output to the debug console, stating that presentation was attempted while transitioning an alert controller: Warning: Attempt to present <UIViewController: 0x...> on <ViewController: 0x...> which is already presenting <UIAlertController: 0x...> Update: As of iOS 9 SDK, UIActionSheet is deprecated, so do not expect a fix regarding this issue. It is best to start using

Add UIPickerView in UIActionSheet from IOS 8 not working

寵の児 提交于 2019-11-27 06:33:18
I am adding UIPickerView to UIActionsheet but its working perfectally in ios 7 but not working in ios 8 . Please help me to solve that. Here i attached screenshot for that. Thanks I am using following code for that. UIActionSheet *actionSheet; NSString *pickerType; - (void)createActionSheet { if (actionSheet == nil) { // setup actionsheet to contain the UIPicker actionSheet = [[UIActionSheet alloc] initWithTitle:@"Please select" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; actionSheet.backgroundColor = [UIColor clearColor]; UIToolbar *pickerToolbar = [

Adding Images to UIActionSheet buttons as in UIDocumentInteractionController

家住魔仙堡 提交于 2019-11-27 06:11:32
Is it possible to add an image to the buttons of the UIActionSheet as seen in UIDocumentInteractionController ? If so, please let me know how it is done. Amit Try this way, i hope it may be help you. UIActionSheet * action = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"",nil]; [[[action valueForKey:@"_buttons"] objectAtIndex:0] setImage:[UIImage imageNamed:@"yourImage.png"] forState:UIControlStateNormal]; [[[action valueForKey:@"_buttons"] objectAtIndex:0] setImage:[UIImage imageNamed:@"yourImage

iPhone: detecting if a UIAlert/UIActionSheet are open

五迷三道 提交于 2019-11-27 06:04:32
问题 In my iOS application, I have a timer firing up, and when it fires, I need to be able to detect whether there's an Alert (UIAlertView) or an Action Sheet (UIActionSheet) open. One way would be to modify the code presenting the alerts/actionsheets - but unfortunately this is not an option in my case. So, the question is - is there a way of knowing/detecting whether an alert or action sheet have been opened? Is there any notifications sent upon opening, or any traversal of the view hierarchy to

How to change the background color of the UIAlertController?

人走茶凉 提交于 2019-11-27 04:03:18
Due to strange behavior of UIActionSheet in iOS 8, I have implemented UIAlertController with UIAction as buttons in it. I would like to change the entire background of the UIAlertController. But I can't find any ways to do it. Tried even with, actionController.view.backgroundColor = [UIColor blackColor]; But didn't help me out. Any inputs on this regard will be appreciable. Thanks in advance. nischtname You have to step some views deeper: let subview = actionController.view.subviews.first! as UIView let alertContentView = subview.subviews.first! as UIView alertContentView.backgroundColor =

Retain/release pattern for UIPopoverController, UIActionSheet, and modal view controllers?

喜欢而已 提交于 2019-11-27 01:09:45
问题 I'm somewhat unclear on the object ownership patterns required for the following instances. When my UIViewController presents a popover controller, an action sheet, or another view controller as modal, am I required to hang onto a retained reference to that child controller until it's been dismissed? In other words, do the following lines of code effectively "transfer" ownership, or not? [aPopoverController presentPopoverFromBarButtonItem:someButtonItem permittedArrowDirections

How to customize UIActionSheet? iOS

戏子无情 提交于 2019-11-26 22:34:55
问题 Is it possible to create an ActionSheet that have a label between two buttons like this image? Really need this right now. Can anyone help me? Thanks. 回答1: EDIT 2018 I posted this code all the way back in iOS4 when it was potentially useful. iOS Development has grown staggeringly since then, please do not use this code unless you are writing an app for iOS4 for whatever reason! Please refer to the wonderful 3rd party library XLR Action Controller for your mondern actionsheet needs! It is most

Display UIAlertController from UIView/NSObject class

对着背影说爱祢 提交于 2019-11-26 20:25:38
问题 I have working iOS application In order to support iOS8 , I am replacing UIAlertView/UIActionSheet with UIAlertController . Problem : For display UIAlertController I need presentViewController method of UIViewController class. But UIAlertView is display from classes which are inherited from UIView or NSObject , I can not get [self presentViewController...] method for obvious reason. My Work : I tried getting rootViewController form current window and display UIAlertController. [[