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
TextViewWithPlaceholder
UITextView
with a placeholder.Using UIKitComponents in your project
To use the
UIKitComponents
library in a SwiftPM project, add the following line to the dependencies in yourPackage.swift
file:and add
UIKitComponents
as a dependency for your target:Finally, add
import UIKitComponents
in your source code.