Skip to content

Commit a21050c

Browse files
committed
Update docs
1 parent a085d9f commit a21050c

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616

1717
RichTextKit helps you view and edit rich text in `SwiftUI`, `UIKit` and `AppKit`.
1818

19-
RichTextKit has a multi-platform SwiftUI `RichTextEditor` and `RichTextView` that support text styles (bold, italic, underline, etc.), fonts and font sizes, text and background colors, text alignment, image attachments etc.
19+
RichTextKit has a multi-platform SwiftUI `RichTextEditor` that can be added to any app:
2020

2121
<p align="center">
2222
<img src ="Resources/Demo.jpg" />
2323
</p>
2424

25-
RichTextKit is supported by and released with permission from [Oribi](https://oribi.se/en/) and used in [OribiWriter](https://oribi.se/en/apps/oribi-writer/), which is available on iOS and macOS. Have a look at that app or the demo app in this repo if you want to see RichTextKit in action.
25+
The `RichTextEditor` supports text styles (bold, italic, underline, etc.), fonts and font sizes, colors, text alignments, image attachments, etc.
26+
27+
The `RichTextEditor` is powered by a UIKit/AppKit `RichTextView` that bridges the UIKit `UITextView` and AppKit `NSTextView` and adds APIs to make the view work similar on both platforms.
2628

2729

2830

Sources/RichTextKit/Component/RichTextViewComponent+Pasting.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ private extension RichTextViewComponent {
133133
let newLine = NSAttributedString(string: "\n", attributes: currentRichTextAttributes)
134134
let content = NSMutableAttributedString(attributedString: richText)
135135
guard let insertString = getAttachmentString(for: image) else { return }
136-
136+
137137
insertString.insert(newLine, at: insertString.length)
138138
insertString.addAttributes(currentRichTextAttributes, range: insertString.richTextRange)
139139
content.insert(insertString, at: index)
140-
140+
141141
setRichText(content)
142142
}
143143
}

Sources/RichTextKit/RichTextKit.docc/Getting-Started.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
RichTextKit is a Swift-based library that lets you work with rich text in UIKit, AppKit and SwiftUI.
44

5+
Although much of the public APIs are for SwiftUI, all works by using UIKit and AppKit functionality, as provided by the `RichTextView`.
6+
57

68

79
## SwiftUI
810

9-
RichTextKit has a SwiftUI ``RichTextEditor``, which takes a text binding and a ``RichTextContext``:
11+
RichTextKit has a multi-platform SwiftUI ``RichTextEditor`` that can be added to any app:
1012

1113
```swift
1214
struct MyView: View {
@@ -25,7 +27,7 @@ struct MyView: View {
2527
}
2628
```
2729

28-
The editor uses a ``RichTextCoordinator`` to sync changes between the context, the editor and the underlying, platform-specific view.
30+
The editor takes a `text` binding and a``RichTextContext``, and uses a ``RichTextCoordinator`` to sync changes between the context, the editor and the underlying, platform-specific view.
2931

3032
You can now use the context to change the text binding and its font, font size, colors, alignment etc. You can also use the context to observe how these properties change, for instance when you move the text input cursor.
3133

Sources/RichTextKit/RichTextKit.docc/RichTextKit.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ RichTextKit helps you view and edit rich text in SwiftUI, UIKit and AppKit.
88

99
![RichTextKit logo](Logo.png)
1010

11-
RichTextKit has a SwiftUI `RichTextEditor` that builds on a multi-platform `RichTextView` that supports text style (bold, italic, underline, strikethrough etc.), font, font sizes, text and background colors, text alignment, images etc.
11+
RichTextKit has a multi-platform SwiftUI `RichTextEditor` that can be added to any app. It supports text styles (bold, italic, underline, etc.), fonts and font sizes, colors, text alignments, image attachments, etc.
12+
13+
The `RichTextEditor` is powered by a UIKit/AppKit `RichTextView` that bridges the UIKit `UITextView` and AppKit `NSTextView` and adds APIs to make the view work similar on both platforms.
1214

1315

1416

0 commit comments

Comments
 (0)