Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 9 Segue Causes App To Freeze (no crash or error thrown)

I have been working on this app for months now and from as far back as I can remember I have never had an issue with segues. The code is unchanged in terms of calling performSegueWithIdentifier but since my recent update to Xcode 7 and iOS 9 I have not been able to tack this issue.

I have tried:

  • Deleting button and creating new button w/ segue link
  • Using a direct segue from button to view, without the use of performSegueWithIdentifier
  • Connecting button to new blank viewController

When I press the button, no initial load functions are called on the destination VC (Ex: ViewDidLoad, ViewWillAppear, etc). When I connect it to a blank view, the segue works fine with the same code in place.

Since the code never stops, or breaks, and just seems to "freeze" in place while still running on Xcode I can't seem to even narrow this down to whats causing the issue. I have a similar segue that is also called from another button on the same ViewController that has no issues whatsoever.

Any thoughts on the matter are greatly appreciated!

EDIT: I have narrowed the issue down to the UITextView's causing the problem. Once the Text Views were removed the page loads fine via segue. I wonder what changed between iOS 8 and iOS 9 in terms of UITextView as I will have to remove the text views and completely re add new text views.

like image 811
Zachary Khan Avatar asked Sep 18 '15 04:09

Zachary Khan


1 Answers

So basically the segue was freezing because of the UITextView's I was using in the destinationViewController. The following fixed the issue:

  • Delete all UITextView's
  • Add new UITextView's
    • you must leave the default lorem imposed text and change this programmatically in the viewDidLoad()

This was the fix for me, and from the research I have done on the issue it seems this is a bug in iOS 9 and Xcode 7.

Cheers!


NOTE: Removing the text in the UITextView (or making it longer then ~12 characters) is sufficient to work around it, no need to delete and recreate them. This is fixed in Xcode 7.1.1 and later.

like image 88
Zachary Khan Avatar answered Oct 21 '22 08:10

Zachary Khan