Edit tableView where rows are immutable values
<p>I'm trying to edit tableView rows on values that are immutable.</p>

<p>I keep getting the following when I allow editing on table:</p>

<blockquote>
  <p>Cannot use mutating member on immutable value: 'dataSet' is a get-only property</p>
</blockquote>

<p><strong>View Controller.swift</strong></p>

<pre><code>import UIKit

class TableVC: UIViewController, UITableViewDataSource, UITableViewDelegate {

@IBOutlet weak var table: UITableView!

override func viewDidLoad() {
    super.viewDidLoad()

    table.dataSource = self
    table.delegate = self

    NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(TableVC.reloadTable(_:)), name: "reloadData", object: nil)

    DataHandler.inst.loadData()
   self.navigationItem.leftBarButtonItem = self.editButtonItem()
}

func reloadTable(notif: AnyObject) {
    table.reloadData()
}

func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
    return 1
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
    return DataHandler.inst.dataSet.count
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
    let cellOld = tableView.dequeueReusableCellWithIdentifier("PicsCell") as? PicsCell

    let cell = cellOld != nil ? cellOld! : PicsCell()

    cell.initializeCell(DataHandler.inst.dataSet[indexPath.row])

    return cell
}

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    let selectedPic = DataHandler.inst.dataSet[indexPath.row]
    let view = ImageVC(pic: selectedPic)

    presentViewController(view, animated: true, completion: nil)
}



func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath){


    if editingStyle == UITableViewCellEditingStyle.Delete{


     //Error here saying Cannot use mutating member on immutable value: 'dataSet' is a get-only property   
    //    DataHandler.inst.dataSet.removeAtIndex(indexPath.row)


        tableView.reloadData()


     }


   }

 }
</code></pre>

<p><strong>DataHandler.swift</strong></p>

<pre><code>static let inst = DataHandler()

private var _dataSet = [Pics]()

var dataSet: [Pics] {
    return _dataSet
}

func addPic(img: UIImage, title: String, description: String) {

    let imgName = saveMyImage(img)
    let entry = Pics(img: imgName, title: title, description: description)
    _dataSet.append(entry)

    saveData()
    loadData()
}

private func saveData() {
    let data = NSKeyedArchiver.archivedDataWithRootObject(_dataSet)
    NSUserDefaults.standardUserDefaults().setObject(data, forKey: "data")
    NSUserDefaults.standardUserDefaults().synchronize()
}

func loadData() {
    guard let data = NSUserDefaults.standardUserDefaults().objectForKey("data") as? NSData else {
        return
    }
    guard let array = NSKeyedUnarchiver.unarchiveObjectWithData(data) as? [Pics] else {
        return
    }

    _dataSet = array

    NSNotificationCenter.defaultCenter().postNotificationName("reloadData", object: nil)
}

private func saveMyImage(img: UIImage) -&gt; String {
    let imgData = UIImagePNGRepresentation(img)
    let imgPath = "img\(NSDate.timeIntervalSinceReferenceDate()).png"
    let fullPath = getPathForImage(imgPath)

    imgData?.writeToFile(fullPath, atomically: true)
    return imgPath
}

private func getPathForImage(name: String) -&gt; String {
    let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
    let fullPath = paths[0] as NSString
    return fullPath.stringByAppendingPathComponent(name)
}

func imagePathName(name: String) -&gt; UIImage? {
    let path = getPathForImage(name)
    let img = UIImage(named: path)

    return img
   }
}
</code></pre>