Skip to content

Commit 951834a

Browse files
committed
Update documentation
1 parent 679056c commit 951834a

File tree

5 files changed

+47
-56
lines changed

5 files changed

+47
-56
lines changed

Sources/RichTextKit/Attributes/RichTextAttribute.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@
88

99
import Foundation
1010

11-
/**
12-
This typealias represents a rich text dictionary key.
13-
*/
11+
/// This typealias represents a rich text dictionary key.
1412
public typealias RichTextAttribute = NSAttributedString.Key
1513

16-
/**
17-
This typealias represents a ``RichTextAttribute`` keyed and
18-
`Any` valued dictionary.
19-
*/
14+
/// This typealias represents a dictionary with an attribute
15+
/// as key and `Any` as value.
2016
public typealias RichTextAttributes = [RichTextAttribute: Any]

Sources/RichTextKit/Attributes/RichTextAttributeReader.swift

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@
88

99
import Foundation
1010

11-
/**
12-
This protocol extends ``RichTextReader`` with functionality
13-
for reading attributes from the ``RichTextReader/richText``.
14-
15-
The protocol is implemented by `NSAttributedString` as well
16-
as other types in the library.
17-
18-
Note that this protocol used to have a lot of functionality
19-
for getting various attributes, styles, etc. However, since
20-
``RichTextViewComponent`` needs more capabilities, we ended
21-
up with duplicated code where the reader had functions that
22-
weren't even used within the library.
23-
*/
11+
/// This protocol extends the ``RichTextReader`` protocol to
12+
/// make any implementing type able to get attributes in the
13+
/// ``RichTextReader/richText`` property.
14+
///
15+
/// This protocol is implemented by `NSAttributedString` and
16+
/// other types in the library.
17+
///
18+
/// > Note: The protocol used to have a lot of functionality
19+
/// for getting various attributes, styles, etc. However, it
20+
/// caused duplicated code since the ``RichTextViewComponent``
21+
/// needed more capabilities as well. As such, this protocol
22+
/// is now limited in functionality.
2423
public protocol RichTextAttributeReader: RichTextReader {}
2524

2625
extension NSAttributedString: RichTextAttributeReader {}

Sources/RichTextKit/Attributes/RichTextAttributeWriter.swift

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@
88

99
import Foundation
1010

11-
/**
12-
This protocol extends ``RichTextWriter`` with functionality
13-
for writing attributes to the ``RichTextWriter/richText`.
14-
15-
This protocol is implemented by `NSMutableAttributedString`,
16-
as well as other types in the library.
17-
18-
Note that this protocol used to have a lot of functionality
19-
for setting various attributes, styles, etc. However, since
20-
``RichTextViewComponent`` needs more capabilities, we ended
21-
up with duplicated code where the writer had functions that
22-
weren't even used within the library.
23-
*/
11+
/// This protocol extends the ``RichTextWriter`` protocol to
12+
/// make any implementing type able to set attributes in the
13+
/// ``RichTextReader/richText`` property.
14+
///
15+
/// This protocol is implemented by `NSAttributedString` and
16+
/// other types in the library.
17+
///
18+
/// > Note: The protocol used to have a lot of functionality
19+
/// for getting various attributes, styles, etc. However, it
20+
/// caused duplicated code since the ``RichTextViewComponent``
21+
/// needed more capabilities as well. As such, this protocol
22+
/// is now limited in functionality.
2423
public protocol RichTextAttributeWriter: RichTextWriter, RichTextAttributeReader {}
2524

2625
extension NSMutableAttributedString: RichTextAttributeWriter {}

Sources/RichTextKit/Bridging/RichTextView_AppKit.swift

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,16 @@
99
#if macOS
1010
import AppKit
1111

12-
/**
13-
This is a platform-agnostic rich text view that can be used
14-
in both UIKit and AppKit.
15-
16-
The view inherits `NSTextView` in AppKit and `UITextView`
17-
in UIKit. It aims to make these views behave more alike and
18-
make them implement ``RichTextViewComponent``, which is the
19-
protocol that is used within this library.
20-
21-
The view will apply a ``RichTextImageConfiguration/disabled``
22-
image config by default. You can change this by setting the
23-
property manually or by using a ``RichTextDataFormat`` that
24-
supports images.
25-
*/
12+
/// This is a platform-agnostic text view for both UIKit and
13+
/// AppKit that makes the underlying views behave more alike.
14+
///
15+
/// The view inherits `NSTextView` in AppKit and `UITextView`
16+
/// in UIKit and implements ``RichTextViewComponent``, which
17+
/// is the protocol that is used within this library.
18+
///
19+
/// The view will apply a disabled ``imageConfiguration`` by
20+
/// default. You can change this by setting the property, or
21+
/// by applying a ``RichTextDataFormat`` that handles images.
2622
open class RichTextView: NSTextView, RichTextViewComponent {
2723

2824
// MARK: - Properties

Sources/RichTextKit/Bridging/RichTextView_UIKit.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ import UniformTypeIdentifiers
1515
extension RichTextView: UIDropInteractionDelegate {}
1616
#endif
1717

18-
/**
19-
This is a platform-agnostic rich text view that can be used
20-
in both UIKit and AppKit.
21-
22-
The view inherits `NSTextView` in AppKit and `UITextView`
23-
in UIKit. It aims to make these views behave more alike and
24-
make them implement ``RichTextViewComponent``, which is the
25-
protocol that is used within this library.
26-
*/
18+
/// This is a platform-agnostic text view for both UIKit and
19+
/// AppKit that makes the underlying views behave more alike.
20+
///
21+
/// The view inherits `NSTextView` in AppKit and `UITextView`
22+
/// in UIKit and implements ``RichTextViewComponent``, which
23+
/// is the protocol that is used within this library.
24+
///
25+
/// The view will apply a disabled ``imageConfiguration`` by
26+
/// default. You can change this by setting the property, or
27+
/// by applying a ``RichTextDataFormat`` that handles images.
2728
open class RichTextView: UITextView, RichTextViewComponent {
2829

2930
// MARK: - Initializers

0 commit comments

Comments
 (0)