Stretching- und Kerning-Typ, funktioniert nicht in Storyboard mit @ IBDesignable

Hier ist einIBLabel welche verfolgt / streckt die Schriftart.

Es funktioniert einwandfrei im Build. Die Änderung wird jedoch nicht live im Storyboard angezeigt.

// UILabel, but you can set
// the tracking (that's the overall amount of space between all letters)
// and streching (actually squeeze or stretch the letters horizontally)
// Note: it's very common that typographers need you to adjust these.

import UIKit

@IBDesignable
class StyledLabel: UILabel
    {
    @IBInspectable var tracking:CGFloat = 0.8
    // values between about 0.7 to 1.3.  one means normal.

    @IBInspectable var stretching:CGFloat = -0.1
    // values between about -.5 to .5.  zero means normal.

    override func awakeFromNib()
        {
        let ats = NSMutableAttributedString(string: self.text!)
        let rg = NSRange(location: 0, length: self.text!.characters.count)

        ats.addAttribute(
            NSKernAttributeName, value:CGFloat(tracking), range:rg )

        ats.addAttribute(
            NSExpansionAttributeName, value:CGFloat(stretching), range:rg )

        self.attributedText = ats
        }
    }

Simulator auf der rechten Seite funktioniert perfekt.

Wird im Storyboard nicht live angezeigt (siehe links).

Wild Rate mal, fehlt mir eine Initialisierungsfunktion?

der woran könnte das liege

Hinweis - Schriftgröße passend zur Höhe einstellen:

Möglicherweise möchten Sie die Schriftgröße so einstellen, dass sie den Beschriftungsrahmen auf allen Geräten ausfüllt. Um Ihnen das Tippen zu ersparen, gibt es hier eine Klasse, die "Point for Height", Tracking und Stretching ausführt:https: //stackoverflow.com/a/37277874/29488

Antworten auf die Frage(2)

Ihre Antwort auf die Frage