Is Swift Pass By Value or Pass By Reference

后端 未结 9 612
[愿得一人]
[愿得一人] 2020-11-22 10:04

I\'m really new to Swift and I just read that classes are passed by reference and arrays/strings etc. are copied.

Is the pass by reference the same way as in Objecti

9条回答
  •  长发绾君心
    2020-11-22 10:14

    Classes are passed by references and others are passed by value in default. You can pass by reference by using the inout keyword.

提交回复
热议问题