2

I updated my project to Swift 5 in Xcode 11 and now the program freezes at my animation blocks in the iPhone 11 simulator. When I set a breakpoint after the animation it never hits it. Restarting Xcode and the Simulator did not solve the issue. If I run the program on a device it works fine.

Any ideas about what's going on? Maybe a memory issue?

UIView.animate(withDuration: 1, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.5, options: [UIView.AnimationOptions.curveEaseIn], animations: {

    self.introTextView.transform = self.introTextView.transform.translatedBy(x: 200, y: 0)
})
Ben
  • 3,346
  • 6
  • 32
  • 51
  • That is the exact code that runs where the program just stops. It worked perfectly fine before the update. If I take out this animation there's another animation block after it and it would just stop right there at the next one. – Ben Oct 02 '19 at 12:48
  • I understand your point @matt. Thanks for trying to help. I'm 99% sure I've got a corner case because I don't see anyone else bringing up this issue now or when Xcode 11 was in beta. – Ben Oct 02 '19 at 13:47

2 Answers2

2

Apparently it's a bug on the Simulator. Hopefully it will be solved soon, but until then, you can fix by unchecking the pasteboard option.

Simulator -> Edit -> Automatically Sync Pasteboard.

From this helpful answer here.

Marina Aguilar
  • 1,151
  • 9
  • 26
0

After restarting my computer everything now seems to be working fine. If that changes I will report back in case anyone else runs into the same issue.

UPDATE: Unfortunately it's a temporary fix. After a while, the simulator freeze issue starts again and I need to restart to get it working properly.

Additional UPDATE: After updating to the newest version of Xcode the issue went away.

Ben
  • 3,346
  • 6
  • 32
  • 51
  • 1
    Hi @Ben sorry to hear about this; it sounds like maybe it's a simulator bug. I have two suggestions: (1) update to a newer version of Xcode, and (2) if the problem persists, try to reproduce it in a small project and file a bug report with Apple. – matt Oct 04 '19 at 01:00
  • Thanks @matt. I'm using the latest version of Xcode (non beta) at the moment (11.0 - 11A420a). Thanks for the encouragement to file a bug report. – Ben Oct 04 '19 at 01:06
  • 1
    Well, that is not the latest non beta version; 11.1 is. And you might also try 11.2 beta which is also out. Of course I don't promise either of them fixes this, but there is no point filing the bug if they do. :) – matt Oct 04 '19 at 01:50
  • Good to know. Thanks! – Ben Oct 04 '19 at 01:51