I wrote the following pieces of code:

```
DispatchQueue.main.async {
    self.cameraManager.checkForCameraAuthorization(deniedCallback: {
        self.presentDeniedAlert()
        self.activityIndicator.stopAnimating()
    }) {
        self.cameraAccess = true
        self.cameraButton.isEnabled = false
        self.activityIndicator.stopAnimating()
    }
}

```

and

```
cameraManager.checkForMicrophoneAuthorization(deniedCallback: {
    self.presentDeniedAlert()
        self.activityIndicator.stopAnimating()
    }) {
        DispatchQueue.main.async {
            self.microphoneAccess = true
            self.microphoneButton.isEnabled = false
            self.activityIndicator.stopAnimating()
        }
    }
}

```

(the difference is from where async is called)

The 1. crashes `self.cameraButton.isEnabled = false can only be called from main thread`

The 2. one finishes just fine.

Can someone explain, why this is so?