11import CioMessagingInApp
22import Foundation
33import UIKit
4+ import WebKit
45
56/// React Native wrapper for inline message display with content view lifecycle management.
67///
@@ -29,6 +30,14 @@ class ReactInlineMessageView: NSObject {
2930 contentView. elementId = elementId
3031 }
3132
33+ private var showScrollIndicators : Bool = true
34+
35+ @objc
36+ func setShowScrollIndicators( _ showScrollIndicators: Bool ) {
37+ self . showScrollIndicators = showScrollIndicators
38+ applyScrollIndicators ( in: contentView)
39+ }
40+
3241 @objc
3342 func setupForReuse( ) {
3443 contentView. onViewAttached ( )
@@ -106,6 +115,7 @@ extension ReactInlineMessageView: InlineMessageBridgeViewDelegate {
106115 }
107116
108117 func onMessageSizeChanged( width: CGFloat , height: CGFloat ) {
118+ applyScrollIndicators ( in: contentView)
109119 sendOnSizeChangeEvent ( width: width, height: height)
110120 }
111121
@@ -114,11 +124,20 @@ extension ReactInlineMessageView: InlineMessageBridgeViewDelegate {
114124 }
115125
116126 func onStartLoading( onComplete: @escaping ( ) -> Void ) {
127+ applyScrollIndicators ( in: contentView)
117128 sendOnStateChangeEvent ( state: . loadingStarted)
118129 onComplete ( )
119130 }
120131
121132 func onFinishLoading( ) {
122133 sendOnStateChangeEvent ( state: . loadingFinished)
123134 }
135+
136+ private func applyScrollIndicators( in view: UIView ) {
137+ if let webView = view as? WKWebView {
138+ webView. scrollView. showsVerticalScrollIndicator = showScrollIndicators
139+ webView. scrollView. showsHorizontalScrollIndicator = showScrollIndicators
140+ }
141+ view. subviews. forEach { applyScrollIndicators ( in: $0) }
142+ }
124143}
0 commit comments