switch

switch_第1张图片
switch.jpeg

判断区间
switch credit {
case 0...30:
self.creditLab.text = "(credit)分,信用值较差"
case 30...70:
self.creditLab.text = "(credit)分,信用值一般"
case 70...90:
self.creditLab.text = "(credit)分,信用值较好"

            default:
                self.creditLab.text = "\(credit)分,信用值超好"
                
            }

你可能感兴趣的:(switch)