Swift:找不到“|"的重载接受提供的参数 [英] Swift: Could not find an overload for '|' that accepts the supplied arguments

查看:17
本文介绍了Swift:找不到“|"的重载接受提供的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将 Parse 合并到一个新的 Swift 项目中.

Trying to incorporate Parse into a new Swift project.

当我到达这个街区时:

logInViewController.fields = PFLogInFieldsUsernameAndPassword | PFLogInFieldsLogInButton | PFLogInFieldsSignUpButton | PFLogInFieldsPasswordForgotten

我在 XCode 6 中遇到此错误:

I'm getting this error in XCode 6:

Could not find an overload for '|' that accepts the supplied arguments

有人碰巧知道这种语法有什么问题吗?

Anyone happen to know what's wrong with that syntax?

推荐答案

使用 .value 然后使用结果创建一个 PFLogInFields 实例:

Use the .value then use the result to create a PFLogInFields instance:

logInViewController.fields = PFLogInFields(PFLogInFieldsUsernameAndPassword.value 
    | PFLogInFieldsLogInButton.value)

这篇关于Swift:找不到“|"的重载接受提供的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆