Change Text Color of Items in UIActionSheet – iOS 8

There’s an easy way if you still want to use UIActionSheet instead of UIAlertController in order to support older iOS versions. UIActionSheet actually uses UIAlertController in iOS 8, and it has a private property _alertController. SEL selector = NSSelectorFromString(@”_alertController”); if ([actionSheet respondsToSelector:selector]) { UIAlertController *alertController = [actionSheet valueForKey:@”_alertController”]; if ([alertController isKindOfClass:[UIAlertController class]]) { alertController.view.tintColor = … Read more

Add UIPickerView in UIActionSheet from IOS 8 not working

Per the Apple docs, Important: UIActionSheet is deprecated in iOS 8. (Note that UIActionSheetDelegate is also deprecated.) To create and manage action sheets in iOS 8 and later, instead use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet. Link to documentation for UIAlertController For example: UIAlertController * searchActionSheet=[UIAlertController alertControllerWithTitle:@”” message:@”” preferredStyle:UIAlertControllerStyleActionSheet]; [ searchActionSheet.view setBounds:CGRectMake(7, 180, self.view.frame.size.width, 470)]; … Read more

How to use UIAlertController to replace UIActionSheet?

I have used following code to show action sheet using UIAlertViewController and it works perfect. Swift let alert = UIAlertController(title: “Action Title”, message: “Action Message”, preferredStyle: .actionSheet) let action = UIAlertAction(title: “Item”, style: .default) { UIAlertAction in // Write your code here } alert.addAction(action) let cancelAction = UIAlertAction(title: “Cancel”, style: .cancel) { UIAlertAction in // … Read more

Presenting a view controller modally from an action sheet’s delegate in iOS8 – iOS11

Update: As of iOS 9 SDK, UIActionSheet is deprecated, so do not expect a fix regarding this issue. It is best to start using UIAlertController when possible. The problem seems to come from Apple’s switch to using UIAlertController internally to implement the functionality of alert views and action sheets. The issue is seen mostly on … Read more

Creating UIActionSheet [duplicate]

You need to use a UIActionSheet. First you need to add UIActionSheetDelegate to your ViewController.h file. Then you can reference an actionsheet with: UIActionSheet *popup = [[UIActionSheet alloc] initWithTitle:@”Select Sharing option:” delegate:self cancelButtonTitle:@”Cancel” destructiveButtonTitle:nil otherButtonTitles: @”Share on Facebook”, @”Share on Twitter”, @”Share via E-mail”, @”Save to Camera Roll”, @”Rate this App”, nil]; popup.tag = 1; … Read more

Swift UIAlertController -> ActionSheet iPad iOS8 Crashes

The error message is telling you that you need to give the alert controller’s popoverPresentationController a location so that it can position itself properly. This is easy to do — just check to see if there’s a popover controller and add the sender as the source. If your button is a UIBarButtonItem: if let popoverController … Read more

ActionSheet not working iPad

You need to provide a source view or button just before presenting optionMenu since on iPad its a UIPopoverPresentationController, As it says in your error. This just means that your action sheet points to the button letting the user know where it started from. For example if you’re presenting your optionMenu by tapping on the … Read more

Create UIActionSheet ‘otherButtons’ by passing in array, not varlist

I got this to work (you just need to, be ok with a regular button, and just add it after : NSArray *array = @[@”1st Button”,@”2nd Button”,@”3rd Button”,@”4th Button”]; UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@”Title Here” delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; // ObjC Fast Enumeration for (NSString *title in array) { [actionSheet addButtonWithTitle:title]; } actionSheet.cancelButtonIndex = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)