Swiftpack.co - HumorousGhost/TextView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by HumorousGhost.
HumorousGhost/TextView v1.0.2
swifui UITextView
⭐️ 0
🕓 1 week ago
iOS watchOS tvOS
.package(url: "https://github.com/HumorousGhost/TextView.git", from: "v1.0.2")


This project is only for SwiftUI

Due to the incomplete functions of TextEditor in SwiftUI, such as keyboardType setting, etc.,

UITextView is encapsulated for developers to use

Features will continue to be updated



Supported Platforms

  • iOS 13.0
  • macOS 10.15
  • tvOS 13.0
  • watchOS 6.0


import SwiftUI
import TextView

struct ContentView: View {
    @State var text: String = ""
    var body: some View {
        TextView($text, isTextCenter: true)
            .font(UIFont.systemFont(ofSize: 12))
                print("did begin editing")
                print("did end editing")
                print("should begin editing")
                return true
                print("should end editing")
                return true
            .onSubmit({ returnKeyType in
                print("click keyboard input button")
                return true
            .frame(width: 200, height: 100, alignment: .center)


You can add TextView to an Xcode project by adding it as a package dependency.

  • From the File menu, select Swift PackagesAdd Package Dependency…
  • Enter https://github.com/HumorousGhost/TextView into the package repository URL text field
  • Link TextView to your application target

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics