Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominatorVbN/9fbc8b71d3d4bade35d4df6e16744a35 to your computer and use it in GitHub Desktop.
Save DominatorVbN/9fbc8b71d3d4bade35d4df6e16744a35 to your computer and use it in GitHub Desktop.
//
// UITextField+placeholdetTextColor.swift
// Textfield place holder color changer
//
// Created by mac on 22/08/19.
// Copyright © 2019 Dominator. All rights reserved.
//
import UIKit
extension UITextField{
@IBInspectable var placeHolderColor: UIColor? {
get {
return self.placeHolderColor
}
set {
self.attributedPlaceholder = NSAttributedString(string:self.placeholder != nil ? self.placeholder! : "", attributes:[NSAttributedString.Key.foregroundColor: newValue!])
setNeedsLayout()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment