DEVESH JHA
DEVESH JHA

Reputation: 19

Unable to display value of M_PI on UILabel swift

I am following a course CS 193P iPhone Application Development - Stanford University. In Lecture 1 of the tutorial the Same code snippet does not show any error. I am trying to display the value of M_PI on UILabel in swift for a Calculator project.But it shows an error 'Missing argument label: StringInterpolationSegment' on Line 4. Below is my code snippet.

  @IBAction func performOperation(sender:UIButton){

     var mathematicalSymbol  = sender.currentTitle!
     if(mathematicalSymbol == "π"){
       display.text = String(M_PI) //display it the variable for UILabel
     }
}

The Function performOperation() is linked to the UIButton with title π.

Upvotes: 0

Views: 58

Answers (0)

Related Questions