Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,7 @@ public class KeyboardTrackingView: UIView {

self._keyboardAccessoryView = accessoryContainer

// On iOS 26+, add scroll edge blending so the bottom of the ScrollView
// fades into the glass accessory (like Apple Notes / iMessage).
if #available(iOS 26.0, *) {
let edgeInteraction = UIScrollEdgeElementContainerInteraction()
edgeInteraction.scrollView = scrollView
edgeInteraction.edge = .bottom
accessoryContainer.addInteraction(edgeInteraction)
}
addScrollEdgeElementContainerInteractionIfAvailable(to: accessoryContainer, scrollView: scrollView)

// Set up scroll view for interactive dismiss
scrollView.keyboardDismissMode = .interactive
Expand Down Expand Up @@ -176,6 +169,26 @@ public class KeyboardTrackingView: UIView {
self?.becomeFirstResponder()
}
}

private func addScrollEdgeElementContainerInteractionIfAvailable(to containerView: UIView, scrollView: UIScrollView) {
guard #available(iOS 26.0, *) else { return }

// UIScrollEdgeElementContainerInteraction is an iOS 26 SDK symbol. Resolve
// it dynamically so the plugin still compiles with Xcode 16.x / iOS 18.x SDKs.
let interactionClass = (
NSClassFromString("UIScrollEdgeElementContainerInteraction")
?? NSClassFromString("UIKit.UIScrollEdgeElementContainerInteraction")
) as? NSObject.Type

guard let interactionClass = interactionClass else { return }

let interaction = interactionClass.init()
interaction.setValue(scrollView, forKey: "scrollView")
interaction.setValue(NSNumber(value: UIRectEdge.bottom.rawValue), forKey: "edge")

guard let edgeInteraction = interaction as? UIInteraction else { return }
containerView.addInteraction(edgeInteraction)
}

/**
* Set the callback for relayouting ScrollView content
Expand Down