NSDictionaryOfVariableBindings swift equivalent?

前端 未结 7 1905
闹比i
闹比i 2020-12-08 01:47

The Apple documentation shows an unsettling blank space under the \'Creating a Dictionary\' section of the UIKit reference here.

Has anyone found a replacement for

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 02:31

    That functionality is based on macro expansion which is currently not supported in Swift.

    I do not think there is any way to do something similar in Swift at the moment. I believe you cannot write your own replacement.

    I'm afraid you'll have to manually unroll the dictionary definition, even if it means repeating each name twice.

提交回复
热议问题