Skip to content

Commit

Permalink
Add text view abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Mar 4, 2024
1 parent dcd6780 commit c1fe086
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/RichTextKit/RichTextKit.docc/RichTextKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ RichTextKit is available under the MIT license. See the [LICENSE][License] file
- ``RichTextKeyboardToolbarMenu``
- ``RichTextKeyboardToolbarStyle``

### Line

- ``RichTextLine``

### Localization

- ``RTKL10n``
Expand Down Expand Up @@ -169,6 +173,7 @@ RichTextKit is available under the MIT license. See the [LICENSE][License] file
### Views

- ``RichTextLabelValue``
- ``TextViewRepresentable``



Expand Down
27 changes: 27 additions & 0 deletions Sources/RichTextKit/TextViewRepresentable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// TextViewRepresentable.swift
// RichTextKit
//
// Created by Daniel Saidi on 2024-03-04.
// Copyright © 2024 Daniel Saidi. All rights reserved.
//

#if macOS
import AppKit

/**
This typealias bridges platform-specific text views to make
it easier to support multi-platform.
*/
public typealias TextViewRepresentable = NSTextView
#endif

#if iOS || os(tvOS) || os(visionOS)
import UIKit

/**
This typealias bridges platform-specific text views to make
it easier to support multi-platform.
*/
public typealias TextViewRepresentable = UITextView
#endif

0 comments on commit c1fe086

Please sign in to comment.