uipresentationcontroller

Using definesPresentationContext with UIModalPresentationStyle.custom

放肆的年华 提交于 2021-02-06 10:46:06
问题 I am using view controller containment to manage a set of child view controllers which should be able to modally present other view controllers in a custom manner. I have run into an issue where the definesPresentationContext property is not used when a presenting from a view controller using UIModalPresentationStyle.custom As an example, I have three view controllers: ROOT , A , and B ROOT |_ A A is the child of ROOT . I would like to present B modally from A while using custom

UIPresentationController crash just points to AppDelegate

喜欢而已 提交于 2020-01-02 07:22:09
问题 Screenshots : I am getting a lot of these crashes but the problem is I'm just being pointed to my appDelegate first line. I've no idea where to look for the issue. Any ideas where I could start to investigate from the following crash report? Crashed: com.apple.main-thread 0 UIKit 0x18d005640 __56- [UIPresentationController runTransitionForCurrentState]_block_invoke + 460 1 UIKit 0x18cf27aa8 _runAfterCACommitDeferredBlocks + 292 2 UIKit 0x18cf1ae5c _cleanUpAfterCAFlushAndRunDeferredBlocks +

App crashing on runTransitionForCurrentState but no clue as to why

Deadly 提交于 2019-12-19 02:25:09
问题 I've tried searching for this, but no luck, so hoping there are some guru's who may know the answer. I'm seeing loads of reports in iTunes Connect of my app crashing with a particular stack trace, but the stack trace reveals nothing useful. #0. Crashed: main 0 UIKit 0x1871100c0 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 324 1 UIKit 0x1871100bc __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 320 2 UIKit 0x1870630c8

UIPopoverPresentationController should have a non-nil sourceView or barButtonItem set before the presentation occurs on iOS 9

一曲冷凌霜 提交于 2019-12-10 16:23:58
问题 I'm trying to show a popup using a custom UIPopoverPresentationController class. But it crashes with the error (<UIPopoverPresentationController: 0x7a772950>) should have a non-nil sourceView or barButtonItem set before the presentation occurs. Below is my button click code where the crash occurs. - (IBAction)showPopup:(UIButton *)sender { ViewController *contentViewController = [[ViewController alloc] init]; contentViewController.preferredContentSize = CGSizeMake(200, 200);

Replacing the UIWindow's rootViewController while using a transition, appears to be leaking

人走茶凉 提交于 2019-12-10 04:28:45
问题 Environment iOS 9.2 Xcode 7.2 I'm looking to replace the UIWindow's rootViewController with an animation while also removing it from the view hierarchy as well. class FooViewController: UIViewController { } class LeakedViewController: UIViewController { } Then initiate the transition in the AppDelegate simply by self.window!.rootViewController = LeakedViewController() let fooViewController = FooViewController() self.window!.rootViewController?.presentViewController(fooViewController, animated

How to use modalPresentationCapturesStatusBarAppearance = NO with a custom UIPresentationController?

半腔热情 提交于 2019-12-07 10:17:16
问题 I have a custom UIPresentationController and overrides frameOfPresentedViewInContainerView for a custom viewController presentation. Everything works fine, except for the status bar. I do not want the status bar to change appearance at all – it should just stay however it looked before. Now the Apple Documentation: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/#//apple_ref/occ/instp/UIViewController/modalPresentationCapturesStatusBarAppearance

Custom size for Modal View loaded with Form Sheet presentation

限于喜欢 提交于 2019-12-03 06:29:11
问题 I'm trying to load a UIViewController in iPad with Form Sheet presentation. The problem is the size of this new view, i put the size values in the IBuilder but the modal view take a fixed value. Also i tried to make this in prepareForSegue like this: HelpViewController *viewController = segue.destinationViewController; viewController.view.superview.frame = CGRectMake(0, 0, 200, 200); But don't work, any help? Thanks! 回答1: For iOS 8, use: self.preferredContentSize = CGSizeMake(width, height);

Custom size for Modal View loaded with Form Sheet presentation

只谈情不闲聊 提交于 2019-12-02 20:05:38
I'm trying to load a UIViewController in iPad with Form Sheet presentation. The problem is the size of this new view, i put the size values in the IBuilder but the modal view take a fixed value. Also i tried to make this in prepareForSegue like this: HelpViewController *viewController = segue.destinationViewController; viewController.view.superview.frame = CGRectMake(0, 0, 200, 200); But don't work, any help? Thanks! Erich For iOS 8, use: self.preferredContentSize = CGSizeMake(width, height); I've placed this in viewDidLoad . Swift 3 self.preferredContentSize = CGSize(width: 100, height: 100)

App crashing on runTransitionForCurrentState but no clue as to why

限于喜欢 提交于 2019-11-30 21:15:50
I've tried searching for this, but no luck, so hoping there are some guru's who may know the answer. I'm seeing loads of reports in iTunes Connect of my app crashing with a particular stack trace, but the stack trace reveals nothing useful. #0. Crashed: main 0 UIKit 0x1871100c0 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 324 1 UIKit 0x1871100bc __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 320 2 UIKit 0x1870630c8 _runAfterCACommitDeferredBlocks + 292 3 UIKit 0x187070a80 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92 4 UIKit

UIPresentationController changes size when another view controller is displayed on top of it

白昼怎懂夜的黑 提交于 2019-11-29 14:48:43
问题 I am presenting a modal view controller using UIPresentationController. I am setting the frame of presentedView less than the containView's bounds using following method: override func frameOfPresentedViewInContainerView() -> CGRect { let myDX = (self.containerView!.bounds.width - 600)/2 let myDY = (self.containerView!.bounds.height - 600)/2 return self.containerView!.bounds.insetBy(dx: myDX, dy: myDY) } Everything works great unto this point. Now, I present another view controller modally