That final example is probably better done with flatMap.
Posts by Oliver
Tariffs are also a transfer of wealth from the poor to the rich.
For the poor, prices on goods go up. For the rich (eg, shareholders) it is a chance to increase prices on non-tariffed goods so that they extract extra profits.
Inflation & the value of assets goes up, buying power of cash goes down.
In case it was clear to any American’s in the room. The only ones paying tariffs are Americans.
The buyer pays the tariff not the seller. The importer passes the tariff on to the consumer.
This is a tax on your purchases of foreign goods by the US federal government.
Maybe. I guess we’ll see at WWDC.
It is entirely opt in though so in practice unless you turn that option on nothing changes.
It will mean that things like Xcode templates for CLIs and the like can have it turned on by default and it might make upgrading some exisiting Swift modules to Swift 6 simpler.
Isn’t your original article out of date with respect to View? Because View is now annotated with @MainActor doesn’t that mean all methods on a View are also MainActor annotated by default? So if you have a startTask() method on a view the nested Task {} closure will inherit the MainActor isolation.
Also, I’m pretty sure async let statements start executing as soon as they are declared not when they are awaited. Just like let t = Task {} starts immediately whether or not you await t.value.
Really? I’m suspicious of that assertion.
The try await on the async let expressions are unnecessary in the example and given that async let is effectively a hidden TaskGroup I feel like your first answer is the correct one.
But maybe I’m wrong. I should probably write a test.
I see. As always the right choice is always “it depends”. Thanks for explaining the context that made you make the choice you did.
From the blog it seems you were matching URIs with UUIDs. I guess I would have just split the URI path then attempted to get the UUID from one of the parts.
Super curious what the use case was for using a Regex.
Why not just use UUID(uuidString:)?
I just saw someone walking past the cafe I’m in wearing the t-shirt. :)
I almost never use forEach. Use cases where it is preferred over a simple for loop are few and far between for me.
Given that footage we might have even been standing close to each other. Haha. 😂
Oh neat. I was there too.
I’ve found that confirmations are good when you want to confirm that callbacks are executed. Ie you have an async function that will call stuff and you want to confirm that it called that stuff.
But as you say, it’s not suited to completion handlers.