Presentación de un controlador de vista mediante programación en Swift
Hola, estoy tratando de convertir el siguiente código objetivo C en rápido para navegar de un controlador de vista a otro controlador de vista cuando se hace clic en un botón. cualquier ayuda sería muy apreciada
Esto está tomado de la guía de programación de Apple
- (void)add:(id)sender {
// Create the root view controller for the navigation controller
// The new view controller configures a Cancel and Done button for the
// navigation bar.
RecipeAddViewController *addController = [[RecipeAddViewController alloc]
init];
// Configure the RecipeAddViewController. In this case, it reports any
// changes to a custom delegate object.
addController.delegate = self;
// Create the navigation controller and present it.
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:addController];
[self presentViewController:navigationController animated:YES completion: nil];
}
mi código se indica a continuación, pero no estoy seguro de cómo implementarlo en el controlador de navegación, en el guión gráfico mi mainSectionViewController está incrustado con un controlador de navegación
func sectionBtnClicked (sender: UIButton!) {
let sectionController = self.storyboard?.instantiateViewControllerWithIdentifier("mainSectionsVC") as mainSectionViewController
let navController = UINavigationcontroler. ///not sure what actually comes here, any help would be appreciated
self.presentViewController(navController, animated: true, completion: nil)
}