How to close the SideBar menu manually when using SWRevealViewController ( ios)

I just figured out the answer. I just use the following code to hide the side bar.

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
   if (buttonIndex == 0) {
    [self.revealViewController revealToggleAnimated:YES];

   }
}

The correct answer is:

self.revealViewController().revealToggle(animated: true)

If anyone is looking for a swift version, just use this single line:

self.revealViewController().revealToggleAnimated()