---
title: "Discussion on \"@MainActor attribute - when to apply\" | Hashnode"
description: "Discussion on \"@MainActor attribute - when to apply\". If you are in the middle of having Swift five and six in your code base, then you will need to proactively deal with applying the main actor attribute to your Swift five code, so that it doesn't break when you upgrade to Swift six.\nThis can happen if..."
url: "https://hashnode.com/posts/mainactor-attribute-when-to-apply/6892fd55c95d6801a53513c8"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [@MainActor attribute - when to apply](https://coderlyn.hashnode.dev/mainactor-attribute-when-to-apply?utm_source=hashnode&utm_medium=feed)

If you are in the middle of having Swift five and six in your code base, then you will need to proactively deal with applying the main actor attribute to your Swift five code, so that it doesn't break when you upgrade to Swift six. This can happen if...

Aug 6, 2025 · 2 min read · coderlyn.hashnode.dev  
Read the article

-   [#swift](https://hashnode.com/tag/swift)

## Written by

[Lyn Tee](https://hashnode.com/@coderlyn)

@coderlyn

  
[View profile](https://hashnode.com/@coderlyn)

iOS & dotnet developer - posting my learnings to help out future me!

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
