{"id":20624694,"url":"https://github.com/timac/fb9687147-swiftui-animation-deinit-thread","last_synced_at":"2026-04-17T18:32:29.117Z","repository":{"id":163267060,"uuid":"414917142","full_name":"Timac/FB9687147-swiftui-animation-deinit-thread","owner":"Timac","description":"This sample Xcode project demonstrates a SwiftUI issue (FB9687147)","archived":false,"fork":false,"pushed_at":"2021-10-08T09:18:33.000Z","size":4387,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T15:22:07.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Timac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":"DeinitInThread/DeinitInThread.xcodeproj/project.pbxproj","publiccode":null,"codemeta":null}},"created_at":"2021-10-08T09:03:56.000Z","updated_at":"2024-10-11T06:11:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"88c34262-7eff-44b2-91bd-83f059d18f55","html_url":"https://github.com/Timac/FB9687147-swiftui-animation-deinit-thread","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Timac/FB9687147-swiftui-animation-deinit-thread","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Timac%2FFB9687147-swiftui-animation-deinit-thread","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Timac%2FFB9687147-swiftui-animation-deinit-thread/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Timac%2FFB9687147-swiftui-animation-deinit-thread/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Timac%2FFB9687147-swiftui-animation-deinit-thread/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Timac","download_url":"https://codeload.github.com/Timac/FB9687147-swiftui-animation-deinit-thread/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Timac%2FFB9687147-swiftui-animation-deinit-thread/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31940836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T13:04:30.313Z","updated_at":"2026-04-17T18:32:29.102Z","avatar_url":"https://github.com/Timac.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\n\nThis simple Xcode project demonstrates an issue with SwiftUI where a View animation triggers deinit in a thread. This issue has been reported as FB9687147 to Apple.\n\n![](video.mov)\n\n\n## Steps to Reproduce\n\n- Download the sample Xcode project DeinitInThread\n- Open this project in Xcode 13.0\n- Compile and run this project on iOS 15.0 on a device or simulator\n- Tap on the button `Switch to Sample View`\n- Tap on the button `Switch to Content View`\n\nResult: In the Xcode console you will see a warning that the deinit is called in a thread\n\n```\n\"**** DEINIT running in some thread \u003cNSThread: 0x600001c899c0\u003e{number = 8, name = (null)}\"\n```\n\n## Reproducibility\n\n- This issue can be reproduced with Xcode 13.0 when running on iOS 15.0 on a device or simulator.\n- This issue was not yet tested on iOS 15.1 beta.\n\n\n## Details\n\n- The Xcode project contains 2 SwiftUI views.\n- A button lets you switch from one view to the second view with an animation.\n- If the view has a viewModel, the `deinit` for the viewModel is called in a thread rather than in the main thread:\n\n```\nstruct ContentView: View {\n\t@EnvironmentObject var appState: AppState\n\n\tvar body: some View {\n\t\tVStack(spacing: 0) {\n\t\t\tswitch appState.contentType {\n\t\t\t\tcase .homeScreen:\n\t\t\t\t\tButton {\n\t\t\t\t\t\tappState.contentType = .contact\n\t\t\t\t\t} label: {\n\t\t\t\t\t\tText(\"Switch to Sample View\")\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tSampleView()\n\t\t\t}\n\n\t\t}.animation(.default, value: appState.contentType)\n\t}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimac%2Ffb9687147-swiftui-animation-deinit-thread","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimac%2Ffb9687147-swiftui-animation-deinit-thread","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimac%2Ffb9687147-swiftui-animation-deinit-thread/lists"}