I'm attempting to perform a storyboard segue inside of a completion handler like so:
movieWriter.finishRecordingWithCompletionHandler({ () -> Void in
//Leave this view
self.performSegueWithIdentifier("decisionSegue", sender: self)
})
and getting the following warning:
This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release.
The completion handler is running on a background so I understand why I'm getting this error, my question is what are my options for performing this segue without getting this error?
The reason I'm performing the segue in the completion handler is that the completion handler is called after a recorded movie is done being written to file and the view being segued to plays the movie, hence it needs to be on file before segueing.