     public var title: String? {
         didSet {
             self.label.text = title
-            setNeedsLayout()
+            self.setNeedsLayout()
         }
     }
     

    internal func setSelected(_ selected: Bool) {
        self.isSelected = selected
        if selected == true {
            DispatchQueue.main.async(execute: {
                self.backgroundColor = self.appearance?.segmentOnSelectionColour
                self.label.textColor = self.appearance?.titleOnSelectionColour
                self.imageView.image = self.onSelectionImage
            })
        }
        else {
            DispatchQueue.main.async(execute: {
                self.backgroundColor = self.appearance?.segmentOffSelectionColour
                self.label.textColor = self.appearance?.titleOffSelectionColour
                self.imageView.image = self.offSelectionImage
            })
        }
    }
    

    }
    
    internal func setupUIElements() {
        if let appearance = self.appearance {
            self.backgroundColor = appearance.segmentOffSelectionColour
            self.label.font = appearance.titleOffSelectionFont
            self.label.textColor = appearance.titleOffSelectionColour
        }
        self.imageView.image = self.offSelectionImage
    }
    
    
