uialertview

Attempt to present UIAlertController on View Controller which is already presenting (null) [Swift]

我只是一个虾纸丫 提交于 2019-12-05 05:52:32
I have an alert view that I am trying to present on a photo view. The photos are displayed in a list and can be pushed to a full-screen view. The photo view is being displayed programmatically. I think that is what is causing the issue because the alert view is trying to present another view, on top of the (photo) view that's already presented. The alert view is trying to display, but getting this error: Warning: Attempt to present <UIAlertController: 0x147d2c6b0> on <LiveDeadApp.ListViewController: 0x147d614c0> which is already presenting (null) The line that might be in question is this one:

How can I display a popup message in Swift that disappears after 3 seconds or can be cancelled by user immediatelly?

走远了吗. 提交于 2019-12-05 05:43:23
In my swift app I have a UIViewController with a single button. This button invokes a function that calls a popup that disappears after 3 seconds. Also, after that time it prints a message to the console. The code of this function is as follows: func showAlertMsg(title: String, message: String){ let alertController = UIAlertController(title: title, message: message, preferredStyle: .Alert) self.presentViewController(alertController, animated: true, completion: nil) let delay = 3.0 * Double(NSEC_PER_SEC) let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay)) dispatch_after(time, dispatch_get

Change tint color of UIAlertview and UIActionsheet buttons

微笑、不失礼 提交于 2019-12-05 03:28:48
I am trying to adapt my application for iOS 7. The issue I am having is I can not change the tint color of some controls. I did add self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; if (IOS7_OR_LATER) self.window.tintColor = [self greenTintColor]; to my app delegate's - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions It mostly helped but color of message box and action sheet buttons is still the default blue. How can I recolor all such buttons too? Some screenshots: As UIAlertView is

Can you create anonymous inner classes in Swift?

一个人想着一个人 提交于 2019-12-05 01:47:32
I'm tired of declaring entire classes as having the ability to handle UIAlertView clicks by making them extend UIAlertViewDelegate . It starts to feel messy and wrong when I have multiple possible UIAlertView s, and have to distinguish which was clicked in the handler. What I really want is to create a single object that implements the UIAlertViewDelegate protocol, and give this one-off object to my UIAlertView when showing it. I want something like this: let confirmDelegate = UIAlertViewDelegate() { func alertView(alertView: UIAlertView!, clickedButtonAtIndex buttonIndex: Int) { // Handle the

set alertview Yes button to bold and No button to normal

房东的猫 提交于 2019-12-05 01:37:19
I have alertview where I have Yes and No options. It looks like below. Code used is UIAlertView *confAl = [[UIAlertView alloc] initWithTitle:@"" message:@"Are you sure?" delegate:self cancelButtonTitle:@"Yes" otherButtonTitles:@"No", nil]; confAl.tag = 888; [confAl show]; This is perfect but I want Yes to be bold and No as normal font. So I switched the Yes and No button and have like below. Code used is UIAlertView *confAl = [[UIAlertView alloc] initWithTitle:@"" message:@"Are you sure?" delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil]; confAl.tag = 888; [confAl show]; Is

How to add a touchable Url link to a url in a UIAlertView's message?

天大地大妈咪最大 提交于 2019-12-05 00:10:40
I want to add a clickable link of an url into UIAlertView 's message. Such that when user sees the alert view, they can can touch on link inside message. Alternatively they can go next by clicking on the OK button. Is possible to do it? How? sergio The only way I see to implement what you are trying to is through a custom alert view. There are several approaches that you can take. One is subclassing UIAlertView and here you can find a short tutorial: Subclass UIAlertView . In your subclass you could then build the alert any way you like to implement the touch-enabled text. Have a look at this

Using OCUnit to test if an UIAlertView is presented

ぐ巨炮叔叔 提交于 2019-12-04 22:42:46
问题 I'm working on an app that will display a UIAlertView upon hitting it's exit button, only if progress in the game has been made. I was wondering how you would use OCUnit to intercept the UIAlertView and interact with it, or even detect if it has been presented. The only thing I can think of is to monkeypatch [UIAlertViewDelegate willPresentAlertView] , but that makes me want to cry. Does anyone know of a better method of doing this? 回答1: Update : See my blog post How to Unit Test Your Alerts

Open Storyboard-view manually

人盡茶涼 提交于 2019-12-04 22:03:08
问题 I have an application using Storyboard. On a view there is an AlertViewDialog. When the user clicks the first button ("Yes"), how can I open an other view on the Storyboard? 回答1: my be this can help : Drag a View in Then go to Identity Inspector (Shortcut: option+apple+3). Select the newly dragged View and give unique name from identify inspector in title Storyboard ID . // see the image for reference create SecondViewController class (.h &.m) subclass of viewController . then from alert view

How to respond to UIImagePickerController Generated UIAlertView

别来无恙 提交于 2019-12-04 22:02:22
I am using UIImagePickerController to capture video from my app and i have set video maximum duration to 30 seconds. When that 30 seconds limit is reached. I get an alert with a message "maximum video recording limit reached" produced by UIImagePickerController and it stops capturing video. What I want is that I want to respond to that alert that is generated automatically when 30 seconds limit is reached. I want to perform some action when "OK" button of that alert is pressed. I have implemented all the delegate methods of UIAlertView but it does come in any method when I press OK button.

Weird SIGABRT (unrecognized selector sent to instance) when using UIAlertView

半世苍凉 提交于 2019-12-04 21:31:15
I've been bashing my head in with this one for the past half hour, so I thought I'd ask my friends from Stack Overflow for some wisdom. I've got a tab bar application with a view controller at the root, and passing off the views to other xib s. I created a custom XIB and added its view controller class ( MoreViewController ) as an External Object in Interface Builder. When I link my methods, I get a SIGABRT error when calling the method with a UIButton : Method - (IBAction)showAbout { alert = [[[UIAlertView alloc] initWithTitle:@"About" message:@"yadda yadda yadda some message" delegate:self