aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md22
1 files changed, 21 insertions, 1 deletions
diff --git a/README.md b/README.md
index dc8cec4..9819fd0 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# Norg Keyboard Toolbar
This package provides a toolbar you can use whenever you need to edit norg
-files. The toolbar provides the following buttons:
+files in SwiftUI or UIKit apps. The toolbar provides the following buttons:
The heading button creates a new heading, or increases the heading of the
current level. See this table for examples.
@@ -30,6 +30,8 @@ The code button adds a `@code` and `@end` block.
## Usage
+### SwiftUI
+
Add the package to your project by including the repo URL with Xcode's package
manager, and import it:
@@ -54,6 +56,24 @@ struct EditorView: View {
of the screen if a hardware keyboard is connected.) with the buttons described
above.
+### UIKit
+
+Add the package to your project by including the repo URL with Xcode's package
+manager, and import it:
+
+```swift
+import UIKit
+import NorgKeyboardToolbar
+
+...
+
+let textView = UITextView()
+textView.installNorgKeyboardAccessory()
+```
+
+`installNorgKeyboardAccessory` then attaches a toolbar above the keyboard with
+the buttons described above.
+
## Development
A `Justfile` is provided to run common tasks: