[Ripple] Add a respondsToSelector check to resolve crashes of unrecognized selector.
[Ripple] Add a respondsToSelector check to resolve crashes of unrecognized selector.

Adding a respondsToSelector check for "performAsCurrentTraitCollection" as there are cases where iOS 13+ devices do not recognize that API despite it being an available API since iOS 13.

Tested this with iOS 13+ and iOS 11.2 simulators to see it is working as expected.

PiperOrigin-RevId: 306215948

material-components/material-components-ios,material-components/material-components-ios,material-components/material-components-ios,material-components/material-components-ios,material-components/material-components-ios