     private var _campo:UITextField!
     private var _error:UILabel!
     private var _contenedor:UIView!
+    private var _viewIzquierda:UIView!
     
     //MARK: VARIABLES DE PADDING DEL CONTENEDOR
     @IBInspectable var paddingSuperior:CGFloat = 0.0{

        }
    }
    
    /// FUNCION QUE CONFIGURA EL CAMPO DE TEXTO
    @available(iOS 9.0, *)
    private func configurarCampoTexto(){
        self.configurarCampoTextoYErrorTamano()
        self.configurarPlaceholder()
    }


    @available(iOS 9.0, *)
    private func configurarCampoTextoYErrorTamano(){
        
        self.subviews.forEach { (vista) in
            vista.removeFromSuperview()
        }
        
        self._campo = UITextField()

        self._error.topAnchor.constraint(equalTo: self._contenedor.topAnchor).isActive = true
        self._error.heightAnchor.constraint(equalTo: self._contenedor.heightAnchor, multiplier: 0.3).isActive = true
        
        self._error.textAlignment = .right
        
        self._campo.leadingAnchor.constraint(equalTo: self._contenedor.leadingAnchor).isActive = true
        self._campo.trailingAnchor.constraint(equalTo: self._contenedor.trailingAnchor).isActive = true
        self._campo.bottomAnchor.constraint(equalTo: self._contenedor.bottomAnchor).isActive = true
        self._campo.topAnchor.constraint(equalTo: self._error.bottomAnchor).isActive = true
        
        //self._campo.backgroundColor = .red
        //self._error.backgroundColor = .yellow
    }
    
    func configurarPlaceholder(){
        if self._campo != nil{
            self._campo.placeholder = self._tipo.placeholder()
        }
    }
    
    func configurarImagenIzquierda(){
        self._viewIzquierda = UIView()
        self._viewIzquierda.translatesAutoresizingMaskIntoConstraints = false
        self._contenedor.addSubview(self._viewIzquierda)
        self._viewIzquierda.heightAnchor.constraint(equalTo: self._contenedor.heightAnchor, multiplier: 0.7).isActive = true
        let const = imagenIzquierda.size.width / imagenIzquierda.size.height
        self._viewIzquierda.widthAnchor.constraint(equalTo: self._viewIzquierda.heightAnchor, multiplier: const).isActive = true
        self._viewIzquierda.backgroundColor = .clear
        let bgn = UIImageView(image: imagenIzquierda)
        bgn.translatesAutoresizingMaskIntoConstraints = false
        self._viewIzquierda.addSubview(bgn)
        bgn.topAnchor.constraint(equalTo: self._viewIzquierda.topAnchor).isActive = true
        bgn.bottomAnchor.constraint(equalTo: self._viewIzquierda.bottomAnchor).isActive = true
        bgn.leadingAnchor.constraint(equalTo: self._viewIzquierda.leadingAnchor).isActive = true
        bgn.trailingAnchor.constraint(equalTo: self._viewIzquierda.trailingAnchor).isActive = true
        self._campo.leftViewMode = .always
        self._campo.leftView = self._viewIzquierda
    }
    
    func configurarLetraCampo(){
        if self._campo != nil{
            self._campo.placeholder = self._tipo.placeholder()
            self._campo.font = self._fuente
        }
    }
    func existeFuente(nombre:String)->Bool{
        let fontFamilyNames = UIFont.familyNames
        for familyName in fontFamilyNames {
            print("Familia \(familyName): ")
            for fuente in UIFont.fontNames(forFamilyName: familyName){
                print(fuente)
                if fuente == nombre{
                    return true
                }
            }
        }
        return false
    }
}
enum HGTextInputType{
    
