Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

233
Vistas
How to make custom segue with IBInspectable data

I have used IBInspectable in my custom UIViewController, and it works, I can modify the value in interface builder.

However, when I use IBInspectable in my custom UIStoryboardSegue, it does not work, I can't see the variables in interface builder.

Is it impossible to use IBInspectable in a UIStoryboardSegue, or am I doing something wrong?

Here is my code.

class EmbedSegue: UIStoryboardSegue {
    @IBInspectable var childLevel = 0
    override func perform() {
        var container:ContainerVC?
        if childLevel == 0 {
            container = source as? ContainerVC
        } else if childLevel > 0 {
            var target:UIViewController? = source
            for _ in 0..<childLevel {
                target = target?.children.first
                if target == nil {
                    break
                }
            }
            container = target as? ContainerVC
        } else if childLevel < 0 {
            var target:UIViewController? = source
            for _ in 0 ..< -childLevel {
                target = target?.parent
                if target == nil {
                    break
                }
            }
            container = target as? ContainerVC
        }
        guard let _container = container else {
            var vcName = Utility.className(source)
            if let name = source.nibName {
                vcName = name
            }
            print("Unable to perform embed from \(vcName) with child level \(childLevel)")
            return
        }
        _container.embed(destination)
    }
}
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda