Unbalanced calls to begin/end appearance transitions for <FirstViewController: 0x2a2c00>

Viewed 96066

I have this problem when I simulate my app, its not an error or a warning but it appears in my console, has anyone ever experienced this before?

25 Answers

Swift 4

My issue was that I was presenting another VC before my current one finished to be rendered .

Solution was to present my nextVC after a quick delay.

WHAT YOU SHOULD NOT DO

override func viewDidLoad() {
    super.viewDidLoad() 
    self.present(MyNextVC(), animated: true, completion: nil)
}

WHAT YOU SHOULD DO

override func viewDidLoad() {
    super.viewDidLoad() 
    //Wait until the view finished to be constructed
    perform(#selector(showMyNextVC), with: nil, afterDelay: 0.01)
}

@objc func showCityList() {
    self.present(MyNextVC(), animated: true, completion: nil)
}
Related