Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Added access to linkTextAttributes #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jefferythomas
Copy link

Description

A Pull Request to implement a solution for issue #21.

Created linkTextAttributes environment value. Added linkTextAttributes view modifier. Set the linkTextAttributes in iOS, macOS, and tvOS based on the context environment.

Implementation

Added linkTextAttributes as an internal property of EnvironmentValues. This limits access to linkTextAttributes to just the AttributedText package. In AttributedTextImpl.updateUIView, if linkTextAttributes has been set, then set the underlying TextView's linkTextAttributes property.

Examples

There are two ways of setting the linkTextAttributes.

  1. Setting with a value
AttributedText()
  .linkTextAttributes([.foregroundColor: UIColor.black])
  1. Setting with a closure
AttributedText()
  .linkTextAttributes {
    [.foregroundColor: UIColor.black]
  }

Created linkTextAttributes environment value. Added linkTextAttributes view modifier. Set the linkTextAttributes in iOS, macOS, and tvOS based on the context environment.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant