let textView = TextViewWithPlaceholder()
textView.placeholder = "email@example.com"
// The appearance of the placeholder follows that of text view.
textView.font = .preferredFont(forTextStyle: .body)
textView.textAlignment = .center
textView.textContainerInset = .zero
textView.textContainer.lineFragmentPadding = 0
// etc...
Using UIKitComponents in your project
To use the UIKitComponents library in a SwiftPM project, add the following line to the dependencies in your Package.swift file:
UIKitComponents
Reusable UI components built with UIKit.
Requirements
Components
TextViewWithPlaceholderUITextViewwith a placeholder.Using UIKitComponents in your project
To use the
UIKitComponentslibrary in a SwiftPM project, add the following line to the dependencies in yourPackage.swiftfile:and add
UIKitComponentsas a dependency for your target:Finally, add
import UIKitComponentsin your source code.