when select multiple rows should add in array maximum size of 2.
for example select row 1 , 2 names "a" , "b". if deselect "a" want array remove value.
i select ["a", "b"]
i decide deselect "a" should remove array ["b"]
var rows: [string] = [] func tableview(tableview: uitableview, willselectrowatindexpath indexpath: nsindexpath) -> nsindexpath? { rows.append(values[indexpath.row]) } func tableview(tableview: uitableview, diddeselectrowatindexpath indexpath: nsindexpath) { rows.remove(values[indexpath.row]) } extension array element: equatable { func remove(e: element) { // iam stuck here } }
here want:
extension array element: equatable { mutating func remove(e: element) { if let = self.indexof(e) { self.removeatindex(i) } } }
Comments
Post a Comment