Search code examples
iosuikituinavigationbaruinavigationitem

iOS 11.0 GM: Subviews of UINavigationItem's titleView don't receive touch events?


In all versions of iOS — including every beta of iOS 11.0 except the GM, 15A372 — views inside of a UINavigationItem's titleView would receive touch events as normal, making it possible to have buttons in the title view.

In build 15A372, subviews of the titleView do not receive any touch events, so buttons in that view are useless. I've tested with both devices and Simulators running iOS 10 and don't see this behavior. I've opened rdar://34499607 about this and will update this question when I hear back, but I want to know if anyone else has encountered this, or has any temporary solutions.

Apple's documentation about the titleView property specifically notes that "custom views can contain buttons," making this a confusing change.

If this is the intended behavior, it's infuriating that they've waited until the almost-literal eleventh hour to make this significant change and neglect to include it in any documentation or release notes.


Solution

  • You can see this question link