上下文类型“Any”不能与字典文字一起使用

时间:2017-12-29 12:50:00

标签: swift arkit

我收到了这个错误,我是swift的新手,我想从ARKit中创建一个json

let jsonObject: [String: Any] = [
            "imageName": imageName,
            "timeStamp": currentFrame.timestamp,
            "cameraPos": dictFromVector3(positionFromTransform(currentFrame.camera.transform)),
            "cameraEulerAngle": dictFromVector3(currentFrame.camera.eulerAngles),
            "cameraTransform": arrayFromTransform(currentFrame.camera.transform),
            "cameraIntrinsics": arrayFromTransform(currentFrame.camera.intrinsics),
            "imageResolution": [
                "width": currentFrame.camera.imageResolution.width,
                "height": currentFrame.camera.imageResolution.height
            ],
            "lightEstimate": currentFrame.lightEstimate?.ambientIntensity,
            "ARPointCloud": [
                "count": currentFrame.rawFeaturePoints?.count,
                "points": arrayFromPointCloud(currentFrame.rawFeaturePoints)
            ]
        ]

0 个答案:

没有答案