0

![estuve creando esta aplicacion, que pasa de una pantalla de inicio de sesion y pude vincular el storyboard con el viewController, pero al pasar a la segunda pantalla, no me permite vincular las vistas con el codigo][1]alguien podria ayudarme con este error?, no me permite vincular las vistas con el viewController, ni con la pantalla dividida ni desde codigo

    //
//  HomeViewController.swift
//  
//
//  Created by  on 13/10/22.
//

import UIKit

enum ProviderType: String{
    case basic
}

class HomeViewController: UIViewController {
    
    @IBOutlet weak var emailLabel: UILabel!
    @IBOutlet weak var providerLabel: UILabel!
    @IBOutlet weak var closeSessionButton: UIButton!
    
    private let email: String
    private let provider: ProviderType
    
    init(email: String, provider: ProviderType) {
        self.email = email
        self.provider = provider
        super.init(nibName: nil, bundle: nil)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        title = "Inicio"
    }
    
    @IBAction func closeSessionButtonAction(_ sender: Any) {
    }
    
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}

[1]

2
  • seria bueno que cambiaras la imagen a código, me refiero a la parte que contiene el código el 16 oct. 2022 a las 14:22
  • En HomeViewController no puedes agregar ningún elemento (botones, labels)? En el storyboard tienes agregado en el View Controller la clase HomeViewController?
    – Bicho
    el 17 oct. 2022 a las 13:19

1 respuesta 1

0

Analiza que la segunda Storyboard tenga asignado el ViewController desde el cual la quieras manejar. Crea el VierwController utilizando Cocoa Touch Class y te ahorras problemas.

Si ello no funciona, prueba lo siguiente:

  1. Crea un nuevo Storyboard file;
  2. Copia el scene que hiciste anteriormente y pegalo dentro;
  3. Elimina el scence en blanco y asignale el ViewController correcto;
  4. Por último elima el storyboard file anterior.

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.