Skip to content

Commit

Permalink
#19: fixed inseration point color on mac catalyst (#20)
Browse files Browse the repository at this point in the history
* #19: fixed inseration point color on mac catalyst

* Removes conditional Catalyst compilation flag

Co-authored-by: Christoph Biering <christoph.biering@wandelbots.com>
Co-authored-by: kyle-n <kylebnazario@gmail.com>
  • Loading branch information
3 people authored Dec 28, 2020
1 parent fae3c9b commit c71302c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/HighlightedTextEditor/HighlightedTextEditor.iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public struct HighlightedTextEditor: UIViewRepresentable, HighlightingTextEditor
let layoutDirection = UIView.userInterfaceLayoutDirection(for: textView.semanticContentAttribute)
textView.textAlignment = NSTextAlignment(textAlignment: textAlignment, userInterfaceLayoutDirection: layoutDirection)
textView.tintColor = insertionPointColor ?? textView.tintColor

// BUGFIX #19: https://stackoverflow.com/questions/60537039/change-prompt-color-for-uitextfield-on-mac-catalyst
let textInputTraits = textView.value(forKey: "textInputTraits") as? NSObject
textInputTraits?.setValue(textView.tintColor, forKey: "insertionPointColor")
}

public class Coordinator: NSObject, UITextViewDelegate {
Expand Down

0 comments on commit c71302c

Please sign in to comment.