How to assign a Dictionary to AnyObject in swift

前端 未结 3 496
我在风中等你
我在风中等你 2021-01-18 11:04

I have been playing around with Swift. I have had multiple errors with types, especially working with Swift and my old Objective-C classes. The problem with this method is:

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-18 11:22

    In Swift 3

    code:
    
    var curArr:[Dictionary] = [
    [
            "imageName" : "photo.jpg",
            "colorDic" :[
                "red" : 1.0,
                "green" : 0.0,
                "blue" : 0.0
            ],
            "percentage" : 0.5
        ]
    ]
    

提交回复
热议问题