预期','在Swift“如果案例”中加入多条款条件的部分

时间:2017-12-07 00:04:44

标签: swift compiler-errors if-case

let age = 25      
if case 18...35 = age where age >= 21 { 
    print ("In Cool Demographic and of drinking age")
}

在Swift中,当我输入上面的代码时,它在“where”之前说,“w”下面有一条红线,它说:

  

预期','加入多条款条件的部分

有没有办法解决/解决这个问题?

0 个答案:

没有答案