Is Swift Pass By Value or Pass By Reference

Types of Things in Swift The rule is: Class instances are reference types (i.e. your reference to a class instance is effectively a pointer) Functions are reference types Everything else is a value type; “everything else” simply means instances of structs and instances of enums, because that’s all there is in Swift. Arrays and strings are struct instances, for example. You can pass … Read more