小编mic*_*996的帖子

转场后屏幕变黑

我试图调试这个,但无济于事。

基本上,当我从第一个视图控制器切换到第二个视图控制器时,屏幕会暂时变黑。代码按照我的意愿执行,但屏幕变黑对我来说有点痛苦。

这是代码:

从第一页开始:

func mapView(_ mapView: MGLMapView, tapOnCalloutFor annotation: MGLAnnotation) {
        self.performSegue(withIdentifier: "goToSecond", sender: self)
    }
Run Code Online (Sandbox Code Playgroud)

第二个视图控制器:

override func viewDidLoad() {
    super.viewDidLoad()
    self.loadDataFromFirebase()
}
Run Code Online (Sandbox Code Playgroud)

第一个功能:

  func loadDataFromFirebase() {
           let db = Firestore.firestore()
           db.collection(restaurauntName).getDocuments { (snapshot, err) in
              if let err = err {
                 print("Error getting documents: \(err)")
                 return
              } else {
                 for document in snapshot!.documents {
                    let name = document.get("Name") as! String
                    let description = document.get("Description") as! String
                    self.names.append(name)
                    self.descriptions.append(description)
                 }
                 self.setupImages() //safe to do this here as the …
Run Code Online (Sandbox Code Playgroud)

xcode uicollectionview swift uicollectionviewdelegateflowlayout

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

AWS 用户无权访问此资源

我是 AWS API Gateway 和 Lambda 的新手,我想知道是否有人可以提供帮助?

在此输入图像描述

  • 我使用 Auth0 生成一个访问令牌,它适用于邮递员,为第一个 lambda 函数调用返回所有正确的 JSON 数据

  • 当我在邮递员上调用第二个 lambda 函数时,它表示用户没有获得此资源的授权:

"Message": "用户无权访问此资源"

403 Forbidden
Run Code Online (Sandbox Code Playgroud)

这仅持续 5 分钟,然后我可以在 Postman 上调用第二个函数,但无法再调用第一个函数并出现相同的错误。

关于如何解决这个问题的任何想法

谢谢!

amazon-web-services postman aws-lambda auth0 aws-api-gateway

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

错误:未知的对象类型“asyncfunction”

我对 AWS 的无服务器部署有疑问。我对它相当陌生,所以我不确定问题是什么。

我在网上找到了一些解决方案,但都没有奏效,因此任何想法都会被极大地接受。我也知道这里有一个非常相似的问题,但该解决方案不起作用,在询问更多细节后没有人回答,所以我提出了一个新问题。请帮忙!

Error: Unknown object type "asyncfunction"
          at Object._object (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:218:17)
          at Object._function (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:319:14)
          at Object.dispatch (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:185:30)
          at /Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:246:18
          at Array.forEach (<anonymous>)
          at Object._object (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:242:21)
          at Object._function (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:319:14)
          at Object.dispatch (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:185:30)
          at /Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:246:18
          at Array.forEach (<anonymous>)
          at Object._object (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:242:21)
          at Object.dispatch (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:185:30)
          at /Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:246:18
          at Array.forEach (<anonymous>)
          at Object._object (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:242:21)
          at Object.dispatch (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:185:30)
          at /Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:246:18
          at Array.forEach (<anonymous>)
          at Object._object (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:242:21)
          at Object.dispatch (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:185:30)
          at /Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:246:18
          at Array.forEach (<anonymous>)
          at Object._object (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:242:21)
          at Object.dispatch (/Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:185:30)
          at /Users/mick/Desktop/service/api-user-service/node_modules/object-hash/index.js:246:18
          at Array.forEach …
Run Code Online (Sandbox Code Playgroud)

serverless aws-serverless

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

React-Native GoogleSignin.SIGN_IN_CANCELLED

我使用react-native firebase从这个包中使用Google登录:

https://github.com/react-native-google-signin/google-signin#project-setup-and-initialization
Run Code Online (Sandbox Code Playgroud)

使用:yarn add @react-native-google-signin/google-signin

它在 Android 上完美运行,让我按需要登录,但它在 iOS 上根本不起作用,并且遇到了以下错误

ERROR TypeError: null is not an object (evaluating 'RNGoogleSignin.SIGN_IN_CANCELLED')
Run Code Online (Sandbox Code Playgroud)

我不明白为什么这种情况发生在 iOS 上而不是 Android 上:

过程:

1. yarn add @react-native-google-signin/google-signin
2. cd ios
3. pod install

- I have updated the GoogleService-Info.plist
- I have the enabled "sign in with Apple"
- The URL types have been update with reverse ID
Run Code Online (Sandbox Code Playgroud)

欢迎任何帮助!

firebase react-native firebase-authentication google-signin expo

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

如何创建轮播视图

我想知道是否有人可以告诉我在哪里可以获得有关如何制作轮播视图的更新教程。

我已经搜索遍了,但找不到不适合 Swift UI 或 XIB 文件已经过时的东西。

以下是我想要创建的内容:

https://raw.githubusercontent.com/alirezat775/CarouselView/master/assets/demo.gif

编辑:

我在这里找到了一个很酷的:

https://medium.com/@anitaa_1990/create-a-horizo​​ntal-paging-uiscrollview-with-uipagecontrol-swift-4-xcode-9-a3dddc845e92

xcode carousel ios uicollectionview swift

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

创建自定义 Mapbox 标记

我是在 iOS 上使用 MapBox 的新手,想知道是否有人有将自定义地图标记放在 iOS MapBox 地图上的经验。

我试过查看他们的文档,但他们只展示了如何使用 CSS 添加 HTML 标记,我不确定如何在 Swift 中实现。( https://docs.mapbox.com/help/tutorials/custom-markers-gl-js/#add-markers-to-the-map )

将我指向正确方向的任何帮助将不胜感激!

xcode ios mapbox swift

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