Created
August 22, 2019 10:41
-
-
Save DominatorVbN/9fbc8b71d3d4bade35d4df6e16744a35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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