This is a SwiftUI resizing text view for iOS and macOS.
// Resizing automatically
ResizingTextView(
text: $text1,
isScrollable: true,
canHaveNewLineCharacters: true)
// Fixed-height, newline characters not allowed
ResizingTextView(
text: $text2,
placeholder: "Placeholder",
isScrollable: true,
canHaveNewLineCharacters: false)
// Uneditable, selectable, color/font changed
ResizingTextView(
text: $text3,
isEditable: false,
font: .boldSystemFont(ofSize: 16),
foregroundColor: .magenta)
// Uneditable, selectable, max 2 lines
ResizingTextView(
text: .constant("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
isEditable: false,
lineLimit: 2)
https://user-images.githubusercontent.com/1333214/184529544-7165dea5-4d51-40b3-a2de-d887aa24a5a4.mov
https://user-images.githubusercontent.com/1333214/184529535-ce92376b-ad31-47e5-8a0a-f79f60068ff5.mov
link |
Stars: 8 |
Last commit: 6 weeks ago |
I incremented the major version number because I added a change that may be breaking for those who use textContainerInset
for a macOS app.
Details: https://github.com/mshibanami/ResizingTextView/pull/3
I don't know who uses it, though.
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics