diff --git a/packages/react-native-session-replay/ios/Sources/RCTTextViewRecorder.swift b/packages/react-native-session-replay/ios/Sources/RCTTextViewRecorder.swift index b2317bee6..db3afac4f 100644 --- a/packages/react-native-session-replay/ios/Sources/RCTTextViewRecorder.swift +++ b/packages/react-native-session-replay/ios/Sources/RCTTextViewRecorder.swift @@ -69,7 +69,7 @@ internal class RCTTextViewRecorder: SessionReplayNodeRecorder { textAlignment: shadow.textAttributes.alignment, textColor: shadow.textAttributes.foregroundColor?.cgColor, textObfuscator: textObfuscator(context), - font: shadow.textAttributes.effectiveFont(), // Custom fonts are currently not supported for iOS + font: nil, // Custom fonts are currently not supported for iOS contentRect: shadow.contentFrame ) let node = SessionReplayNode(viewAttributes: attributes, wireframesBuilder: builder) @@ -79,6 +79,9 @@ internal class RCTTextViewRecorder: SessionReplayNodeRecorder { } } +// Black color. This is faster than accessing UIColor.black.cgColor. +let DEFAULT_COLOR = UIColor(white: 0, alpha: 1).cgColor + internal struct RCTTextViewWireframesBuilder: SessionReplayNodeWireframesBuilder { let wireframeID: WireframeID let attributes: SessionReplayViewAttributes @@ -93,8 +96,6 @@ internal struct RCTTextViewWireframesBuilder: SessionReplayNodeWireframesBuilder attributes.frame } - let DEFAULT_FONT_COLOR = UIColor.black.cgColor - // Clipping should be 0 to avoid the text from overflowing when the // numberOfLines prop is used. private var clip: SRContentClip { @@ -138,7 +139,7 @@ internal struct RCTTextViewWireframesBuilder: SessionReplayNodeWireframesBuilder // Text alignment is top for all RCTTextView components. textAlignment: .init(systemTextAlignment: textAlignment, vertical: .top), clip: clip, - textColor: textColor ?? DEFAULT_FONT_COLOR, + textColor: textColor ?? DEFAULT_COLOR, font: font, borderColor: attributes.layerBorderColor, borderWidth: attributes.layerBorderWidth,