diff --git a/simpleui/Info.plist b/simpleui/Info.plist index 05e4576..e121985 100644 --- a/simpleui/Info.plist +++ b/simpleui/Info.plist @@ -43,5 +43,9 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + NSLocationAlwaysUsageDescription + show user location + NSLocationWhenInUseUsageDescription + show user location diff --git a/simpleui/ViewController.swift b/simpleui/ViewController.swift index 346b847..a40d652 100644 --- a/simpleui/ViewController.swift +++ b/simpleui/ViewController.swift @@ -10,5 +10,49 @@ import UIKit class ViewController: UIViewController { + @IBOutlet weak var gewichtLabel: UILabel! + @IBOutlet weak var größeLabel: UILabel! + + + override func viewDidLoad() { + super.viewDidLoad() + + slyderGröße(slyderGröße) + slyderGewicht(slyderGewicht) + + bmiLabel.text = "Hier wird dein BMI stehen" + } + + + @IBAction func slyderGewicht(_ sender: Any) { + + gewichtLabel.text = "\(slyderGewicht.value)" + + } + + @IBOutlet weak var slyderGewicht: UISlider! + @IBAction func slyderGröße(_ sender: Any) { + + größeLabel.text = "\(slyderGröße.value)" + } + + + + @IBOutlet weak var slyderGröße: UISlider! + + + + + @IBAction func berechneBMI(_ sender: Any) { + + let größe = slyderGröße.value + let gewicht = slyderGewicht.value + + let bmi = gewicht / pow(größe,2) + + bmiLabel.text = "\(bmi)" + + } + @IBOutlet weak var bmiLabel: UILabel! } diff --git a/simpleui/main.storyboard b/simpleui/main.storyboard index 764f719..fd21bd4 100644 --- a/simpleui/main.storyboard +++ b/simpleui/main.storyboard @@ -20,11 +20,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +