我需要帮助,我的问题是我在迁移Swift3 for Swift4时,在某些方法中会出现语法问题。 错误的消息是:条件绑定的初始化程序必须具有可选类型,而不是' AVCaptureVideoPreviewLayer'
{if $field.value || ($field.name == "newsletter" && $page.page_name == 'authentication') || ($field.name == "optin" && $page.page_name == 'authentication') || ($field.name == "newsletter" && $page.page_name == 'checkout') || ($field.name == "optin" && $page.page_name == 'checkout') }checked="checked"{/if}
答案 0 :(得分:0)
尝试一下,为我工作。重写您的行(6),如下所示:
layer.videoGravity = AVLayerVideoGravity(rawValue: convertFromAVLayerVideoGravity(AVLayerVideoGravity.resizeAspectFill))