<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/swift-mastery-series-part-8-swift-structs-jdsa4cvoi" -->

---
title: Swift Mastery Series — Part 8: Swift Structs | daily.dev
description: A reflection on Swift's preference for structs over classes, covering value vs reference semantics, Copy-on-Write mechanics, performance considerations, and...
canonical: https://daily.dev/posts/swift-mastery-series-part-8-swift-structs-jdsa4cvoi
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Swift Mastery Series — Part 8: Swift Structs | daily.dev
og:description: A reflection on Swift's preference for structs over classes, covering value vs reference semantics, Copy-on-Write mechanics, performance considerations, and...
og:url: https://daily.dev/posts/swift-mastery-series-part-8-swift-structs-jdsa4cvoi
og:image: https://api.daily.dev/og/posts/JdsA4cVoI.png
og:image:alt: Swift Mastery Series — Part 8: Swift Structs
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Swift Mastery Series — Part 8: Swift Structs

**[iOS Developers](https://daily.dev/sources/ios_dev)** · [@divyesh_vekariya](https://daily.dev/divyesh_vekariya) · 1 min read · 8 upvotes · 1 comments

## Summary

A reflection on Swift's preference for structs over classes, covering value vs reference semantics, Copy-on-Write mechanics, performance considerations, and concurrency implications. The author shares how their default shifted from reaching for classes to questioning whether reference semantics are truly needed, and invites discussion on how others make this decision in production code.

## Content

When I first started with Swift, I came from languages where classes were the default.

So I naturally reached for `class` almost every time.

Over time, that completely changed.

The more I learned about value semantics, Copy-on-Write, and Swift's concurrency model, the more I understood why Apple recommends starting with `struct`.

Now my default question isn't:

_"Why use a struct?"_

It's:

_"Do I actually need reference semantics here?"_

I'm curious how others approach this.

Do you default to `struct` and only use `class` when necessary, or do you have a different rule of thumb?

In this article, I explore:

- Why Apple favors `struct`
- Value vs reference semantics
- Copy-on-Write
- Performance and concurrency implications
- When `class` is still the better tool

I recently explored the reasoning behind Swift's value-type philosophy in more detail:

[https://medium.com/@dkvekariya/swift-structs-why-apple-chooses-value-types-over-classes-f60b79aa3659](https://medium.com/@dkvekariya/swift-structs-why-apple-chooses-value-types-over-classes-f60b79aa3659)

**Question:** What's your rule for deciding between a `struct` and a `class` in production code?

#Swift #iOS #Programming #SwiftUI

## Similar posts on daily.dev

- [Mobile Terse \| Swift \(English\)](https://daily.dev/posts/mobile-terse-swift-english--2qi74tjxi) · Medium · 0 upvotes · 0 comments
- [Swift Concurrency is Gaining Broader Adoption -- Fatbobman's Swift Weekly \#133](https://daily.dev/posts/swift-concurrency-is-gaining-broader-adoption----fatbobman-s-swift-weekly-133-40hcoackj) · Fatbobman · 0 upvotes · 0 comments
- [Swift is a more convenient Rust](https://daily.dev/posts/swift-is-a-more-convenient-rust-q8tewla9o) · Hacker News · 3 upvotes · 0 comments

---

Tags: [#ios](https://daily.dev/tags/ios), [#swift](https://daily.dev/tags/swift)

[View this post on daily.dev](https://daily.dev/posts/swift-mastery-series-part-8-swift-structs-jdsa4cvoi)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/swift-mastery-series-part-8-swift-structs-jdsa4cvoi","headline":"Swift Mastery Series — Part 8: Swift Structs","text":"A reflection on Swift's preference for structs over classes, covering value vs reference semantics, Copy-on-Write mechanics, performance considerations, and concurrency implications. The author shares how their default shifted from reaching for classes to questioning whether reference semantics are truly needed, and invites discussion on how others make this decision in production code.","url":"https://daily.dev/posts/swift-mastery-series-part-8-swift-structs-jdsa4cvoi","datePublished":"2026-08-14T15:00:00.267Z","dateModified":"2026-09-13T21:08:54.752Z","author":{"@type":"Person","name":"Divyesh Vekariya","url":"https://daily.dev/divyesh_vekariya","image":"https://media.daily.dev/image/upload/s--RDCl1xsD--/f_auto/v1728905544/avatars/avatar_WXcnVdXbQljWuHJCBcViw","description":"Senior iOS Developer, Tech Content Writer, Learner, Tech enthusiast and SwiftUI Addicted.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":39130}},"image":"https://media.daily.dev/image/upload/s--ZNbKLqZ7--/f_auto/v1785995303/posts/JdsA4cVoI?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/ios_dev","name":"iOS Developers"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"iOS Developers","item":"https://daily.dev/squads/ios_dev"},{"@type":"ListItem","position":3,"name":"Swift Mastery Series — Part 8: Swift Structs"}]}
```

