Xcode错误“函数声明的参数列表中预期的'('”

时间:2019-11-13 03:04:17

标签: swift firebase google-signin

在“ func filepriavte; func setupGoogleButtons()”处得到错误,说“函数声明的参数列表中预期的'('”

import UIKit

import Firebase

import GoogleSignIn

class ViewController: UIViewController, GIDSignInUIDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        setupGoogleButtons()
    }

    ****func filepriavte; func setupGoogleButtons()** {**
        // Add Google Login Button

        let googleButton = GIDSignInButton()
        googleButton.frame = CGReact(x: 60, y: 500, width: view.frame.width - 115,
                                     geight: 50)
        view.addSubview(googleButton)

        GIDSignIn.sharedInstance().uiDelegate = self
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}

1 个答案:

答案 0 :(得分:0)

总体控制器应如下所示

import UIKit

import Firebase

import GoogleSignIn

class ViewController: UIViewController, GIDSignInUIDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        setupGoogleButtons()
    }

    priavte func setupGoogleButtons() { // Use private instead of fileprivate
        // Add Google Login Button

        let googleButton = GIDSignInButton()
        googleButton.frame = CGReact(x: 60, y: 500, width: view.frame.width - 115,
                                     geight: 50)
        view.addSubview(googleButton)

        GIDSignIn.sharedInstance().uiDelegate = self
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}

希望这会起作用。