It&#x27;s been awhile since I looked at this, but tab bar controllers (selectedViewController), navigation controllers (topViewController), and child controllers are probably going to cause your current method some difficulties.