Search code examples
swiftuikit

UI of closed screen shows overlapping when 'popView Controller' is performed in UIKit code base project


enter image description here

There are blue View Controllers and white View Controllers.

Press "button" on the blue screen to see a white View Controller.

The white View Controller has a large roulette. The roulette is made to show only half of the white screen.

And when you press a specific button on the white screen, it's "popView Controller."

The problem here is that at the moment of "Pop", half of the big roulette on the white screen is also visible on the blue screen.

  1. I'm working on code base without Storyboard.
  2. I'm practicing the coordinator pattern. (https://somevitalyz123.medium.com/coordinator-pattern-with-tab-bar-controller-33e08d39d7d)

I created a Navigation Controller and entered the screen through Push. However, there was a problem that the "UI" of the screen that closes at the moment of Pop overlapped. (The UI on the closing screen was purposely made large)

I didn't have this problem when working with Storyboard, what options should I give?


Solution

  • I had forgotten that there was a top-level super view.

    This was not a problem, but a natural result.

    At the top view Solved by applying "clips to bounds".

    It's my fault for not looking into it properly.

    self.view.clipsToBounds = true