Question: Im new to ASP. can any body give the sample code for select all the checkbox while selecting one checkbox from the check box list. 

Select All

A

B

C

once checking the select all check from the checkbox list all other items also should get selected.

Answer: 
From Apple [documentations](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621505-dismiss):

> 
> The presenting view controller is responsible for dismissing the view controller it presented
> 
> 
> 

Thus, it is a bad practise to just invoke the [dismiss](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621505-dismiss) method from it self.

What you should do if you're presenting it modal is:

```
presentingViewController?.dismiss(animated: true, completion: nil)

```
Since you used push presented viewController, therefore, you can use

```
self.dismiss(animated: false, completion: nil)

```