Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. @IBAction func calculerButtonAction(_ sender: Any) {
  2.  
  3. let coteOneValue :Float = (self.coteOneTF.text! as NSString).floatValue
  4. let coteTwoValue :Float = (self.coteTwoTF.text! as NSString).floatValue
  5.  
  6. let valueOne :Float = 1/coteOneValue
  7. let valuetwo :Float = 1/coteTwoValue
  8.  
  9. let miseValue :Float = valueOne + valuetwo
  10. print(miseValue)
  11. let miseConstantValue : Float = 1.0
  12. if miseValue <= miseConstantValue {
  13.  
  14. let alert = UIAlertController(title: "Information", message: "C' est un surebet", preferredStyle: UIAlertControllerStyle.alert)
  15. alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
  16. self.present(alert, animated: true, completion: nil)
  17. }
  18. else {
  19.  
  20. let alert = UIAlertController(title: "Information", message: "C' est pas un surebet", preferredStyle: UIAlertControllerStyle.alert)
  21. alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
  22. self.present(alert, animated: true, completion: nil)
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement