Skip to content

Commit 254ed8d

Browse files
authored
Expose attributed string (#39)
1 parent 776b565 commit 254ed8d

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
2+
<img width="930" alt="mobile apps banner" src="https://github.com/canopas/rich-editor-swiftui/assets/73588408/84c94bbd-7952-45cb-9bfb-95e0687b37b0">
3+
14
# RichEditorSwiftUI
25

3-
iOS RichEditorSwiftUI for SwiftUI.
6+
![RichEditorSwiftUI (1)](https://github.com/canopas/rich-editor-swiftui/assets/73588408/8c3013ae-8a27-4ebc-a511-51e726825c4b)
7+
8+
## A swift-based library to make rich text editing very easy with SwiftUI.
49

510
<img src="./docs/sample.gif" height="640" />
611

@@ -45,7 +50,7 @@ Add the dependency
4550
import RichEditorSwiftUI
4651
```
4752

48-
## How to use ?
53+
## How to use?
4954

5055
```
5156
struct EditorView: View {
@@ -61,16 +66,18 @@ struct EditorView: View {
6166
[Sample](https://github.com/canopas/rich-editor-swiftui/tree/main/RichEditorDemo) app demonstrates how simple the usage of the library actually is.
6267

6368
# Bugs and Feedback
64-
For bugs, questions and discussions please use the [Github Issues](https://github.com/canopas/rich-editor-swiftui/issues).
69+
For bugs, questions, and discussions please use the [Github Issues](https://github.com/canopas/rich-editor-swiftui/issues).
6570

6671

6772
## Credits
6873
RichEditor for SwiftUI is owned and maintained by the [Canopas team](https://canopas.com/). For project updates and releases, you can follow them on Twitter at [@canopassoftware](https://twitter.com/canopassoftware).
6974

70-
Similar library is also available for Android in Jetpack Compose [here](https://github.com/canopas/rich-editor-compose)
75+
A similar library is also available for Android in Jetpack Compose [here](https://github.com/canopas/rich-editor-compose).
7176

7277
RichTextKit: https://github.com/danielsaidi/RichTextKit
7378

79+
<a href="https://canopas.com/contact"><img src="https://github.com/canopas/rich-editor-swiftui/assets/73588408/e03fe013-03e8-429d-828f-5066d3775258" width=250></a>
80+
7481
# Licence
7582

7683
```

Sources/RichEditorSwiftUI/UI/Editor/RichEditorState.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ public class RichEditorState: ObservableObject {
2323
private var rawText: String
2424

2525
private var updateAttributesQueue: [(span:RichTextSpan, shouldApply: Bool)] = []
26-
26+
27+
public var attributedText: NSAttributedString {
28+
return editableText.attributedString
29+
}
30+
2731
/**
2832
This will provide encoded text which is of type RichText
2933
*/

0 commit comments

Comments
 (0)