presentviewcontroller

Closing only the ImagePicker and passing image to ScrollViewController

瘦欲@ 提交于 2020-01-07 02:16:32
问题 I have an ImagePicker that is displayed after a ScrollViewController is presented (1). Question: Once the image is picked from the ImagePicker , how do I dismiss just the ImagePicker so that the ScrollViewController is displayed and then pass the image picked to the ScrollViewController ? (1) Presenting ScrollViewController and ImagePicker let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard.instantiateViewControllerWithIdentifier("ScrollViewControllerID") as!

iOS Swift : SlidingMenuView wrong Position after presenting imagePicker

佐手、 提交于 2020-01-06 19:15:29
问题 I am using PageMenu in my project within a TabBar Controller and a Navigation Controller. When I initialize the "Scrolling menu" I use this to display it under the statusBar and the navigation bar : pageMenu = CAPSPageMenu(viewControllers: controllerArray, frame: CGRectMake(0, UIApplication.sharedApplication().statusBarFrame.size.height + self.navigationController!.navigationBar.frame.height, self.view.frame.width, self.view.frame.height), options: parameters) This solution is working

iOS Swift : SlidingMenuView wrong Position after presenting imagePicker

被刻印的时光 ゝ 提交于 2020-01-06 19:11:01
问题 I am using PageMenu in my project within a TabBar Controller and a Navigation Controller. When I initialize the "Scrolling menu" I use this to display it under the statusBar and the navigation bar : pageMenu = CAPSPageMenu(viewControllers: controllerArray, frame: CGRectMake(0, UIApplication.sharedApplication().statusBarFrame.size.height + self.navigationController!.navigationBar.frame.height, self.view.frame.width, self.view.frame.height), options: parameters) This solution is working

Will multiple presentViewController method calls throughout the view controllers lead to memory leak in iOS?

断了今生、忘了曾经 提交于 2020-01-03 17:15:08
问题 I know there has been a lot of discussions occurred related to this topic. But in all discussions all have discussed with 2 view controllers (A&B). My scenario is similar but different. What will happen when there are multiple view controllers like A,B,C,D. So the presenting flow moves as , View controller A (Home) presents View controller B(List). Then from View controller B presents View Controller C (Details).Then from View Controller C presents View Controller D(Advanced Details). Then

AppDelegate segue alternative pass data

为君一笑 提交于 2020-01-03 05:06:05
问题 I am struggling with passing data from my appDelegate to one of my view controllers. I have tried to use segues to do this, but this just doesn't work. So what I am wondering about is; is there any other way to present another view controller and pass data to it, other than using segues? Thanks in advance. 回答1: You can't use segue to ViewController from AppDelegate , because AppDelegate is not a ViewController . Segues are only work with ViewControllers . But you can initiate a storyboard

How to present a view controller with smaller size

可紊 提交于 2020-01-01 13:19:32
问题 I want presented view controller vc2 in smaller size than the screen, how to do that in Swift 3 ?? Thanks for help. This is my code: @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?.instantiateViewController(withIdentifier: "Controller2") as! ViewController2 vc2.modalPresentationStyle = .currentContext present(vc2, animated: true, completion: nil) } 回答1: Try this.. @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?

How to present a view controller with smaller size

a 夏天 提交于 2020-01-01 13:18:51
问题 I want presented view controller vc2 in smaller size than the screen, how to do that in Swift 3 ?? Thanks for help. This is my code: @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?.instantiateViewController(withIdentifier: "Controller2") as! ViewController2 vc2.modalPresentationStyle = .currentContext present(vc2, animated: true, completion: nil) } 回答1: Try this.. @IBAction func leftButtonPressed(_ sender: UIButton) { let vc2 = self.storyboard?

presentViewController does not show Tab Bar or Navigation Bar

坚强是说给别人听的谎言 提交于 2019-12-31 05:12:06
问题 I am new to Swift and have been struggling with this for a while. I am trying to redirect users based on login status to either "Login" viewcontroller or "Home" viewcontroller. "Home" viewcontroller has NavigationBar and TabBar and it shows a table. But, when i use the following code, i see only the table. NavigationBar and TabBar are not shown at all. var view = self.storyboard?.instantiateViewControllerWithIdentifier("HomeViewController") as UIViewController self.presentViewController(view,