我的if
无效
feelingRef.child("conditions/needsattention").observeEventType(.Value) { (snap: FIRDataSnapshot) in
print((snap.value?.description)!)
if (snap.value?.description)! == 1 {
self.conditionLabel.text = "관심필요"
}
}
当我打印snap的值时,它会打印1,但if
无法正常工作!!!
答案 0 :(得分:0)
它可以是String
类型,因此请查看变量的dynamicType
print(snap.value!.description.dynamicType)
if (snap.value!.description)! == "1" {
self.conditionLabel.text = "관심필요"
}