Swift 搞定“Main actor-isolated property can not be referenced from a Sendable closure”编译错误
概述当我们在Xcode中开启Swift语言严格并发模式(StrictConcurrencyChecking)或使用Swift6版本编译代码时,小伙伴们大概率会碰到如下错误:Mainactor-isolatedpropertycannotbereferencedfromaSendableclosure这个错误告诉我们:我们正在尝试使用一些本只应在MainActor上或从MainActor上使用的对象