-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add demo app (#1) * added demo app * Updated name of package * Add readme (#2) * Created Tool bar (#3) * create editor view (#4) * support bold functionality * Added bold functinality with span * Fix crashes on adding and removing text * Fix style continue applying after deselecting it * Fix header style selected state and removed unused file * Added bold style * Clean up * Added missing files (#5) * Added bold style support (#6) * Added bold style support * Refactored state and added documantation for code * updated state with documentaion comments * Support multiple style (#7) * Fixed crash on removing character * Fix remove header is creating crash * Removed exta code * Fix app stuck when style applyed by selecting tool * Showing rich text from json * Fix header text with style not toggling style * Update attribute setting logic * Fix underline not applyed while typing after underlined text * Avoid passing perameter and using direcly form state * Support header style (#8) * support header style * Fix header style behaving oddly with string with emoji * Using standard font size * Fix style is not setting when we add typing attributes * Updated read me (#9) * Updated read me * Added sample gif * Update supported version (#10) * Added licence (#12) * update pod spec (#13) * Update initial version * Updated auther * Updated image alignment (#15) * Use font representable to support multi platform (#17) * Update font with representable
- Loading branch information
1 parent
c49ab95
commit b9f7a7e
Showing
45 changed files
with
3,152 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: build_package | ||
|
||
run-name: build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Swift ${{ matrix.swift }} on ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf | ||
- uses: actions/checkout@v4 | ||
- name: Build | ||
run: swift build | ||
- name: Run tests | ||
run: swift test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
Copyright (c) 2022 Canopas Software LLP | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
// swift-tools-version: 5.9 | ||
// swift-tools-version: 5.5 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "RichEditorSwiftui", | ||
name: "RichEditorSwiftUI", | ||
platforms: [ | ||
//Add supported platforms here | ||
.iOS(.v14), | ||
], | ||
products: [ | ||
// Products define the executables and libraries a package produces, making them visible to other packages. | ||
.library( | ||
name: "RichEditorSwiftui", | ||
targets: ["RichEditorSwiftui"]), | ||
name: "RichEditorSwiftUI", | ||
targets: ["RichEditorSwiftUI"]), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets are the basic building blocks of a pack.age, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. | ||
.target( | ||
name: "RichEditorSwiftui"), | ||
name: "RichEditorSwiftUI"), | ||
.testTarget( | ||
name: "RichEditorSwiftuiTests", | ||
dependencies: ["RichEditorSwiftui"]), | ||
name: "RichEditorSwiftUITests", | ||
dependencies: ["RichEditorSwiftUI"]), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# RichEditorSwiftUI | ||
|
||
iOS WYSIWYG Rich editor for SwiftUI. | ||
|
||
<p align="center"> | ||
<img src="./docs/sample.gif" height="640" /> | ||
</p> | ||
|
||
|
||
## Features | ||
|
||
The editor offers the following <b>options</b>: | ||
|
||
- [x] **Bold** | ||
- [x] *Italic* | ||
- [x] <u>Underline</u> | ||
- [x] Different Heading | ||
|
||
## How to add in your project | ||
|
||
Add the dependency | ||
|
||
``` | ||
import XYZRichEditor | ||
``` | ||
|
||
## How to use ? | ||
|
||
``` | ||
struct EditorView: View { | ||
@ObservedObject var state: RichEditorState = .ini(input: "Hello World") | ||
var body: some View { | ||
RichEditor(state: _state) | ||
.padding(10) | ||
} | ||
} | ||
``` | ||
# Demo | ||
[Sample](https://github.com/canopas/rich-editor-swiftui/tree/main/RichEditorDemo) app demonstrates how simple the usage of the library actually is. | ||
|
||
# Bugs and Feedback | ||
For bugs, questions and discussions please use the [Github Issues](https://github.com/canopas/rich-editor-swiftui/issues). | ||
|
||
|
||
## Credits | ||
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). | ||
|
||
RichTextKit: https://github.com/danielsaidi/RichTextKit | ||
|
||
# Licence | ||
|
||
``` | ||
Copyright 2023 Canopas Software LLP | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
You won't be using this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
``` |
Oops, something went wrong.