Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of "<-" in Swift

I am reviewing a code from other developers and I saw some unfamiliar codes. One of the unfamiliar code is this.

identifier <- map["id"]

identifier is a variable inside the struct. Can you please help me what is the use of "<-" symbol? I tried googling it but I can't find the right answer. Thank you!

like image 211
Alvin John Avatar asked Aug 03 '16 09:08

Alvin John


1 Answers

The <- operator is not part of Swift.

There's nothing in the Swift manual about it.

It is a custom operator defined by a third-party library you're using in your project.

If you do a CMD-click on it, Xcode should open the operator's declaration

like image 195
Eric Aya Avatar answered Oct 18 '22 07:10

Eric Aya