Instance Method


Fixes the paragraph style attributes in aRange, assigning the first paragraph style attribute value in each paragraph to all characters of the paragraph.


func fixParagraphStyleAttribute(in range: NSRange)



The range of characters.


This method extends the range as needed to cover the last paragraph partially contained. A paragraph is delimited by any of these characters, the longest possible sequence being preferred to any shorter:

  • U+000D (\r or CR)

  • U+000A (\n or LF)

  • U+2029 (Unicode paragraph separator) \r\n, in that order (also known as CRLF)

Raises an rangeException if any part of aRange lies beyond the end of the receiver’s characters.

See Also

Fixing attributes after changes

func fixAttributes(in: NSRange)

Cleans up font, paragraph style, and attachment attributes within the given range.

func fixAttachmentAttribute(in: NSRange)

Cleans up attachment attributes in aRange, removing all attachment attributes assigned to characters other than NSAttachmentCharacter.

func fixFontAttribute(in: NSRange)

Fixes the font attribute in aRange, assigning default fonts to characters with illegal fonts for their scripts and otherwise correcting font attribute assignments.