uialertview

UIAlertController does not show immediately

坚强是说给别人听的谎言 提交于 2019-12-11 12:17:32
问题 Xcode version: 7.2.1, iOS version: 9.1+ I am trying to display a UIAlertController alert message on the iPad that shows a "Loading...Please Wait" message without any buttons on it. I present the UIAlertController before starting a long operation, and then after the long operation, I dismiss the UIAlertController. However, what is happening is the UIAlertController DOES NOT show up immediately. It only flashes up briefly AFTER the longer operation is completed, and then it is dismissed.

String Length Limitation with UIAlertViews in IOS7?

只谈情不闲聊 提交于 2019-12-11 12:07:13
问题 I'm working in a new iOS app and I noticed the following issue installing the app in iOS7 environment. After opening the app by first time, our app displays a popup with the AGB's that needs to be accepted in order to start using it. We used a UIAlertView and it worked fine until we tested with iOS7. Actually the alert pops up and seems to have content since I can see a huge scrollbar! But the strange thing is that the text is not shown at all.... After playing a bit with the text I noticed

Check if a UIAlertView is visible

混江龙づ霸主 提交于 2019-12-11 11:27:21
问题 I have a situation where I would like to pop up an alert view, but the event that shows the alert view could occur as often as every 5 seconds. I'd rather not have a stack of alert views for the user to click OK on so I was wondering. How do you check if a UIAlertView is currently showing? 回答1: You could retain a reference to it or you could set a flag in your alert delegate. When you open the alert set the flag to true and when the alert calls its dismissal delegate function flip it to false

present alert view in main view controller (called from subclass)

江枫思渺然 提交于 2019-12-11 10:07:29
问题 I have tow views in my app. A main view(ViewController.swift) and a sidebar(SideBar.swift). If I tapp a button in the sidebar an UIAlertView should be displayed (I call a function in ViewController.swift). But the app crashes because the main view is nil. Do you know how I can fix this? My code in the function (display alert): let alertView = UIAlertController(title: "You need to log in first", message: "To access the special features of the app you need to log in first.", preferredStyle:

Swift: Show UIAlertController in didReceiveLocalNotification method

不羁的心 提交于 2019-12-11 09:58:35
问题 I want to show alert when notification is fired while app is running, here is tutorial which i used for local notifications. In tutorial, it uses UIAlertView to show alert and it works, here is code: func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification) { // Point for handling the local notification when the app is open. // Showing reminder details in an alertview UIAlertView(title: notification.alertTitle, message: notification.alertBody,

UITextView in UIAlertview not working in iOS 4.x

可紊 提交于 2019-12-11 08:11:31
问题 In my medical app I have a new feature that allows the user to download PDF's and other resources to the Documents folder for offline viewing. The app supports iOS 4.1+ and iOS 5. The user enters a name for the downloaded file in an alert view. For iOS 5, placing a text field in an alert is now easy. For a similar look and feel in iOS 4.x, this code generally works well: alertNameEntryOld = [[UIAlertView alloc] init]; [alertNameEntryOld setDelegate:self]; [alertNameEntryOld setTitle:@"Enter

ios: UIAlertView show immediately before for loop executes

ぃ、小莉子 提交于 2019-12-11 06:35:54
问题 I have the following code: UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Loading Content For the First Time..." message:@"\n" delegate:self cancelButtonTitle:nil otherButtonTitles:nil]; UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; spinner.center = CGPointMake(139.5, 75.5); // .5 so it doesn't blur [alertView addSubview:spinner]; [spinner startAnimating]; [alertView show]; for

Show UIAlertController from a common utility class

两盒软妹~` 提交于 2019-12-11 06:06:57
问题 I am working on a project that uses UIAlertView , now the problem is I have to replace all of the UIAlertView's with UIAlertController's and there are around 1250 of them in the code. I am planning to uses the existing Utility class to create a function that does this, following is what I am planning to do: +(void)showAlert:(NSString *)title errorMessage:(NSString *)msg { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle

Asking for user confirmation before leaving a view in iOS

风格不统一 提交于 2019-12-11 05:59:33
问题 I need to show an UIAlertView before a user leaves a certain view, either by tapping a 'back' navigation bar button or by tapping one of the tab items in the tab bar I have, in order to ask him for confirmation. It would be a two-button alert, a 'Cancel' one to stay in the view, and an 'Accept' one to leave. I need to do this because I have to make the user aware that unsaved changes will be lost if leaving. I tried to do this by creating and showing the alert view in the viewWillDisappear:

positioning subclassed UIAlertView window with onscreen keyboard on iOS

天大地大妈咪最大 提交于 2019-12-11 05:14:17
问题 I'm using subclassed UIAlertView window as a login prompt in my application (I know it's against Apple guidelines but it will not be submitted to the appstore so it's not a problem). The code to add text fields and position the window on screen looks like this: - (id)initWithTitle:(NSString *)title delegate:(id)delegate { if (self = [super initWithTitle:title message:@"\n\n\n" delegate:delegate cancelButtonTitle:@"Cancel" otherButtonTitles:@"Login", nil]) { UITextField *loginTF = [