Как мне это сделать, если, если статус равен статическому, я не хочу показывать его в таблице?Код ниже.Я только хотел показать все данные, но не данные с status == "static"
.
Response [["status": {
name = static;
}, "sched": 2015-01-01T08:00:00+08:00, "desc": Brush your teeth, "id": 249, "reward": 1.00, "parent": , "child": , "date_created": 2018-04-25T14:27:20.405928+08:00, "name": aBrush your teeth, "occurrence": {
name = once;
}, "type": , "date_modified": 2018-04-26T11:56:02.030647+08:00], ["status": {
name = static;
}, "sched": 2015-01-01T08:00:00+08:00, "desc": Brush your teeth, "id": 250, "reward": 1.00, "parent": , "child": , "date_created": 2018-04-25T14:28:49.780354+08:00, "name": Brush your teeth, "occurrence": {
name = once;
}, "type": , "date_modified": 2018-04-26T11:56:05.616333+08:00], ["status": {
name = static;
}, "sched": 2015-01-01T08:00:00+08:00, "desc": Brush your teeth, "id": 252, "reward": 1.00, "parent": , "child": , "date_created": 2018-04-25T14:31:02.274405+08:00, "name": Brush your teeth, "occurrence": {
name = once;
}, "type": , "date_modified": 2018-04-26T11:59:57.676148+08:00], ["status": {
name = static;
}, "sched": 2015-01-01T08:00:00+08:00, "desc": Brush your teeth, "id": 253, "reward": 1.00, "parent": , "child": , "date_created": 2018-04-25T14:34:37.097498+08:00, "name": Brush your teeth, "occurrence": {
name = once;
}, "type": , "date_modified": 2018-04-26T09:42:24.633359+08:00], ["status": {
name = static;
}, "sched": 2015-01-01T08:00:00+08:00, "desc": Brush your teeths, "id": 254, "reward": 1.00, "parent": , "child": , "date_created": 2018-04-25T14:36:53.766088+08:00, "name": Brush your teeth, "occurrence": {
name = once;
}, "type": , "date_modified": 2018-04-26T11:56:15.757769+08:00], ["status": {
name = ongoing;
}, "sched": 2018-04-19T15:54:24.657644+08:00, "desc": {
"questions" : [
{
"b" : 2,
"a" : 1
},
{
"b" : 3,
"a" : 2
},
{
"b" : 2,
"a" : 8
},
{
"b" : 9,
"a" : 7
},
{
"b" : 3,
"a" : 6
}
],
"operation" : "+"
}, "id": 260, "reward": 1.00, "parent": shit, "child": , "date_created": 2018-04-26T10:13:42.913149+08:00, "name": chorename, "occurrence": {
name = once;
}, "type": homework, "date_modified": 2018-04-26T10:13:42.953485+08:00]]
if let getTempDetails: [String : Any] = getAllDetail[indexPath.row] {
print("All Result: " , getTempDetails)
if let str = getTempDetails["status"] as? [String: String] {
if let name = str["name"] {
if name == "ongoing" {
cell.toDoItemLabel.text = getTempDetails["name"] as? String
cell.statuslabel.backgroundColor = created
// cell.label.textColor = UIColor(red: 0.9294, green: 0.3333, blue: 0.1804, alpha: 1.0)
// cell.backgroundColor = created
}else if name == "approved" {
cell.toDoItemLabel.text = getTempDetails["name"] as? String
cell.statuslabel.backgroundColor = done
}
else if name == "for approval" {
cell.toDoItemLabel.text = getTempDetails["name"] as? String
cell.statuslabel.backgroundColor = pending
}else if name == "near expiry" {
cell.toDoItemLabel.text = getTempDetails["name"] as? String
cell.statuslabel.backgroundColor = neardue
} else if name == "expired" {
cell.toDoItemLabel.text = getTempDetails["name"] as? String
cell.statuslabel.backgroundColor = expired
}else if name == "static" {
cell.toDoItemLabel.text = getTempDetails["name"] as? String
cell.statuslabel.backgroundColor = UIColor(red: 0.7686, green: 0.4235, blue: 0.3725, alpha: 1.0)
//
} else {
print("false")
cell.toDoItemLabel.text = "lols"
}
}
}
}