Dipesh Pokhrel
Dipesh Pokhrel

Reputation: 432

How swift compiler identifies variable is copy or strong while bridging from objective-C to swift?

(a)@property(nonatomic,copy) NSString *str1;

(b)@property(nonatomic,strong) NSString *str1;

How swift compiler identifies the variable is a copy or strong as both the string will be converted to same.

var str1 = "" .

Upvotes: 0

Views: 94

Answers (1)

Moshe Gottlieb
Moshe Gottlieb

Reputation: 4013

Swift doesn't care if it's "copy" or "strong".
It will call the selector setStr1(...) in the objective C class and the objective C implementation will decide if a copy or retain should be done.

Upvotes: 1

Related Questions