uiactionsheet

iPhone: detecting if a UIAlert/UIActionSheet are open

五迷三道 提交于 2019-11-28 11:06:57
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 detect it? Thanks Sam Ritchie They do send an alert when they open, but only to their delegate --

Add UIView as subView on UIActionSheet

别等时光非礼了梦想. 提交于 2019-11-28 10:29:23
问题 I am working on project where I want to show UIActionsheet with three buttons Change,Cancel and Done and at the place of title I want to put UIView which has some labels. I have created dynamic UIView and I added it to actionsheet but its hiding behind buttons I tried it by all possible ways to setFrame,bounds but I am not able to find solution. I want to place this UIView at the top of UIActionsheet followed by buttons. If you have any doubts feel free to post comments. Here is My Code: -

Multiple red/destructive buttons UIActionSheet

ε祈祈猫儿з 提交于 2019-11-28 08:38:15
问题 Is there any way to have more than 1 red "destructive button" in an iPhone app's UIActionSheet? I need to have different clear options, in the same action sheet, one where it deletes everything and one where it deletes less, so both need to be red. 回答1: I just created a simple customizable replacement for UIActionSheet for iPhone to use in a similar case. It does not use the standard appearance, but this can be changed. Probably it is of any use to you. https://github.com/4marcus

UIAlertController handle dismiss upon click outside (IPad)

怎甘沉沦 提交于 2019-11-28 06:49:04
Previous to iOS8 we used the UIActionSheet for showing alert and now we need to use the UIAlertController. When we used the UIActionSheet we could easily handle situations where the user clicked outside the pop up (which means he want to cancel the operation) by comparing the clickedButtonAtIndex to the cancelButtonIndex - if the user indeed pressed outside the popup we got the cancel button index in this function. How can we handle these situations with the new UIAlertController? I tried to use the "completion" block but it doesn't have any context. Is there an easy way to handle this? (other

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

南楼画角 提交于 2019-11-28 06:01:06
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:UIPopoverArrowDirectionAny animated:NO]; [anActionSheet showFromBarButtonItem:someButtonItem animated:NO];

how to enable text input in UITextField which is in UIActionSheet?

陌路散爱 提交于 2019-11-28 05:47:32
问题 I am creating textField in UIActionsheet, but I can't input text, can any one has idea about it ???? my coding is as follow -(void)commentsMethod: (id) sender { //setup UITextField for the UIActionSheet UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 28, 320, 150)]; //textField.delegate=self; textField.autocorrectionType = UITextAutocorrectionTypeNo; [textField setBackgroundColor:[UIColor clearColor]]; [textField setBorderStyle:UITextBorderStyleRoundedRect];

Social action sheet (like on iOS 6)

[亡魂溺海] 提交于 2019-11-28 04:31:22
on iOS 6 a change was that when you want to share something it brings up an action sheet similar to this: I have seen a few other apps that use this, is there a native way to do this without making a custom action sheet? Thanks! j9suvak NSString *textToShare = @"your text"; UIImage *imageToShare = [UIImage imageNamed:@"yourImage.png"]; NSArray *itemsToShare = @[textToShare, imageToShare]; UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil]; activityVC.excludedActivityTypes = @[UIActivityTypePrint,

Display UIAlertController from UIView/NSObject class

杀马特。学长 韩版系。学妹 提交于 2019-11-27 20:30:53
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. [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController ...] but have some rotation

How to fire uibarbuttonitem click event programmatically

a 夏天 提交于 2019-11-27 19:28:24
I have created a UIActionSheet UIActionSheet * action = [[UIActionSheet alloc]initWithTitle:@"" delegate:self cancelButtonTitle: @"cancel" destructiveButtonTitle: @"OK" otherButtonTitles: nil]; [action showInView:self.view]; [action release]; On the event of the cancel button in the UIActionSheet I want to fire the event of a UIBarButtonItem , which is in my view. My question is how can I fire the button event(without touching the button) in the UIActionSheet delegate method ayoy Not knowing the current bar button item action you can invoke it this way: [barButtonItem.target performSelector

iOS 8 Only Memory Leak with UIAlertController or UIActionSheet

落花浮王杯 提交于 2019-11-27 18:06:36
问题 I'm seeing a memory leak in iOS 8 in simulator when I do the following with UIActionSheet or UIAlertController. UIActionSheet uses UIAlertController in IOS 8 so the issues are related. showCameraAction gets called when a button is pressed. I've removed all of the content from the delegate method and still get the leak in the case shown below. Am I using UIActionSheet in some way that I shouldn't? I would appreciate any help in resolving this issue. The same code has no leaks with IOS 7 (in