diff --git a/Spring/DesignableTextField.swift b/Spring/DesignableTextField.swift index ecaf442..d209fa9 100644 --- a/Spring/DesignableTextField.swift +++ b/Spring/DesignableTextField.swift @@ -26,7 +26,9 @@ import UIKit @IBInspectable public var placeholderColor: UIColor = UIColor.clear { didSet { - attributedPlaceholder = NSAttributedString(string: placeholder!, attributes: [NSForegroundColorAttributeName: placeholderColor]) + guard let placeholder = placeholder else { return } + + attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [NSForegroundColorAttributeName: placeholderColor]) layoutSubviews() }