I am new to coding and swift (hopefully I'm in the right category)
Anyway I followed a tutorial on building a MacOS app here, macOS Development for Beginners: Part 1 | raywenderlich.com
It worked but I don't really want to build of MacOS (yet, at least) so I am trying to recreate the app for iPhone XR, I got everything set up but I am receiving an error,
Value of type 'UITextField?' has no member 'stringValue'
Here is a copy of the code I have;
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var nameField: UITextField!
@IBOutlet weak var helloLabel: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
@IBAction func sayButtonClicked(_ sender: Any) {
var name = nameField.stringValue
if name.isEmpty {
name = "World!"
}
let greeting = "Hello \(name)! Polar bears are marines mammals, and spend much of their time on Artic sea ice. Did you know that \(name)? Although, I am an iPhone with Siri, I was not aware of that. Yay, Polar bears!"
helloLabel.stringValue = greeting
}
}