Skip to content

Commit

Permalink
Adjust documentation and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Jan 23, 2024
1 parent cc4e5e4 commit 8153a3d
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Demo/iOS/EditorScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private extension EditorScreen {
leadingButtons: {},
trailingButtons: {}
) {
var sheet = $0
let sheet = $0
// Uncomment this to show all color pickers
// sheet.colorPickers = .allCases
return sheet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public extension RichTextAttributeWriter {
///
/// > Todo: Something's currently off with alignment. It
/// spils over to other paragraphs when moving the input
/// cursor and inserting new text.
/// cursor and inserting new text.
func setRichTextAlignment(
_ alignment: RichTextAlignment,
at range: NSRange
Expand Down
2 changes: 1 addition & 1 deletion Sources/RichTextKit/Colors/RichTextColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ public extension RichTextColor {
}

public extension Collection where Element == RichTextColor {

static var allCases: [RichTextColor] { Element.allCases }
}
2 changes: 1 addition & 1 deletion Sources/RichTextKit/Data/RichTextDataError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
/**
This enum represents rich text data-related errors.
*/
enum RichTextDataError: Error {
public enum RichTextDataError: Error {

case invalidArchivedData(in: Data)
case invalidPlainTextData(in: Data)
Expand Down
14 changes: 7 additions & 7 deletions Sources/RichTextKit/Fonts/RichTextFont+Picker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ public extension RichTextFont {

/**
This font picker can be used to pick a font from a list.
It uses ``RichTextFontPickerFont/all`` as default fonts.

This picker uses ``RichTextFont/PickerFont/all`` as the
default fonts.

This view renders a plain `Picker`, which means you can
use and configure it in all ways supported by SwiftUI.

Note that macOS will render every font correctly, while
iOS will only do it in a wheel/inline picker. Try using
``RichTextFontListPicker``/``RichTextFontForEachPicker``
on iOS, if you need a proper list.
iOS will only do it in a wheel/inline picker.
*/
struct Picker: View {

/**
Create a font picker.

- Parameters:
- selection: The selected font name.
- fonts: The fonts to display in the list, by default `all`.
- fontSize: The font size to use in the list items.
- selection: The selected font name.
- fonts: The fonts to display in the list, by default `all`.
- fontSize: The font size to use in the list items.
*/
public init(
selection: Binding<FontName>,
Expand Down
2 changes: 1 addition & 1 deletion Sources/RichTextKit/Fonts/RichTextFont+PickerFont.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public extension RichTextFont {
which must have its name adjusted.

To change the display name of a system font, simply set
``RichTextFontPickerFont/standardSystemFontDisplayName``
``RichTextFont/PickerFont/standardSystemFontDisplayName``
to another value.

To change how fonts are detected by the system, use the
Expand Down
2 changes: 1 addition & 1 deletion Sources/RichTextKit/Fonts/RichTextFont+SizePicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public extension RichTextFont {

- Parameters:
- selection: The selected font size.
- sizes: The sizes to display in the list, by default ``RichTextFontSizePicker/standardFontSizes``.
- sizes: The font sizes to display in the list.
*/
public init(
selection: Binding<CGFloat>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public extension RichTextFont {

- Parameters:
- context: The context to affect.
- values: The sizes to display in the list, by default ``RichTextFontSizePicker/standardFontSizes``.
- values: The sizes to display in the list, by default ``RichTextFont/SizePicker/standardFontSizes``.
*/
public init(
context: RichTextContext,
Expand Down
2 changes: 1 addition & 1 deletion Sources/RichTextKit/Styles/RichTextStyle+Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ struct RichTextStyle_Button_Previews: PreviewProvider {
var body: some View {
HStack {
Text(isBoldOn.description)

RichTextStyle.Button(
style: .bold,
value: $isBoldOn)
Expand Down
2 changes: 1 addition & 1 deletion Tests/RichTextKitTests/Colors/RichTextColorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import RichTextKit
import XCTest

final class RichTextColorTests: XCTestCase {

func testAllCasesExcludesUndefined() {
let colors = RichTextColor.allCases
let expected: [RichTextColor] = [
Expand Down

0 comments on commit 8153a3d

Please sign in to comment.