小编Lat*_*nec的帖子

Firebase身份验证错误处理

不确定这是否已经存在,但我找不到它,所以我做到了.希望这能为某人提供帮助.您必须遵循的步骤:

步骤#1尝试登录后输入guard语句

步骤#2调用fireErrorHandle函数

就是这样,享受吧!

guard let error = AuthErrorCode(rawValue: (error?._code)!) else {
                    return
}
fireErrorHandle(code: error)

func fireErrorHandle(code: AuthErrorCode) {
    switch code {
    case .invalidCustomToken:
        print("Indicates a validation error with the custom token")
    case .customTokenMismatch:
        print("Indicates the service account and the API key belong to different projects")
    case .invalidCredential:
        print("Indicates the IDP token or requestUri is invalid")
    case .userDisabled:
        print("Indicates the user's account is disabled on the server")
    case .operationNotAllowed:
        print("Indicates the administrator disabled sign in with the …
Run Code Online (Sandbox Code Playgroud)

error-handling ios firebase firebase-authentication swift3

7
推荐指数
0
解决办法
1299
查看次数

跟踪应用程序Swift中的所有用户触摸

我正在搜索有关我想要跟踪所有用户触摸的问题的stackoverflow上的一周,但没有成功我知道有很多问题像这样打开但不具体我正在寻找什么.

我想要的: 跟踪所有用户触摸,包括例如按下UIButton或按下UITextfield或打开一些ViewController等等.但是:为什么这个问题不同,我想要一些标签文本来解释按下哪个确切的按钮,例如,如果我有LoginVC并且有登录按钮,我想要方法来解释" 按下登录按钮 "或" 已按下忘记按钮 "然后记录此事件/触摸.

提前致谢!

events xcode ios swift

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

私人IBOutlets Swift

我知道我们的 IBOutlets 应该是私有的,但是例如如果我在 TableViewCell 中有 IBOutlets,我应该如何从另一个 ViewController 访问它们?这是我问这种问题的例子:

class BookTableViewCell: UITableViewCell {

    @IBOutlet weak private var bookTitle: UILabel!

}
Run Code Online (Sandbox Code Playgroud)

如果我分配给 IBOutlet 它应该是私有的,当我访问单元属性时,我在另一个 ViewController 中遇到错误:由于“私有”保护级别,“bookTitle”无法访问

xcode private iboutlet swift

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

Swift中UITableViewCell中的同步滚动UICollectionViews

我有这样的结构:

UITableView-> UITableViewCell-> UICollectionView-> UICollectionViewCell

所以,我想要实现的是,我想让UICollectionViewsUITableViewCells中滚动同步。例如,当您手动滚动第一行的第一个UICollectionView时,我希望其余的UICollectionViews都可以跟随,但是“文本标签” 始终保持在相同位置。(请参见下图)

编辑:我知道我必须以contentOffset某种方式使用,但不知道如何在这种情况下实现。任何帮助,将不胜感激。

点击查看图片

点击查看gif

xcode uitableview ios uicollectionview swift

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