0

The presenting ViewController seems to load, but the screen is actually not reloading. After I touch the screen the ViewController is visible. This is my instantiateViewController code:

let v = self.storyboard?.instantiateViewController(withIdentifier: "BrowsingDaragaViewController") as! BrowsingDaragaViewController
self.present(v, animated: true, completion: nil)

In the BrowsingDaragaViewController is no additional code. The viewDidAppear() function is not called until I touch the screen. I'm using Xcode 9 with Swift4.

edit:

presentation code is in tableview(didSelectedRow at indexPath) but when i but it in button action it works fine

Ahmad Labeeb
  • 1,056
  • 11
  • 21

1 Answers1

1

If you have used any gesture recogniser then remove it and check if it causing the problem?

And if You are not using gesture recogniser then use below code in didSelectRowAtIndexPath

// Your stuff
DispatchQueue.main.async(execute: {
   self.present(yourViewControllerHere, animated: true, completion: nil)
})
// Your stuff

OR

Still facing issue then make sure you tableView has single selection set in your XIB or StoryBoard.

iPatel
  • 46,010
  • 16
  • 115
  • 137