When I receive a remote notification on a record addition (didReceiveRemoteNotification called), I get the following error message:
_BSMachError: (os/
For Swift 5, I ended up with:
func alertAction() { DispatchQueue.main.async { //perform code } }