Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
How to perform an unwind segue from a custom tableview cell?

I'm trying to trigger a unwind segue from a button that is inside a custom table view cell. But it won't let me create the link between the exit and the view controller.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This sounds like a good job for a protocol/delegate pattern. What I would do is:

  1. Create your unwind segue by connecting it to the viewcontroller not to the tableViewCell. Assign it an identifier you can use later

  2. Create a protocol to which the MyViewController will conform

     protocol unwindHandler{
        func didRequestUnwind()
     }
    
  3. Implement the protocol in the MyViewController

     extension MyViewController : unwindHandler{
         func didRequestUnwind(){
    
             performSegue(withIdentifier:"myUnwind",sender:nil)//execute the segue with identifier assigned in 0
         }
     }
    
  4. Assign the ViewController as the delegate to the tableViewCell in cellForRowAt in the datasource of the tableView

  5. Call delegate?.didRequestUnwind() in the didSelectRowAtIndexPath for the cell(s) you want to have that capability

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda