uialertview

how to request the user to turn on location services

拜拜、爱过 提交于 2019-12-02 22:32:00
问题 I need my app to access the user's current location. It checks at the beginning of the app if the user has it set or not. and if not i need the app to show a prompt for it to use location services. Like a an alert view and on lick of the button it should take you to the screen of location services on iphone. 回答1: You can check the for locationServicesEnabled and if the location service is allowed for your application by this code: if([CLLocationManager locationServicesEnabled] &&

How to create an alertview for a button prompting to take pictures from gallery or camera roll?

◇◆丶佛笑我妖孽 提交于 2019-12-02 21:29:39
问题 import UIKit class AccountViewController: UIViewController,UINavigationControllerDelegate, UIImagePickerControllerDelegate { @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var chooseButton: UIButton! let imagePicker = UIImagePickerController() @IBOutlet weak var mySwitch: UISwitch! @IBOutlet weak var myStatus: UILabel! @IBAction func mySwitchTapped(sender: AnyObject) { updateSwitchStatus() } override func viewDidLoad() { super.viewDidLoad() updateSwitchStatus() self

UIAlertController showing with delay

Deadly 提交于 2019-12-02 19:56:48
I'm experiencing a problem with UIAlertController on my app now migrated to iOS8 with Date Picker inside. Below is the code. UIAlertController *AlertView = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *ok = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [AlertView dismissViewControllerAnimated:YES completion:nil]; }]; UIAlertAction *set = [UIAlertAction actionWithTitle:NSLocalizedString(@"Set to today", nil) style:UIAlertActionStyleDefault handler:^

How Add Image into UIAlertbox in Swift 3?

半城伤御伤魂 提交于 2019-12-02 19:08:37
问题 I would like to add Image in UIAlertbox so I add the following codes. let alertController = UIAlertController(title: "Gender", message: "" , preferredStyle: .alert) // Create the actions let okAction = UIAlertAction(title: "Female", style: UIAlertActionStyle.default) { UIAlertAction in // exit(0) debugPrint("Press OK") } let cancelAction = UIAlertAction(title: "Male", style: UIAlertActionStyle.cancel) { UIAlertAction in } // Add the actions okAction.setValue(#imageLiteral(resourceName:

Where to find a clear explanation about swift alert (UIAlertController)?

余生长醉 提交于 2019-12-02 18:38:28
Couldn't find a clear and informative explanation for this. Nikita Kurtin After searching a while on a subject I didn't find a clear explanation , even in it's class reference UIAlertController Reference It is ok, but not clear enough for me. So after collecting some peaces I decided to make my own explanation (Hope it helps) So here it goes: UIAlertView is deprecated as pointed out : UIAlertView in Swift UIAlertController should be used in iOS8+ so to create one first we need to instantiate it, the Constructor(init) gets 3 parameters: 2.1 title:String -> big-bold text to display on the top of

clickedButtonAtIndex method is not called

安稳与你 提交于 2019-12-02 18:28:14
问题 when the user click on a button on the UIAlertView the clickedButtonAtIndex method is supposed to be called, however, it doesn't : in the .h i have called the UIAlertView protocol : @interface RechercherViewController : UIViewController<UIAlertViewDelegate> { //code } and in .m file i have this : -(void)requestFailed:(ASIHTTPRequest *)request { //quand il y aura un échec lors de l'envoie de la requête UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"TopStation" message :@"Your internet

how can I have a totally transparent UIAlertView?

早过忘川 提交于 2019-12-02 17:45:34
问题 I need a UIALertView, which on popping up should be transparent enough to show the background behind the alertview in a faded way and the blue color of the alert view should not appear since the background behind the alert view is black and grey in color. Changing color and putting an image to the alert view is one thing which can be seen in the links : iOS 5 black transparent UIAlertView and Changing the background color of a UIAlertView? but I need a transparent UIAlertView. Is it possible

UIAlertView not functioning correctly

那年仲夏 提交于 2019-12-02 14:43:15
问题 I have a problem when I try to dismiss my UIAlertView. The UIAlertView launches correctly, and displays two buttons: "Yes" and "No". However, when I select the Yes button, nothing happens. I am wondering what I am doing wrong, and why nothing occurs when the Yes button is selected. My code is as follows: -(IBAction)gotoURL { [self displaySafariDialogue]; } -(void)displaySafariDialogue { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Are you sure you wish to exit this app and launch

iOS UIAlertview with uitextview editable

对着背影说爱祢 提交于 2019-12-02 14:26:30
问题 I'm searching for a way of putting an UITextView editable inside an UIAlertView. I know how to put a simple textfield with : alert.alertViewStyle = UIAlertViewStylePlainTextInput; But this isn't what i want. I want a bigger text input so a user can write a comment after a news for example. Is this possible ? 回答1: Unfortunately what you are after isn't possible with a UIAlertView . Apple don't allow developers to modify the view hierarchy of a UIAlertView or subclass it. Check out the Apple

Open Settings.app When Button is Tapped in UIAlertView on iPhone SDK [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-02 13:52:03
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Opening the Settings app from another app Is there a way to direct the user to the Settings.app whenever I show a UIAlertView prompt? This prompt alerts the user that his location services is turned off and I want the user to open the Settings.app when he taps the button inside my UIAlertView . UPDATE: I'm looking for a similar code stated here: How to launch myapplication settings tab in settings app from my