how to hide tab bar when push and show tab bar when back
<p>I want </p>

<p>view controller 1: tab bar is showed</p>

<p>view controller 2: tab bar is showed</p>

<p>view controller 3: tab bar is not showed.</p>

<p>I wrote</p>

<pre><code>// prepareForSegue in view controller 1, 
let upcoming = segue.destinationViewController as! viewcontroller3
upcoming.hidesBottomBarWhenPushed = true

// prepareForSegue in view controller 3,
let upcoming = segue.destinationViewController as! viewcontroller2
self.hidesBottomBarWhenPushed = true
</code></pre>

<p>When I go to view controller 3 from view controller 1, tab bar is not showed. Then, I go to view controller 2 from view controller 3, tab bar is showed. <strong>But when I tap back in view controller 2, tab bar is showed in view controller 3.</strong> <code>self.hidesBottomBarWhenPushed = true</code> does not make sense to me. But, I couldn't figure what I should do to fix that. Any suggestions? Thanks.</p>

<p><a href="https://i.stack.imgur.com/h7rx3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h7rx3.png" alt="enter image description here"></a></p>