Strange behavior when pushing UIViewController

This is a very strange behavior when pushing vc that I have never seen since I started coding. The pushed ViewController is transparent and only navBarTitle is shown. After the push, you can't control anything unless you go back to the home screen.

STEPS TO REPRODUCE

  1. Long press currency change button below.(currencyWrapper)
  2. Call selectCountry and this bug happens.

SourceCode


    let currencyWrapper = UIView()

        private func configureCurrencyCard(){

        //The strange behavior shows up after long pressing this
        currencyWrapper.backgroundColor = .white
        currencyWrapper.addTarget(self, action: #selector(changeCurrency))
        currencyWrapper.setWidth(currencyChangeIcon.follow(by: 16, x: true))
        currencyWrapper.setCenterX(w1/2)
        currencyWrapper.setHeight(currencyLabel.follow(by: 12, x: false))
        currencyWrapper.roundToCircle(true)
        view.addSubview(currencyWrapper)

    }

    private func selectCountry(country: Country){

        let vc = CountryViewController(country: country)
        vc.hidesBottomBarWhenPushed = true
        navigationController?.pushViewController(vc, animated: true)
    }

This is how it looks after pushing the vc.

Does this happen when you long press something else? Your code for the currencyWrapper doesn't really affect the vc you're trying to view. You're just using it as the thing that you long press to display the vc.

So... Check if it happens on something else, but in the meantime, you should show us the relevant code for CountryViewController as that's the code that's being executed.

Strange behavior when pushing UIViewController
 
 
Q