'White blank screen is displayed on the simulator when I run my Swift app on xcode

I'm just learning Swift, and whenever I test my app, only a white blank screen is displayed on the simulator, however, when I close Xcode, the app loads up on the simulator and it works fine, does anyone know what's the reason for this?

Thank you very much in advance!

screenshot before closing xcode: click to see

screenshot after closing xcode: click to see

the code I used:

import UIKit
import SwiftUI

class ViewController: UIViewController {

    @IBOutlet weak var priceTxt:UITextField!
    @IBOutlet weak var SalesTaxTxt:UITextField!
    @IBOutlet weak var totalPriceLbl:UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }


    @IBAction func calculateTotalPrice(_ sender: Any) {
        let price = Double(priceTxt.text!)!
        let salesTax = Double(SalesTaxTxt.text!)!
        
        let totalSalesTax = price * salesTax
        let totalPrice = price + totalSalesTax
        totalPriceLbl.text = "$\(totalPrice)"
    }
    
    
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source