uiactionsheet

Swift UIActionSheet crashes on iPad?

泄露秘密 提交于 2019-12-01 10:47:57
I m currently running into complete frustrations as i can't find any error, but my ActionSheet crashes on iPad but works well on iPhone here is the code of the action if (view.annotation.title as String!) == "San Francisco" { currentLat = 37.615223 currentLong = -122.389977 url = "www.google.de" let action:UIActionSheet = UIActionSheet(title: "Change Map Type", delegate: self, cancelButtonTitle: "Back", destructiveButtonTitle: nil, otherButtonTitles: "Product Page", "Video") action.showInView(self.view) action.tag = 0 VideoID = "XXXXXX" } So the action that should be handled is if actionSheet

Attaching an object to a UIActionSheet

主宰稳场 提交于 2019-12-01 07:49:53
问题 A view's 'delete' button is pressed. The view belongs to a view controller, which handles the button press. However, that view controller is a child of a container view controller, so it sends its delegate a message that a deletion was requested, and includes the object that should be deleted. The delegate (the parent view controller) receives the notification and presents a UIActionSheet to confirm the deletion. It also makes itself the delegate of that action sheet. The user confirms the

How to do “actionSheet showFromRect” in iOS 8?

旧巷老猫 提交于 2019-12-01 07:39:29
In iOS 7, I show actionSheet by "showFromRect": [actionSheet showFromRect:rect inView:view animated:YES]; But in iOS 8, this doesn't work. They they replace the implementation and suggest us using UIAlertController. Then how do I show this actionSheet like a popover? Using UIAlertController you can access the popoverPresentationController property to set the sourceView (aka inView) and sourceRect (aka fromRect). This gives the same appearance as the previous showFromRect:inView: UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Title" message:@"message" preferredStyle

UIActionSheet/UIAlertController multiline text

雨燕双飞 提交于 2019-12-01 06:37:34
This is the code I am writing to display UIActionSheet . actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"updateresponseforrecurring", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil otherButtonTitles: NSLocalizedString(@"updateresponseonlyforthis", nil), NSLocalizedString(@"updateresponseforallactivities", nil), nil]; actionSheet.tag = 2; [actionSheet showInView:[UIApplication sharedApplication].keyWindow]; This is what I get using this : Clearly, second option is longer and thus the size gets smaller to accommodate the

How to do “actionSheet showFromRect” in iOS 8?

时光怂恿深爱的人放手 提交于 2019-12-01 05:12:26
问题 In iOS 7, I show actionSheet by "showFromRect": [actionSheet showFromRect:rect inView:view animated:YES]; But in iOS 8, this doesn't work. They they replace the implementation and suggest us using UIAlertController. Then how do I show this actionSheet like a popover? 回答1: Using UIAlertController you can access the popoverPresentationController property to set the sourceView (aka inView) and sourceRect (aka fromRect). This gives the same appearance as the previous showFromRect:inView:

UIActionSheet/UIAlertController multiline text

前提是你 提交于 2019-12-01 04:48:15
问题 This is the code I am writing to display UIActionSheet . actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"updateresponseforrecurring", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil otherButtonTitles: NSLocalizedString(@"updateresponseonlyforthis", nil), NSLocalizedString(@"updateresponseforallactivities", nil), nil]; actionSheet.tag = 2; [actionSheet showInView:[UIApplication sharedApplication].keyWindow]; This is what

Showing a UIActionSheet

一笑奈何 提交于 2019-12-01 04:09:14
I was wondering how to show a UIActionSheet from the bottom of the screen. I have tried using the showInView: method with MainView as the view to show it in but I get the MainView Undeclared error. You need to reference the controllers view: [actionSheet showInView:self.viewController.view] If you attempt to show the UIActionSheet on the window though you use TabBar or ToolBar UI, The bottom part of the ActionSheet doesn't respond to your touch. You'd be better to use as follows: [[[UIApplication sharedApplication] delegate] window]; or you can show it in the main window. it will be useful if

adding view into action sheet

那年仲夏 提交于 2019-12-01 00:07:59
Can I add my custom UIViewController into the ActionSheet ? thanks finally I've find it... I've added a view which is subclass of UIViewController into the UIActionSheet. I've created a view in separate file (using xib) . UIActionSheet *asheet = [[UIActionSheet alloc] init]; [asheet showInView:self.view]; [asheet setFrame:CGRectMake(0, 230, 320, 230)]; CustomView *innerView = [[CustomView alloc] initWithNibName:@"CustomView" bundle:nil]; innerView.view.frame = CGRectMake(0, 10, 320, 210); [asheet addSubview:innerView.view]; //[asheet addSubview:innerView]; [innerView release]; [asheet release]

how to add UIPickerView in UIActionSheet

牧云@^-^@ 提交于 2019-11-30 21:02:09
i'm having task to enter rating(1 - 5) value, so i found the below code for date picker, can anyone help me to alter below code so to add UIPickerView to choose rate from 1 to 5 UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@"Ratings" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:nil]; UIDatePicker *pickerView = [[UIDatePicker alloc] init]; pickerView.datePickerMode = UIDatePickerModeDate; [menu addSubview:pickerView]; [menu showInView:self.view]; [menu sendSubviewToBack:pickerView]; [menu setBounds:CGRectMake(0,0,320, 500)]; CGRect

adding view into action sheet

烂漫一生 提交于 2019-11-30 19:27:13
问题 Can I add my custom UIViewController into the ActionSheet ? thanks 回答1: finally I've find it... I've added a view which is subclass of UIViewController into the UIActionSheet. I've created a view in separate file (using xib) . UIActionSheet *asheet = [[UIActionSheet alloc] init]; [asheet showInView:self.view]; [asheet setFrame:CGRectMake(0, 230, 320, 230)]; CustomView *innerView = [[CustomView alloc] initWithNibName:@"CustomView" bundle:nil]; innerView.view.frame = CGRectMake(0, 10, 320, 210)