Код: Выделить всё
import UIKit
import SpriteKit
class ViewController: UIViewController {
let textureAtlas: SKTextureAtlas
required init?(coder: NSCoder) {
textureAtlas = SKTextureAtlas(dictionary: ["Foo": UIImage(named: "foo.png")!])
super.init(coder: coder)
textureAtlas.preload {
}
}
}
Код: Выделить всё
Thread 4 Queue : com.apple.spritekit.preloadQueue (concurrent)
#0 0x00000001099476f5 in _dispatch_assert_queue_fail ()
#1 0x000000010994768f in dispatch_assert_queue ()
#2 0x00007ffc10f5f251 in swift_task_isCurrentExecutorImpl ()
#3 0x0000000109e05f39 in closure #1 in ViewController.init(coder:) ()
#4 0x0000000109e05fa8 in thunk for @escaping @callee_guaranteed () -> () ()
#5 0x0000000109944b3d in _dispatch_call_block_and_release ()
#6 0x0000000109945ec6 in _dispatch_client_callout ()
#7 0x00000001099490f3 in _dispatch_continuation_pop ()
#8 0x0000000109947f20 in _dispatch_async_redirect_invoke ()
#9 0x0000000109959d2c in _dispatch_root_queue_drain ()
#10 0x000000010995a8ef in _dispatch_worker_thread2 ()
#11 0x00000001093c4b43 in _pthread_wqthread ()
#12 0x00000001093c3acf in start_wqthread ()
Enqueued from com.apple.spritekit.preloadQueue (Thread 4) Queue : com.apple.spritekit.preloadQueue (serial)
#0 0x0000000109946bf1 in _dispatch_group_wake ()
#1 0x0000000109949239 in _dispatch_continuation_pop ()
#2 0x0000000109947f20 in _dispatch_async_redirect_invoke ()
#3 0x0000000109959d2c in _dispatch_root_queue_drain ()
#4 0x000000010995a8ef in _dispatch_worker_thread2 ()
#5 0x00000001093c4b43 in _pthread_wqthread ()
#6 0x00000001093c3acf in start_wqthread ()
< /code>
Я пробовал: < /p>
Используйте Swift 5, со строгой проверкой параллелизма. Нет сбоя, нет предупреждения. Нет аварии. Тем не менее, мне нужна эта предварительная нагрузка Подробнее здесь: https://stackoverflow.com/questions/789 ... in-swift-6