当我尝试在函数前面添加private时,Xcode会抱怨“属性private只能在非本地范围内使用”

时间:2016-08-01 21:33:24

标签: ios swift xcode function private

当我尝试在函数前面添加private时,xcode会抱怨“private private只能在非本地范围内使用”。我认为“私人”被认为是用于你想让当地人保持正确的事情吗?

有人能告诉我如何获取错误消息吗?我仍然希望将该功能保密。

enter image description here

1 个答案:

答案 0 :(得分:4)

我在这里通过搜索此错误attribute private can only be used in a non local scope而做到了。就我而言,这是由于switch语句末尾缺少右括号引起的。希望这对某人有帮助。