小编mok*_*258的帖子

反应本机和流错误消息

嗨,我试图用React Native做一些你好的世界.我创建项目'react-native init'更改'.flowconfig'中的流版本.

跑流,它给了我153个错误,在node_modules文件夹中 node_modules/react-native/Libraries

有没有人遇到同样的问题?

flowtype react-native

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

为什么 NSDateFormatter 在给定空字符串(“”)时不返回 nil

我有一个简单的问题。\n根据苹果官方文档\n https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/#//apple_ref/occ/instm/NSDateFormatter /dateFromString

\n\n

NSDateFormatter.dateFromString(String) 将返回

\n\n
\n

使用接收器\xe2\x80\x99s 当前设置解释的字符串的日期表示形式。如果 dateFromString: 无法解析字符串,则返回 nil。

\n
\n\n

然后当我给它一个空字符串“”时,它应该返回nil吗?\n当我在操场上这样做时

\n\n
let date = ""\nlet dateFormatter = NSDateFormatter()\ndateFormatter.dateFormat = "yyyyMMdd"\nprint(dateFormatter.dateFromString(date))\n
Run Code Online (Sandbox Code Playgroud)\n\n

它给了我

\n\n
"Optional(1999-12-31 15:00:00 +0000)\\n"\n
Run Code Online (Sandbox Code Playgroud)\n\n

这是正常行为吗?\n还是我做错了什么?

\n\n

谢谢

\n

iphone nsdateformatter ios swift

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

Firebase Auth UI 未在 iOS(Swift) 中显示

我想试用 Firebase Auth UI,我正在关注官方文档。文档(至少对于 iOS 而言)非常混乱,有些内容已经过时(导入命名不正确等)。现在我只想在我的测试应用程序开始时显示 Firebase AuthUI 屏幕。我在下面试过

import UIKit
import FirebaseAuthUI
import FirebaseFacebookAuthUI
import FirebaseTwitterAuthUI

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        if let authUI = FUIAuth.defaultAuthUI() {
            authUI.delegate = self

            // Setup login provider ( Need to import these seperately )
            authUI.providers = [ FUIFacebookAuth(), FUITwitterAuth() ]

            let authViewController = authUI.authViewController()
            present(authViewController, animated: true, completion: {})
        }
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

}

extension ViewController: …
Run Code Online (Sandbox Code Playgroud)

ios firebase swift firebase-authentication

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