What's the equivalent of NSTextView in SwiftUI?
Asked on 2024-07-30
1 search
The equivalent of NSTextView
in SwiftUI is the TextEditor
view. TextEditor
provides a way to display and edit multiline, scrollable text content in SwiftUI, similar to how NSTextView
works in AppKit.
For more details on text handling in SwiftUI, you can refer to the session What’s new in SwiftUI at the 15:06 mark, where programmatic access to and control of text selection within text editing controls is discussed.

SwiftUI essentials
Join us on a tour of SwiftUI, Apple’s declarative user interface framework. Learn essential concepts for building apps in SwiftUI, like views, state variables, and layout. Discover the breadth of APIs for building fully featured experiences and crafting unique custom components. Whether you’re brand new to SwiftUI or an experienced developer, you’ll learn how to take advantage of what SwiftUI has to offer when building great apps.

Create custom visual effects with SwiftUI
Discover how to create stunning visual effects in SwiftUI. Learn to build unique scroll effects, rich color treatments, and custom transitions. We’ll also explore advanced graphic effects using Metal shaders and custom text rendering.

Build multilingual-ready apps
Ensure your app works properly and effectively for multilingual users. Learn best practices for text input, display, search, and formatting. Get details on typing in multiple languages without switching between keyboards. And find out how the latest advances in the String Catalog can make localization even easier.