You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -295,7 +295,9 @@ Some classes of libraries and frameworks are not designed to be subclasses. For
295
295
296
296
#### What is the difference between a struct and a class?
297
297
298
-
Structs are value types while classes are reference types. Classes have capabilities that structs do not:
298
+
The main difference to note is that structs are value types (stored on stack) while classes are reference types (stored on heap).
299
+
300
+
Classes have capabilities that structs do not:
299
301
- Inheritance enables one class to inherit the characteristics of another. ([source](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/ClassesAndStructures.html))
300
302
- Type casting enables you to check and interpret the type of a class instance at runtime.
301
303
- Deinitializers enable an instance of a class to free up any resources it has assigned.
0 commit comments