Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Sep 2, 2024
1 parent e46be5a commit d2f8dcd
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
[![Build Status][build status badge]][build status]
[![Platforms][platforms badge]][platforms]
[![Documentation][documentation badge]][documentation]
[![Discord][discord badge]][discord]
[![Matrix][matrix badge]][matrix]

</div>

# Rearrange

Rearrange is a collection of utilities for making it easier to work with `NSRange`, `IndexSet`, `NSTextRange`/`UITextRange`, and `NSTextLocation`.
Rearrange is a collection of utilities for making it easier to work with `NSRange`, `IndexSet`, and `String.Index`.

If you need to work with `NSTextRange`/`UITextRange` or just TextKit in general, check out [Glyph][].

[Glyph]: https://github.com/chimeHQ/Glyph

## Integration

Expand Down Expand Up @@ -48,29 +52,10 @@ func shifted(startBy delta: Int) -> NSRange?
func clamped(to limit: Int) -> NSRange
func apply(_ change: RangeMutation) -> NSRange?

// creating
init(_ textRange: NSTextRange, provider: NSTextElementProvider)
init?(_ textRange: UITextRange, textView: UITextView)

// working with Swift String
func range(in string: String) -> Range<String.Index>?
```

**NSTextRange**

```swift
// creating
convenience init?(_ range: NSRange, provider: NSTextElementProvider)
convenience init?(_ offset: Int, provider: NSTextElementProvider)
```

**UITextRange**

```swift
// creating
convenience init?(_ range: NSRange, provider: NSTextElementProvider)
```

**IndexSet**

```swift
Expand All @@ -94,7 +79,7 @@ subscript(range: NSRange) -> Substring?

## Contributing and Collaboration

I would love to hear from you! Issues, Discussions, or pull requests work great. A [Discord server][discord] is also available for live help, but I have a strong bias towards answering in the form of documentation.
I would love to hear from you! Issues or pull requests work great. Both a [Matrix space][matrix] and [Discord][discord] are available for live help, but I have a strong bias towards answering in the form of documentation. You can also find me on [mastodon](https://mastodon.social/@mattiem).

I prefer collaboration, and would love to find ways to work together if you have a similar project.

Expand All @@ -108,5 +93,6 @@ By participating in this project you agree to abide by the [Contributor Code of
[platforms badge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FChimeHQ%2FRearrange%2Fbadge%3Ftype%3Dplatforms
[documentation]: https://swiftpackageindex.com/ChimeHQ/Rearrange/main/documentation
[documentation badge]: https://img.shields.io/badge/Documentation-DocC-blue
[matrix]: https://matrix.to/#/%23chimehq%3Amatrix.org
[matrix badge]: https://img.shields.io/matrix/chimehq%3Amatrix.org?label=Matrix
[discord]: https://discord.gg/esFpX6sErJ
[discord badge]: https://img.shields.io/badge/Discord-purple?logo=Discord&label=Chat&color=%235A64EC

0 comments on commit d2f8dcd

Please sign in to comment.