title: Identify a UIButton that is pressed in swift?
body: <p>How can I identify a UIButton element as a string and use that string in a function call? I want to be able to know what button has been pressed and then provide information based on that button that has been pressed. Would I use String Interpolation? I then want to use the string and run a query from the Foursquare API.</p>
  
  <p>Below is the code I have been working on:</p>
  
  <p>Firstly the button names:</p>
  
  <pre><code>let buttonNames = ["african", "buffet", "burger", "chinese", "fries", "grill", "icecream", "jap", "mex", "pizza", "seafood", "streetfood", "taj", "turkey"
  </code></pre>
  
  <p>The search term results:</p>
  
  <pre><code>var searchTerms = ["African", "All you can eat", "Buffet", "Burgers", "Brazilian", "Breakfast", "BBQ", "Chips", "Chinese", "Cakes", "Café", "Doughnuts", "Dessert", "English Breakfast", "Fast Food", "Fries", "French", "Grill", "Greek", "Italian", "Indian", "Japanese", "Jamaican", "Lebenese", "Mexican", "Pizza", "Street Food", "Sandwhich", "Turkish"]
  </code></pre>
  
  <p>Then the function call :</p>
  
  <pre><code>@IBAction func startSearchQuery() {
      if buttonNames == searchTerms {
          // Do Something
          var parameters = [Parameter.query:""]
          parameters += self.location.parameters()
          let searchTask = session.venues.search(parameters) {
              (result) -&gt; Void in
              if let response = result.response {
                  self.venues = response["venues"] as [JSONParameters]?
                  self.tableView.reloadData()
              }
          }
          searchTask.start()
      } else {
          print("Search term not found!")
      }
  }
  </code></pre>
  
  <p>If I can get some help on this I will be grateful. Thanks all!</p>