A simple UITextView. But with placeholder.
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
Once you have your Swift package set up, add SwiftPlaceholderTextView to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/giuseppebruno/SwiftPlaceholderTextView.git", .upToNextMajor(from: "1.0.0"))
]
Add a UIView
from the Storyboard and subclass as SwiftPlaceholderTextView
or create a SwiftPlaceholderTextView
view programmatically.
import SwiftPlaceholderTextView
...
let spt = SwiftPlaceholderTextView()
spt.placeholder = "Insert text..."
You can customize the TextView as follow:
cornerRadius
: TextView corner radius. Default: 8borderWidth
: TextView border width. Default: 1borderColor
: TextView border color. Default: blackplaceholderFont
: TextView placeholder font. Default: system fontplaceholderTextColor
: TextView placeholder text color. Default: #CACACCfont
: TextView text font. Default: system fonttextColor
: TextView text color. Default: blackreturnKeyType
: TextView return buttonkeyboardType
: TextView keyboard typereturnKeyShouldDismissKeyboard
: Return key should dismiss keyboard. Default: trueWe welcome all contributions. If you found a bug, feel free to open an issue. If you want to contribute, submit a pull request.
SwiftPlaceholderTextView is developed by Giuseppe Bruno.
SwiftPlaceholderTextView is released under the MIT license. See LICENSE for details.
link |
Stars: 0 |
Last commit: 19 weeks ago |
Allow placeholder to wrap
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics