Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func calculerButtonAction(_ sender: Any) {
- let coteOneValue :Float = (self.coteOneTF.text! as NSString).floatValue
- let coteTwoValue :Float = (self.coteTwoTF.text! as NSString).floatValue
- let coteThreeValue:Float = (self.coteThreeTF.text! as NSString).floatValue
- let valueOne :Float = 1/coteOneValue
- let valuetwo :Float = 1/coteTwoValue
- let valueThree :Float = 1/coteThreeValue
- let miseValue :Float = valueOne + valuetwo + valueThree
- print(miseValue)
- let miseConstantValue : Float = 1.0
- if miseValue <= miseConstantValue {
- let alert = UIAlertController(title: "Information", message: "C' est un surebet", preferredStyle: UIAlertControllerStyle.alert)
- alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
- self.present(alert, animated: true, completion: nil)
- }
- else {
- let alert = UIAlertController(title: "Information", message: "C' est pas un surebet", preferredStyle: UIAlertControllerStyle.alert)
- alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
- self.present(alert, animated: true, completion: nil)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement