小编moe*_*far的帖子

无法快速添加 IBOutlet

我正在尝试快速添加 IBOutlet,但我只能选择添加操作。

这是我正在谈论的内容的图像。

在此处输入图片说明]

有什么办法可以解决这个问题吗?

我也无法更改连接类型。

xcode ios swift swift4

2
推荐指数
1
解决办法
814
查看次数

无法将“Void”类型的返回表达式转换为“(String, String, String)”类型

我是 Swift 的新手,我正在尝试返回在此函数中创建的变量的值。我已经面临这个问题很长一段时间了,希望任何人都可以对此有所了解并帮助我。我曾尝试更改函数的返回类型,但没有奏效。任何帮助将不胜感激

这是代码:

func grabData1() -> (String, String, String)  {
       
        db.collection("News").document("Article 1").getDocument { (document, error) in
            if error == nil {
                if document != nil && document!.exists{
                    self.headline1 = document?.get("Headline").map(String.init(describing:)) ?? nil
                    var article = document?.get("Article").map(String.init(describing:)) ?? nil
                    var image1URL = URL(string: document?.get("Image") as! String)
                    return (headline1, article, image1URL)
                    
                }
            } 
        }
        
    } 
Run Code Online (Sandbox Code Playgroud)

firebase swift google-cloud-firestore

1
推荐指数
1
解决办法
1180
查看次数

标签 统计

swift ×2

firebase ×1

google-cloud-firestore ×1

ios ×1

swift4 ×1

xcode ×1