ios26 uisegmentedcontrol used as customview on uibarbuttonitem not working

I have a uisegmentedcontrol used as a customview on a right uibarbuttonitem. It has two segments. With iOS26, no matter where I tap it, it always triggers the first segment. This worked fine in ios18.

ios26 uisegmentedcontrol used as customview on uibarbuttonitem not working
 
 
Q