title: Swift 4.2 // Argument passed to call that takes no arguments
body: <p>I wrote code (you can find it below), but it partly doesn't work. I want to create an app, where I can push the button <code>pushMicButton</code> and when the button is pressed just tell some words and SpeechKit or something like this will recognise it and add the word, system have recognised, to  a recognizedLabel.text. I created such code, but I have a failure in line 43.</p>
  
  <p>Could you help me and fix my code?</p>
  
  <p>Thank you!</p>
  
  <p>Code sample:</p>
  
  <pre><code>import UIKit
  import Speech
  
  class VoiceController: UIViewController {
  
      private let speechRecognizer = SFSpeechRecognizer(locale: Locale(identifier: "se-SE"))
  
      @IBOutlet weak var recognizedLabel: UILabel!
  
      @IBAction func pushMicButton(_ sender: Any) {
          print("Voice recognition button")
          voiceRecognition()
      }
  
      @IBAction func AddToListButton(_ sender: UIButton) {
          print("Add something to list")
          getAddedData()
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
  
      }
  
      func voiceRecognition() {
  
          SFSpeechRecognizer.requestAuthorization { _ in
              DispatchQueue.main.async {
                  switch SFSpeechRecognizer.authorizationStatus() {
                  case .authorized:
  
                      let audioURL = Bundle.main.url(forResource: "test", withExtension: "wav")!
                      let recognizer = SFSpeechRecognizer()
                      let request = SFSpeechRecognitionRequest(url: audioURL)
                      recognizer?.recognitionTask(with: request) { result, error in
                          guard error == nil else { print("Error: \(error)"); return }
                          guard let result else {print ("No result!"); return}
                          self.recognizedLabel.text = result.bestTranscription.formattedString
                      }
                      break
                  default:
                      break
                  }
              }
          }
  
          //ADD VOICE RECOGNITION HERE
  
      }
  
      func getAddedData() {
          let originalString = recognizedLabel.text
          let escapedString = originalString!.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)
          let dataLink = "http://yabahi.st/items/find?name="
          let lookingURL = dataLink + escapedString!
  
          guard let url = URL(string: lookingURL) else {return}
          let task = URLSession.shared.dataTask(with: url) { (data, response, error) in
              guard let dataResponse = data,
                  error == nil else {
                      print(error?.localizedDescription ?? "Response Error")
                      return }
              do{
                  let jsonResponse = try JSONSerialization.jsonObject(with:
                      dataResponse, options: [])
                  print(jsonResponse)
  
                  //SEND "jsonResponse.name" TO MAIN UITABLEVIEW
  
              } catch let parsingError {
                  print("Error", parsingError)
              }
          }
          task.resume()
      }
  
  }
  </code></pre>