2

Hide IBInspectable Variables

IMAGE

This is how it looks

Also I want to know if it is possible to make an enum of strings.

I'm working with Swift 2.2 and Swift 3

@IBDesignable class example : some class {
    @IBInspectable var makeMagic : bool = false
    @IBInspectable var variable1 : String = ""
    @IBInspectable var variable2 : String = ""
    @IBInspectable var variable3 : String = ""

    override func awakeFromNib() {
        super.awakeFromNib()
        checkTheMagic()
    }

    func checkTheMagic () {
        if(makeMagic == false){
            //DONT SHOW THE OTHERS IBINSPECTABLE VARS
        } else {
            //SHOW
        }
    }
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
David Castro
  • 193
  • 1
  • 6

0 Answers0