条件中的变量绑定需要使用初始化程序-Swift

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了条件中的变量绑定需要使用初始化程序-Swift相关的知识,希望对你有一定的参考价值。

func viewWillAppear(_ animated: Bool) 
   super.viewWillAppear(animated)

   guard case let referenceImage == ARReferenceImage.referenceImages(inGroupNamed: "milk", bundle: nil)
   else 
      fatalError("Missing expected catalog resources")
   

条件中的变量绑定需要初始化程序

keeps会在else语句的开头弹出。我需要添加'if'吗?

答案

guard case let referenceImage ...替换guard referenceImage ...

以上是关于条件中的变量绑定需要使用初始化程序-Swift的主要内容,如果未能解决你的问题,请参考以下文章