View containg accessibility element fix

New pull request in lieu of #327. The workaround is now only used for UISwitch. It's done as a separate commit so it can be reverted easily in case this would benefit other views.