Back to rankings

FluidGroup/NextGrowingTextView

Swift

📝 The next in the generations of 'growing textviews' optimized for iOS 8 and above.

ioscarthagexcodetextviewcocoapodshacktoberfest
Star Growth
Stars
1.8k
Forks
148
Weekly Growth
Issues
28
5001k1.5k
Dec 2015Jun 2019Jan 2023Jul 2026
README

NextGrowingTextView
(An Essential UI component for input text)

Example

💡
Displaying the user-interface on top of the keyboard
muukii/Bureau enables you to show your user-interface on top of the keyboard in the easiest way.

Usage

SwiftUI

The Swift Package product NextGrowingTextViewSwiftUI provides a pure SwiftUI implementation for iOS 17 and later. It measures a hidden TextEditor with the same font, line spacing, and padding as the visible editor, then applies the measured height to the visible editor.

import NextGrowingTextViewSwiftUI

@State private var text = ""

GrowingTextEditor(
  text: $text,
  placeholder: "Write something...",
  configuration: GrowingTextEditorConfiguration(
    minLines: 1,
    maxLines: 6,
    horizontalPadding: 8,
    verticalPadding: 4,
    lineSpacing: 3
  ),
  font: .body
)

GrowingTextView is also available as a typealias when call sites prefer the TextView naming.

UIKit

Use the NextGrowingTextView product when you need a UIKit UIView backed by UITextView. Configure the line limits, style the inner textView, and set up the placeholder label to match your design.

import NextGrowingTextView
import UIKit

let growingTextView = NextGrowingTextView()

growingTextView.configuration = .init(
  minLines: 1,
  maxLines: 6,
  isAutomaticScrollToBottomEnabled: true,
  isFlashScrollIndicatorsEnabled: true
)

growingTextView.textView.font = .preferredFont(forTextStyle: .body)
growingTextView.placeholderLabel.text = "Write something..."
growingTextView.placeholderLabel.font = growingTextView.textView.font
growingTextView.placeholderLabel.textColor = .placeholderText

growingTextView.actionHandler = { action in
  switch action {
  case .willChangeHeight(let newHeight):
    print("Will change height:", newHeight)
  case .didChangeHeight(let newHeight):
    print("Did change height:", newHeight)
  case .didChangeState:
    break
  }
}

Author

muukii

License

NextGrowingTextView is available under the MIT license. See the LICENSE file for more info.

Related repositories
flutter/flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

DartBSD 3-Clause "New" or "Revised" Licensemobileandroid
flutter.dev
177.9k30.7k
react/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
126.2k25.2k
facebook/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
120.9k24.5k
rustdesk/rustdesk

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

Rustcrates.ioGNU Affero General Public License v3.0remote-controlremote-desktop
rustdesk.com
118.6k18.1k
justjavac/free-programming-books-zh_CN

:books: 免费的计算机编程类中文书籍,欢迎投稿

GNU General Public License v3.0pythonjavascript
weibo.com/justjavac
117.7k28.2k
Solido/awesome-flutter

An awesome list that curates the best Flutter libraries, tools, tutorials, articles and more.

Dartflutterawesome-list
60.7k6.9k
FiloSottile/mkcert

A simple zero-config tool to make locally trusted development certificates with any names you'd like.

GoGo ModulesBSD 3-Clause "New" or "Revised" Licensehttpstls
mkcert.dev
59.4k3.1k
appwrite/appwrite

Appwrite® - complete cloud infrastructure for your web, mobile and AI apps. Including Auth, Databases, Storage, Functions, Messaging, Hosting, Realtime and more

TypeScriptnpmBSD 3-Clause "New" or "Revised" Licenseappwritedocker
appwrite.io
56.6k5.6k
google/material-design-icons

Material Design icons by Google (Material Symbols)

Apache License 2.0materialmaterial-design
google.github.io/material-design-icons/
53.6k9.7k
vsouza/awesome-ios

A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

SwiftMIT Licenseawesomeswift-library
awesomeios.dev
52.8k7k
ionic-team/ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

TypeScriptnpmMIT Licenseionicmobile
ionicframework.com
52.6k13.3k
dkhamsing/open-source-ios-apps

:iphone: Collaborative List of Open-Source iOS Apps

Creative Commons Zero v1.0 Universaliosswift
51.3k6k