Swift Xcode 10.1 - Tip Calculator Crashed Immediately : So I'm pretty new to Swift. I'm building a tip calculator in Swift and I found a tutorial online and modified it. It was a Swift 3 tutorial however, so I don't know how well it translates to Swift 10, but it was working until I tried added a feature that would allow me to split the bill. Now the whole app just gives me a white screen and no runtime errors.

I've tried to implement the splitting the bill feature two ways including using a switch case (currently in the code), and asking the user to input a number and neither way seemed to work.

    import UIKit
    
    class ViewController: UIViewController {
    
        @IBOutlet weak var billAmountField: UITextField!
    
        @IBOutlet weak var tipSelector: UISegmentedControl!
    
        @IBOutlet weak var userTipAmountField: UITextField!
    
        @IBOutlet weak var tipAmountField: UITextField!
    
        @IBOutlet weak var totalAmountField: UITextField!
    
        @IBOutlet weak var userSplitSelector: UISegmentedControl!
    
        @IBOutlet weak var totalSplitAmount: UITextField!
    
        @IBOutlet weak var numSplitLabel: UILabel!
        
        @IBAction func calculateTip(_ sender: AnyObject) {
            if let billAmount = Double(billAmountField.text!) {
                var tipPercentage = 0.0
                var split = 1.0
                
                switch tipSelector.selectedSegmentIndex {
                case 0:
                    tipPercentage = 0.15
                case 1:
                    tipPercentage = 0.18
                case 2:
                    tipPercentage = 0.20
                case 3:
                    userTipAmountField.isUserInteractionEnabled = true
                if let userTipAmount = Double(userTipAmountField.text!){
                        tipPercentage = userTipAmount / 100
                    }
                default:
                    break
                }
                
                switch userSplitSelector.selectedSegmentIndex {
                case 0:
                    if split >= 2 {
                        split -= 1
                    }
                    let splitString = String(split)
                    numSplitLabel.text = splitString
                case 1:
                    split += 1
                    let splitString = String(split)
                    numSplitLabel.text = splitString
                default:
                    break
                }
                
                
                let roundedBillAmount = round(100 * billAmount) / 100
                let tipAmount = roundedBillAmount * tipPercentage
                let roundedTipAmount = round(100*tipAmount)/100
                let totalAmount = roundedBillAmount + roundedTipAmount
                let totalSplitAmt = totalAmount / split
                
                if (!billAmountField.isEditing) {
                    billAmountField.text = String(format: "%.2f", roundedBillAmount)
                }
                tipAmountField.text = String(format: "%.2f", roundedTipAmount)
                totalAmountField.text = String(format: "%.2f", totalAmount)
                totalSplitAmount.text = String(format: "%.2f", totalSplitAmt)
                
                
            } else {
                //show error
                billAmountField.text = ""
                tipAmountField.text = ""
                totalAmountField.text = ""
                totalSplitAmount.text = ""
                }
            }
        
        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
        }
    
        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
            // Dispose of any resources that can be recreated.
        }
    
        override var preferredStatusBarStyle: UIStatusBarStyle {
            return .lightContent
        }
    }

I'm doing this project in a Virtual Machine if that matters.

[Here is my Storyboard][1]


  [1]: https://i.stack.imgur.com/eKJXl.png

Any suggestions on a fix would be much appreciated!