Are Swift variables atomic?

前端 未结 6 1277
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 04:19

In Objective-C you have a distinction between atomic and nonatomic properties:

@property (nonatomic, strong) NSObject *nonatomicObject;
@property (atomic, st         


        
6条回答
  •  半阙折子戏
    2020-11-28 04:45

    It is probably to early to answer this question. Currently swift lacks access modifiers, so there is not obvious way to add code which manages concurrency around a properties getter / setter. Furthermore, the Swift Language doesn't seem to have any information about concurrency yet! (It also lacks KVO etc ...)

    I think the answer to this question will become clear in future releases.

提交回复
热议问题