Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Release
on:
push:
branches:
- master
- main

jobs:
build:
Expand Down
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@ The editor offers the following <b>options</b>:
- [x] Font family
- [x] Background color
- [x] Export with .txt, .rtf, .pdf, .json
- [x] Link
- [ ] Link
- [ ] Image Attachment
- [ ] Undo/Redo

## What’s Coming Next for RichEditorSwiftUI?🚀

We’re thrilled about the future of **RichEditorSwiftUI!** 🎉 Check out the exciting features currently in development:

- **Link Support:** Easily add hyperlinks to your rich text content.
- **Image Drop:** Drag and drop images directly into your editor for seamless integration.
- **Undo & Redo:** Effortlessly step forward or backward in your edits for greater control.

Thank you for your support and feedback—it fuels our journey. Stay tuned for these enhancements and more! 🙌

## Screenshots

Expand Down Expand Up @@ -98,7 +110,7 @@ dependencies: [
[CocoaPods][] is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate RichEditorSwiftUI into your Xcode project using CocoaPods, specify it in your Podfile:

target 'YourAppName' do
pod 'RichEditorSwiftUI', '~> 1.1.0'
pod 'RichEditorSwiftUI', '~> 1.1.1'
end

[CocoaPods]: https://cocoapods.org
Expand Down
6 changes: 3 additions & 3 deletions RichEditorSwiftUI.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'RichEditorSwiftUI'
s.version = '1.0.0'
s.summary = 'Powerful WYSIWYG Rich editor for SwiftUI.'
s.name = "RichEditorSwiftUI"
s.version = "1.1.1"
s.summary = "Rich text editing, SwiftUI rich text editor library."

s.description = <<-DESC
Wrapper around UITextView to support Rich text editing in SwiftUI.
Expand Down
113 changes: 103 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# RichEditorSwiftUI

iOS WYSIWYG Rich editor for SwiftUI.

<img src="./docs/sample.gif" height="640" />
![RichEditorSwiftUI (1)](https://github.com/canopas/rich-editor-swiftui/assets/73588408/8c3013ae-8a27-4ebc-a511-51e726825c4b)

## Features

Expand All @@ -12,6 +10,65 @@ The editor offers the following <b>options</b>:
- [x] *Italic*
- [x] <u>Underline</u>
- [x] Different Heading
- [x] Text Alignment
- [x] Font size
- [x] Font color
- [x] Font family
- [x] Background color
- [x] Export with .txt, .rtf, .pdf, .json

## Screenshots

<table>
<tr>
<th width="33%" >Editor light</th>
<th width="33%" >Editor dark</th>
</tr>
<tr>
<td><img src="editor_iphone_light.png" /></td>
<td> <img src="editor_iphone_dark.png" /> </td>
</tr>
</table>

<table>
<tr>
<th width="33%" >Toolbar dark</th>
<th width="33%" >Toolbar light</th>
</tr>
<tr align="center">
<td><img src="editor_toolbar_iphone_dark.png" /></td>
<td> <img src="editor_toolbar_iphone_light.png" /> </td>
</tr>
</table>

<table>
<tr>
<th width="100%" >mac Editor light</th>
</tr>
<tr align="center">
<td><img src="editor_mac_light.png" width="70%" /></td>
</tr>
</table>

<table>
<tr>
<th width="100%" >mac Editor dark</th>
</tr>
<tr align="center">
<td> <img src="editor_mac_dark.png" width="70%" /> </td>
</tr>
</table>

## mac Editor video

<div align="center">
<video src="https://github.com/user-attachments/assets/844d8843-41e9-44c2-8a0c-afedaa55c5cb" width="90%"/>
</div>

## iPhone Editor video
<div align="center">
<video src="https://github.com/user-attachments/assets/f99804fb-8612-4e46-b172-66567d1acf91" width="90%"/>
</div>

## Installation

Expand All @@ -23,7 +80,7 @@ Once you have your Swift package set up, adding RichEditorSwiftUI as a dependenc

```swift
dependencies: [
.package(url: "https://github.com/canopas/rich-editor-swiftui.git", .upToNextMajor(from: "1.0.0"))
.package(url: "https://github.com/canopas/rich-editor-swiftui.git", .upToNextMajor(from: "1.1.0"))
]
```

Expand All @@ -32,7 +89,7 @@ dependencies: [
[CocoaPods][] is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate RichEditorSwiftUI into your Xcode project using CocoaPods, specify it in your Podfile:

target 'YourAppName' do
pod 'RichEditorSwiftUI', '~> 1.0.0'
pod 'RichEditorSwiftUI', '~> 1.1.0'
end

[CocoaPods]: https://cocoapods.org
Expand All @@ -42,21 +99,57 @@ dependencies: [
Add the dependency

```
import XYZRichEditor
import RichEditorSwiftUI
```

## How to use ?
## How to use?

```
struct EditorView: View {
@ObservedObject var state: RichEditorState = .init(input: "Hello World")

var body: some View {
RichEditor(state: _state)
.padding(10)
VStack {
#if os(macOS)
RichTextFormat.Toolbar(context: state)
#endif

RichTextEditor(
context: _state,
viewConfiguration: { _ in

}
)
.cornerRadius(10)

#if os(iOS)
RichTextKeyboardToolbar(
context: state,
leadingButtons: { $0 },
trailingButtons: { $0 },
formatSheet: { $0 }
)
#endif
}
.inspector(isPresented: $isInspectorPresented) {
RichTextFormat.Sidebar(context: state)
#if os(macOS)
.inspectorColumnWidth(min: 200, ideal: 200, max: 320)
#endif
}
}
}
```

## Tech stack

RichEditorSwiftUI utilizes the latest Apple technologies and adheres to industry best practices. Below is the current tech stack used in the development process:

- MVVM Architecture
- SwiftUI
- Swift
- Xcode

# Demo
[Sample](https://github.com/canopas/rich-editor-swiftui/tree/main/RichEditorDemo) app demonstrates how simple the usage of the library actually is.

Expand Down