Skip to content

Instantly share code, notes, and snippets.

@KrauserHuang
Created December 29, 2020 04:56
Show Gist options
  • Save KrauserHuang/2fe321f62e30da7fcb19e17ed22fc4af to your computer and use it in GitHub Desktop.
Save KrauserHuang/2fe321f62e30da7fcb19e17ed22fc4af to your computer and use it in GitHub Desktop.
@IBSegueAction func showResult(_ coder: NSCoder) -> ResultViewController? {
let sex = sexSegmented.titleForSegment(at: sexSegmented.selectedSegmentIndex) ?? "Male"
let age = ageTextField.text!
let height = heightTextField.text!
let weight = weightTextField.text!
let activitySelection = activityButtonText.titleLabel?.text ?? "Sedentary(office job)"
let controller = ResultViewController(coder: coder)
controller?.bmrInfo = BmrInfo(sex: sex, age: age, height: height, weight: weight, activitySelection: activitySelection)
return controller
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment