**`withCheckedContinuation`'s body will run on background thread in case of starting from main-actor.**

Overview

ConcurrencyContinuationReproduce

Differences of Concurrency behaviors between Xcode 14.0 and 14.1

  • Xcode 14.0

    • iOS 13+: Runs on main (inherited same context)
  • Xcode 14.1 RC.1

    • iOS 15+: Runs on main (inherited same context)
    • iOS 14: Runs on background (hops to different context)
    • iOS 13: Crashes
  • Xcode 14.1 RC.2

    • iOS 15+: Runs on main (inherited same context)
    • iOS 14: Runs on background (hops to different context)
    • iOS 13: Runs on background

On Xcode 14.1

withCheckedContinuation's body will run on background thread in case of starting from main-actor.

This situation happens only earlier than iOS 15. so 13.x and 14.x have this situation with Xcode 14.1. Those OS versions are targets of back-deployments of Concurrency.

Task { @MainActor () -> Void in
  await withCheckedContinuation { c in    
    // >= iOS 15 : on main-thread
    // < iOS 15 : on background-thread
    c.resume()
  }
}

image

Until Xcode 14.0(also 14.0.1) is fine.

CleanShot 2022-10-25 at 16 54 07@2x

Related

https://twitter.com/kylehickinson/status/1582471814843883535

You might also like...
Deal with query items, HTTP headers, request body and more in an easy, declarative way

Reusable system for complex URL requests with Swift. Deal with query items, HTTP headers, request body and more in an easy, declarative way. Check out our engineering blog to learn more!

🎭 Swift async/await & Actor-powered effectful state-management framework.
🎭 Swift async/await & Actor-powered effectful state-management framework.

🎭 Actomaton 🧑‍🎤 Actor + 🤖 Automaton = 🎭 Actomaton Actomaton is Swift async/await & Actor-powered effectful state-management framework inspired by

An actor model library for swift.

Aojet Aojet is an actor model implemetion for swift. Features Asynchronous, non-blocking and highly performant message-driven programming model Safe a

Clean Actor Model Architecture

CAMA Eonil, 2021. CAMA is short for "Clean Actor Model Architecture". As like it says, its CA(Clean Architecture) + AM(Actor model). AM here means AM

Prototype actor and async/await toolkit for Swift 5.5+

Prototype actor and async/await toolkit for Swift 5.5+

An opinionated starting point for awesome, reusable Swift 5 modules

Swift 5 Module Template Use this template as a starting point for any Swift 5 module that you want other people to include in their projects. STATUS:

The starting file for the 360iDev "It's Widget Time" workshop.

360iDevWidgets_start The starting file for the 360iDev "It's Widget Time" workshop. Syllabus This is a workshop to introduce you to adding widgets to

A starting point to create CLI utilities with swift

cli tuist template A starting point to create CLI utilities with swift Installation Just create a Tuist folder and a Templates folder inside it. Creat

An application where users can simulate trading stocks with a starting balance of fake money.
An application where users can simulate trading stocks with a starting balance of fake money.

Eighth Wonder Finance Table of Contents Overview Product Spec Video Walkthrough Wireframes Schema Overview Description An application where users can

Use this template as a starting point for any Swift 5 module that you want other people to include in their projects

Swift 5 Module Template Use this template as a starting point for any Swift 5 mo

An opinionated starting point for awesome, reusable Swift 5 modules

Swift 5 Module Template Use this template as a starting point for any Swift 5 module that you want other people to include in their projects. STATUS:

A simple GUI for starting/stopping our various local development environments
A simple GUI for starting/stopping our various local development environments

EnvironmentLauncher A simple GUI for starting/stopping SchoolMint's various local development environments Before you begin, some notes This is a WIP

Test case project for mackolik

Mackolik - iOS Developer - Test Case Gökhan Mandacı 28 Oct 2021 I developed a two-page app and a general purpose drop down widget for the Mackolik Tes

A common use case is wanting to convert device identifiers such as iPhone10,1 to a user friendly name; iPhone 8.

Devices Swift package that contains all devices from https://www.theiphonewiki.com/wiki/Models. A common use case is wanting to convert device identif

Gallery has a clearer flow based on albums and focuses on the use case of selecting video
Gallery has a clearer flow based on albums and focuses on the use case of selecting video

Description We all love image pickers, don't we? You may already know of ImagePicker, the all in one solution for capturing pictures and selecting ima

colorBlendFactor \\ reversed() \\ motionBegans \\ for case let

PN_Fireworks_Night colorBlendFactor: A floating-point value that describes how the color is blended with the sprite’s texture. colorBlendFactor value

Swiftmon - swiftmon restarts your swift application in case of any file changes

swiftmon swiftmon restarts your swift application in case of any file change Requirements Installed in system swift, npm, node Installing You need to

Use `PreselectedPhotoViewController` to handle limited photo access case in your app.
Use `PreselectedPhotoViewController` to handle limited photo access case in your app.

PreselectedPhotoUI Use PreselectedPhotoViewController to handle limited photo access case in your app. Overview Supports iOS 14.0 or later How to use?

It's simple IOS Study Case - Movie App

IOS Deployment Info: IOS 15.0 ve üzeri Kullanılan Teknolojiler ve Yapılar Kingfisher AVFoundation URLSession Generics CollectionView VIPER Swipe Gestu

Owner
Hiroshi Kimura
Swift & iOS - Working on creating apps and open-sourced libraries. I'm interested in Creating smooth and fancy UI, State-Management, Image Processing.
Hiroshi Kimura
An actor model library for swift.

Aojet Aojet is an actor model implemetion for swift. Features Asynchronous, non-blocking and highly performant message-driven programming model Safe a

null 37 Apr 7, 2022
Type-safe thread-local storage in Swift

Threadly is a Swift µframework that allows for type-safe thread-local storage. What is Thread-Local Storage? Thread-local storage (TLS) lets you defin

Nikolai Vazquez 71 Aug 6, 2022
Demonstration of using Tasks and TaskGroup to thread a calculation.

TasksTest Demonstration of using Tasks and TaskGroup to thread a calculation. The calculation takes place in a separate Swift class that can be reused

null 0 Dec 27, 2021
Remote shell using libssh2 with Objective-C, thread safe implementation.

NSRemoteShell Remote shell using libssh2 with Objective-C. Thread safe implementation. Available as Swift Package. git libssh2 prebuilt binaries are r

Lakr Aream 14 Sep 13, 2022
Job Scheduler for IOS with Concurrent run, failure/retry, persistence, repeat, delay and more

SwiftQueue Schedule tasks with constraints made easy. SwiftQueue is a job scheduler for iOS inspired by popular android libraries like android-priorit

Lucas Nelaupe 367 Dec 24, 2022
AsyncButton is the simple way to run concurrent code in your views.

SwiftUI AsyncButton ??️ AsyncButton is a Button capable of running concurrent code. Usage AsyncButton has the exact same API as Button, so you just ha

Lorenzo Fiamingo 13 Dec 14, 2022
Class for logging excessive blocking on the main thread

Watchdog Class for logging excessive blocking on the main thread. It watches the main thread and checks if it doesn’t get blocked for more than define

Wojtek Lukaszuk 1.8k Dec 6, 2022
A guard to help you check if you make UI changes not in main thread

ODUIThreadGuard ODUIThreadGuard is a guard to help check if you make UI changes not in main thread. As Xcode 9 embedded this function into Xcode, ther

Old Donkey 690 Nov 23, 2022
MyWeight is a body mass tracker focused on make easy to input new data and check your weight history

MyWeight MyWeight is a body mass tracker focused on make easy to input new data and check your weight history. Getting Started Environment prerequisit

Diogo Tridapalli 71 Nov 2, 2022
An interactive body tracking installation

SharingElements An interactive body tracking installation Requirements Hardware requirements: MacOS computer (preferably (M1 chip)[https://en.wikipedi

Joel Gethin Lewis 15 Jun 7, 2022