Search code examples
xcodeswift3apple-watch

How to add 2 variables into a WKInterfaceLabel


I would like to add a string and an integer into one WKInterfaceLabel on WatchKit.

The integer is working fine like this;

self.green.setText(String(greenSpaces))

How would I go about adding this string;

let greenStreet = "Green Street "

Into the label? Thanks!


Solution

  • Suggest using string interpolation:

    self.green.setText("\(greenSpaces) Green Street")