I made a segmented control in swift that changes a boolean to either true or false; However, every time I select "selectedSegmentedIndex == 1" in the application, I get error "Thread 1: signal SIGABERT"
My code goes as flows:
@IBOutlet weak var translationType: UISegmentedControl!
var state = true
@IBAction func translation(_ sender: Any)
{
if translationType.selectedSegmentIndex == 0
{
state = ture
}
else if translationType.selectedSegmentIndex == 1
{
state = false
}
}
Any information would be greatly appreciated. Thanks.
@IBOutlet weak var translationType: UISegmentedControl!with the corresponding item in the Storyboard.