Created
May 28, 2015 09:04
-
-
Save hartbit/9b47de73ac5fc74f0291 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
//: Playground - noun: a place where people can play | |
import UIKit | |
protocol PlaceholderText : class, UITextInputTraits { | |
var placeholder: String? { get set } | |
} | |
extension UITextField: PlaceholderText { } | |
extension UITextView: PlaceholderText { | |
var placeholder: String? { | |
get { return "" } | |
set { } | |
} | |
} | |
var textFieldOrView: PlaceholderText = UITextView() | |
textFieldOrView.placeholder = "Placeholder" | |
textFieldOrView.autocapitalizationType = .Words // Compilation Error: Cannot assign to the result of this expression |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment