Created
June 15, 2020 13:04
-
-
Save mspvirajpatel/ff334fea37061bcf617783095dcefdf5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct LoginUserData { | |
public var userId: String? = "" | |
public var userName: String? = "" | |
public var email: String? = "" | |
public var gender: Int = 0 | |
public var birthday: String? = "" | |
public var about: String? = "" | |
public var photoUrl: String? = "" | |
public var idToken: String? = "" | |
public var accessToken: String? = "" | |
} |
public typealias UserDataComplition = (_ userData: LoginUserData?, _ error: Error?) -> Void
var userDataBlock: UserDataComplition?
public func login(controller: UIViewController, complitionBlock: @escaping UserDataComplition, didDisconnectBlock: @escaping UserDataComplition) {
userDataBlock = complitionBlock
userDidDisconnectWithBlock = didDisconnectBlock
googleManager?.presentingViewController = controller
googleManager?.delegate = self
googleManager?.signIn()
}
userData = data
if let block = self.userDataBlock {
block(data, nil)
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class Defaults {
}