Apresentando um Controlador de Visualização Programaticamente em Rápido
Oi Estou tentando converter o seguinte código objetivo C em swift para navegar de um controlador de exibição para outro controlador de exibição quando um botão é clicado. qualquer ajuda seria muito apreciada
Isto é retirado do guia de programação da 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];
}
meu código é indicado abaixo, mas não tenho certeza de como implementar no controlador de navegação, no storyboard meu mainSectionViewController está incorporado a um controlador de navegação
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)
}