CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.
TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | May 2015 |
SPMSupports SPM | ✗ |
Maintained by Danilo Bürger, Freeletics.
FLTextView adds a placeholder to UITextView just like UITextField natively provides. Compared to other similar libraries we allow the ability to grow (in height or content size) the area of UITextView depending on the size of the placeholder.
Download FLTextView and try out the iPhone example app.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'FLTextView/Legacy', '~> 1.0'
CocoaPods only supports Swift source files for iOS 8.0+ Deployment Targets. That is why after you have installed the pods you will have to manually include the folder Pods/FLTextView/FLTextView
in your Xcode project as a group.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'FLTextView', '~> 1.0'
After editing your Podfile, run the following command:
$ pod install
You can either configure FLTextView through Interface Builder (see examples) or use it like this:
let textView = FLTextView(frame: CGRectZero, textContainer: nil)
textView.placeholder = "ClapClap"
textView.placeholderTextColor = UIColor.lightGrayColor()
Attributed strings are also supported:
let placeholder = NSMutableAttributedString(string: "No excuses")
placeholder.addAttribute(NSForegroundColorAttributeName, value: UIColor(white: 0.7, alpha: 1.0), range: NSMakeRange(0, 10))
placeholder.addAttribute(NSStrikethroughStyleAttributeName, value: NSUnderlineStyle.StyleDouble.rawValue, range: NSMakeRange(3, 7))
placeholder.addAttribute(NSUnderlineStyleAttributeName, value: NSUnderlineStyle.StyleSingle.rawValue, range: NSMakeRange(0, 2))
textView.attributedPlaceholder = placeholder
FLTextView is available under the MIT license. See the LICENSE file for more info.