dismissModalViewController AND pass data back

You need to use delegate protocols… Here’s how to do it: Declare a protocol in your secondViewController’s header file. It should look like this: #import <UIKit/UIKit.h> @protocol SecondDelegate <NSObject> -(void)secondViewControllerDismissed:(NSString *)stringForFirst @end @interface SecondViewController : UIViewController { id myDelegate; } @property (nonatomic, assign) id<SecondDelegate> myDelegate; Don’t forget to synthesize the myDelegate in your implementation (SecondViewController.m) … Read more

Swift Modal View Controller with transparent background [duplicate]

You can do it like this: In your main view controller: func showModal() { let modalViewController = ModalViewController() modalViewController.modalPresentationStyle = .overCurrentContext presentViewController(modalViewController, animated: true, completion: nil) } In your modal view controller: class ModalViewController: UIViewController { override func viewDidLoad() { view.backgroundColor = UIColor.clearColor() view.opaque = false } } If you are working with a storyboard: … Read more

presentViewController and displaying navigation bar

It is true that if you present a view controller modally on the iPhone, it will always be presented full screen no matter how you present it on the top view controller of a navigation controller or any other way around. But you can always show the navigation bar with the following workaround way: Rather … Read more

iOS: Modal ViewController with transparent background

For those trying to get this to work in iOS 8, the “Apple-approved” way to display a transparent modal view controller is by setting modalPresentationStyle on the presented controller to UIModalPresentationOverCurrentContext. This can be done in code, or by setting the properties of the segue in the storyboard. From the UIViewController documentation: UIModalPresentationOverCurrentContext A presentation … Read more

Disable the interactive dismissal of presented view controller

Option 1: viewController.isModalInPresentation = true (Disabled interactive .pageSheet dismissal acts like this.) Since the iOS 13, UIViewController contains a new property called isModalInPresentation which must be set to true to prevent the interactive dismissal. It basically ignores events outside the view controller’s bounds. Bear that in mind if you are using not only the automatic … Read more

Presenting modal in iOS 13 fullscreen

With iOS 13, as stated in the Platforms State of the Union during the WWDC 2019, Apple introduced a new default card presentation. In order to force the fullscreen you have to specify it explicitly with: let vc = UIViewController() vc.modalPresentationStyle = .fullScreen //or .overFullScreen for transparency self.present(vc, animated: true, completion: nil)

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