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 you image it seems like you presented the ViewController using push

The `dismissViewControllerAnimated` is used to close ViewControllers that presented using modal

**Swift 2**

```
navigationController.popViewControllerAnimated(true)

```

**Swift 4**

```
navigationController?.popViewController(animated: true)

dismiss(animated: true, completion: nil)

```
If you are presenting a ViewController modally, and want to go back to the root ViewController, take care to dismiss this modally presented ViewController before you go back to the root ViewController otherwise this ViewController will not be removed from Memory and cause Memory leaks.