Swiftpack.co - mshibanami/ResizingTextView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by mshibanami.
mshibanami/ResizingTextView 2.1.0
A (non)selectable, single-line/multi-line, (non)self-sizing, (non)scrollable, (un)editable text view for iOS and macOS.
⭐️ 8
🕓 6 weeks ago
iOS macOS
.package(url: "https://github.com/mshibanami/ResizingTextView.git", from: "2.1.0")

ResizingTextView

This is a SwiftUI resizing text view for iOS and macOS.

Usage

// 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)

Demo

iOS

https://user-images.githubusercontent.com/1333214/184529544-7165dea5-4d51-40b3-a2de-d887aa24a5a4.mov

macOS

https://user-images.githubusercontent.com/1333214/184529535-ce92376b-ad31-47e5-8a0a-f79f60068ff5.mov

Apps that use this package

GitHub

link
Stars: 8
Last commit: 6 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

2.0.0
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