Sitemap
iOS Essentials

Welcome to iOS Essentials, your ultimate resource for mastering iOS development. Whether you’re a seasoned developer or just starting out, our publication provides valuable insights, tips, and tutorials to help you excel in creating exceptional iOS applications.

Member-only story

Difference between value type and a reference type in iOS swift?

7 min readMay 2, 2018

--

As the title says, there are two categories a type in swift can fall into:

  • Value Type
  • Reference Type

Very basic definition:

Value Type — each instance keeps a unique copy of its data. A type that creates a new instance (copy) when assigned to a variable or constant, or when passed to a function.

Reference Type — each instances share a single copy of the data. A type that once initialized, when assigned to a variable or constant, or when passed to a function, returns a reference to the same existing instance.

Have a look at the following gif to get a proper understanding about what you just read.

--

--

iOS Essentials
iOS Essentials

Published in iOS Essentials

Welcome to iOS Essentials, your ultimate resource for mastering iOS development. Whether you’re a seasoned developer or just starting out, our publication provides valuable insights, tips, and tutorials to help you excel in creating exceptional iOS applications.

Abhimuralidharan
Abhimuralidharan

Written by Abhimuralidharan

iOS and tvOS developer, dreamer, photographer 🤨

Responses (10)