title: How to get checkmarked items in TableView in Swift 2.0
body: <p>I want to get a check marked items in my <code>tableView</code> but I couldn't find any solution about this. I tried to use <code>NSArray</code> but it crash with <code>'Array out of bounds'</code> error it causes crash because when I want to remove at <code>indexPath</code> it doesn't have that index and it crash so I decided to use <strong>unordered collection</strong> like <code>Dictionary</code> but this time it doesn't remove items in selected <code>indexPath</code> exactly. There is my codes in my <code>TableView</code>.</p>
  
  <pre><code>let services = ["1", "2", "3"]
  var selectedServices = [Int: String]()
  var selectedServicesArray = [String]()
  
  @IBOutlet weak var saveButtonOutlet: UIButton!
  // MARK: - LifeCycle
  
  override func viewDidLoad() {
      super.viewDidLoad()
      DesignSettings().clipComponents([saveButtonOutlet])
  }
  
  // MARK: - TableView DataSource &amp; Delegate Methods
  
  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return services.count
  }
  
  func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
      if let selectedRow = tableView.cellForRowAtIndexPath(indexPath) {
          if selectedRow.accessoryType == .None {
              selectedRow.accessoryType = .Checkmark
              selectedServices[indexPath.row] = selectedRow.textLabel?.text
          } else {
              selectedRow.accessoryType = .None
              selectedServices.removeValueForKey(indexPath.row)
          }
      }
      for (_, value) in selectedServices {
          self.selectedServicesArray.append(value)
      }
  }
  
  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      let cell = self.tableView.dequeueReusableCellWithIdentifier(Constants.CellIdentifier, forIndexPath: indexPath)
      cell.textLabel?.text = services[indexPath.row]
  
      return cell
  }
  </code></pre>
  
  <p>And there is the <code>console</code> print;</p>
  
  <pre><code>["1", "1", "2"]
  ["3"]
  ["2", "3", "2"]
  ["2", "1", "1", "2", "3", "1", "2"]
  </code></pre>
  
  <p>How can i solve this problem ? 
  What is the correct way to get check marked items in tableView? 
  Thanks !</p>