What is the Sendable protocol in Swift? | Swift Concurrency #11

  Рет қаралды 14,700

Swiftful Thinking

Swiftful Thinking

Күн бұрын

Пікірлер: 19
@bhuwin6186
@bhuwin6186 Жыл бұрын
bro you are amazing Edit: Also sendable acts as a guard for future safery thread checks, is someone ads a var to a sendable without being aware its being used in asyc sendable will alert them.
@hashcat5721
@hashcat5721 2 жыл бұрын
8:41 - In xCode 14.1 there will only be a warning and not an error.
@taylorchapman7860
@taylorchapman7860 Жыл бұрын
Update: I think in Swift 6 it will become an error, for now just a warning
@XMunichX
@XMunichX 2 жыл бұрын
Thank you as always for your great work Nick!
@2689742
@2689742 7 ай бұрын
Amazing tutorial.Crystal clear.
@piyushagrawal08
@piyushagrawal08 2 жыл бұрын
Awesommmmmme Video! Thank you so much fore great video! A huge Salute to you 999999999999 times! Keep sharing your knowledge & making awesome video! genius!
@andresraigoza2082
@andresraigoza2082 2 жыл бұрын
Awesome as always. Thank you so much!!!
@josemanuelortizsanchez4983
@josemanuelortizsanchez4983 2 жыл бұрын
Great video, thanks!
@liumingxing3060
@liumingxing3060 8 ай бұрын
Cool!
@praveenperera
@praveenperera Жыл бұрын
Your videos are great, do you have a plan to cover Transferable
@lalitvinde1441
@lalitvinde1441 Жыл бұрын
hey vro ...how to make Core Data Entities conforming to Sendable??
@pmjss
@pmjss 2 жыл бұрын
What is the brand of your keyboard that sound is very impress me
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
That is a 16” MacBook Pro 😂
@pmjss
@pmjss 2 жыл бұрын
@@SwiftfulThinking omg 😱
@lincolndickerson1293
@lincolndickerson1293 2 жыл бұрын
Trying to think of a case that a final class would be needed where a struct or actor couldn’t fit the bill. In the unchecked sendable case shown in the video all we are really doing making an understudy, weak actor, aka an novice implementation of thread safe class? What am I missing?
@alexvaiman4966
@alexvaiman4966 9 ай бұрын
as i said before about mutating.. you must be careful. struct MyStruct: Sendable { var title: String mutating func changeTitle(newTitle: String) { title = newTitle } func unsafe( t: inout MyStruct) { t.changeTitle(newTitle: "new title") } func test() { var t = MyStruct(title: "hello") unsafe(t: &t) print(t.title) } }
@alexvaiman4966
@alexvaiman4966 9 ай бұрын
This obviously isn't thread-safe.
@SwiftfulThinking
@SwiftfulThinking 9 ай бұрын
@@alexvaiman4966yea I guess I should have been more clear about immutable structs vs mutable structs too
@alexvaiman4966
@alexvaiman4966 9 ай бұрын
@@SwiftfulThinking Actually, I was wrong. When you try to run a mutating struct function in a thread context, you will get an error saying 'Escaping closure captures mutating 'self' parameter.' So, I guess it is not that structs are thread-safe; they just cannot be shared between threads (which is logical, as most structs are created on the stack). Swift is smart, unlike C++, it will not let you do crazy things.
How to use Actors and non-isolated in Swift  | Swift Concurrency #9
29:31
Swiftful Thinking
Рет қаралды 21 М.
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 41 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 95 МЛН
Интересно, какой он был в молодости
01:00
БЕЗУМНЫЙ СПОРТ
Рет қаралды 2,9 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 9 МЛН
These Swift 6 Features Change a Lot! | @SwiftBird
17:10
The Swift Bird
Рет қаралды 4,6 М.
Swift Concurrency Manifesto | Chris Lattner and Lex Fridman
10:59
Your Brain 🧠 on Swift Concurrency - iOS Conf SG 2023
30:38
iOS Conf SG
Рет қаралды 10 М.
Concurrency of SwiftData, by Donny Wals (English)
31:08
CocoaHeadsNL
Рет қаралды 3,1 М.
How to use Do, Try, Catch, and Throws in Swift | Swift Concurrency #1
26:34
So You Think You Know Swift? - Nick Lockwood
33:49
SwiftServerConf
Рет қаралды 8 М.
Swift. Methods Dispatch.
44:17
Программирование - интерес жизни
Рет қаралды 1,6 М.
3 MISTAKES to avoid when using Async / Await in Swift 😌
4:41
Vincent Pradeilles
Рет қаралды 12 М.
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 41 МЛН