Instance Method

setAlignment(_:range:)

Sets the alignment characteristic of the paragraph style attribute for the characters in aRange to alignment.

Declaration

func setAlignment(_ alignment: NSTextAlignment, range: NSRange)

Parameters

alignment

The alignment to use.

aRange

The range of characters.

Discussion

When attribute fixing takes place, this change will affect only paragraphs whose first character was included in aRange. Raises an rangeException if any part of aRange lies beyond the end of the receiver’s characters.

See Also

Changing attributes

func setAttributes([NSAttributedString.Key : Any]?, range: NSRange)

Sets the attributes for the characters in the specified range to the specified attributes.

func addAttribute(NSAttributedString.Key, value: Any, range: NSRange)

Adds an attribute with the given name and value to the characters in the specified range.

func addAttributes([NSAttributedString.Key : Any] = [:], range: NSRange)

Adds the given collection of attributes to the characters in the specified range.

func removeAttribute(NSAttributedString.Key, range: NSRange)

Removes the named attribute from the characters in the specified range.

func applyFontTraits(NSFontTraitMask, range: NSRange)

Applies the font attributes specified by mask to the characters in aRange.

func setBaseWritingDirection(NSWritingDirection, range: NSRange)

Sets the base writing direction for the characters in range to writingDirection.

func subscriptRange(NSRange)

Decrements the value of the superscript attribute for characters in aRange by 1.

func superscriptRange(NSRange)

Increments the value of the superscript attribute for characters in aRange by 1.

func unscriptRange(NSRange)

Removes the superscript attribute from the characters in aRange.