In my UI test, I have a test where I am using the UIPasteboard to throw the input around. Just before I use it, I store the current value of the pasteboard into a local temporary variable like so: let currentClipboard = UIPasteboard.general.string ?? ""
and it will be restored again at the end of the test like so: UIPasteboard.general.string = currentClipboard
. However, sometimes the let currentClipboard = UIPasteboard.general.string ?? ""
line takes forever to complete, if at all. I've waited like 1-2 minutes and it still stuck there. I know this because I actually added a breakpoint right below that line and it was never called. Can anybody tell me what's wrong with my code? Thanks.
I've faced the same issue in the simulator only. If you're testing in simulator then just reset the simulator and it'll start working fine. And I didn't find this type of issue in the real device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With