FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Added access to linkTextAttributes by jefferythomas · Pull Request #22 · gonzalezreal/AttributedText · GitHub

This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Added access to linkTextAttributes - #22

Open
jefferythomas wants to merge 1 commit into
gonzalezreal:mainfrom
jefferythomas:support-linklinkTextAttributes
Open

jefferythomas wants to merge 1 commit into
gonzalezreal:mainfrom
jefferythomas:support-linklinkTextAttributes

Conversation

Copy link
Copy Markdown

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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

1 participant


Back | FazBrowse Home | New Git URL