You are right, the statement is only true for serial queues.
Apr 27, 2020, 11:36 AM
You are right, the statement is only true for serial queues. I will update the article to clarify that!
Apr 7, 2020, 10:41 AM
Hi SayaleeIn that particular example you won’t need [weak self], because these two closures are not stored stored anywhere and are executed immediately.If you replaced DispatchQueue.main.async with a DispatchWorkItem, and saved that item...
The Nested Closure Trap
Mar 12, 2020, 8:29 AM
Suppose we have code that executes an animation closure nested inside a Dispatch Work Item.Here are 3 versions of this code. Can you tell which one introduces a retain cycle? (click for mobile-friendly gist)Spot the leakThe answer is, all...
Thank you for the kind words I am glad you liked it!
Feb 28, 2020, 11:42 AM
Thank you for the kind words 😊 I am glad you liked it!
Concurrency Visualized — Part 3: Pitfalls and Conclusion
Jan 28, 2020, 9:01 PM
Concurrency Visualized — Part 3: Pitfalls and ConclusionThanks to Pablo Stanley for these amazing illustrations!This is part 3 of my concurrency series. Check out Part 1 and Part 2 if you missed them.In my earlier discussion of sync,...
Concurrency Visualized — Part 2: Serial vs Concurrent
Jan 28, 2020, 9:00 PM
Concurrency Visualized — Part 2: Serial vs ConcurrentThis is part 2 of my concurrency series. If you missed part 1, check it out here.In part 1, we explored the differences between synchronous and asynchronous execution when dispatching...
Concurrency Visualized — Part 1: Sync vs Async
Jan 28, 2020, 8:59 PM
Concurrency Visualized — Part 1: Sync vs AsyncThroughout this concurrency series, I am going to cover the different types of queues in Grand Central Dispatch (GCD.) More specifically, I will explore the differences between serial and...
I don’t have much experience with Metal, so I cannot say for sure.
Oct 22, 2019, 9:03 AM
I don’t have much experience with Metal, so I cannot say for sure. But I wouldn’t be surprised if it was faster because it’s a much lower level API
That’s a great question!
Sep 23, 2019, 11:54 AM
That’s a great question! By default, the emitter shapes are limited to point, square, circle, etc from this enum:CAEmitterLayerEmitterShapeHowever, I think if we give the CAEmitterLayer a custom cgPath, we might be able to get around that...
Thank you for the clarification, I see what you mean.
Sep 23, 2019, 10:43 AM
Thank you for the clarification, I see what you mean.Fireworks essentially provides the code for the CAEmitterLayer, but where you use it is up to you.You can add it to any object that accepts a CALayer, this can be a UIView subclass (or...
Fireworks — A visual particles editor for Swift
Sep 15, 2019, 10:09 PM
Fireworks — A visual particles editor for SwiftFireworks!I’m incredibly excited to share a new developer tool I’ve been working on called Fireworks, available to download here 😃Fireworks generates Swift code on the fly for macOS and iOS as...
You don’t (always) need [weak self]
Jun 16, 2019, 8:16 PM
Thanks to Arpit Sharma for the inspiration!Cycles… no, not the fun kind shown above. I mean strong reference cycles, the kind that causes entire view controllers to leak in your iOS app. More specifically, I want to talk about the use of...
My first Swift project
Mar 26, 2019, 9:49 PM
Photo by Patrick Ward on UnsplashIn my earlier posts, I mentioned how personal projects helped me stay motivated while I was learning programming. In this post I will talk about the first personal project that I built back in 2017,...
High performance drawing on iOS — Part 2
Jan 19, 2019, 5:28 PM
High performance drawing on iOS — Part 2Credit: Sharon PittawayIn Part 1 I discussed two different ways to perform 2D drawing on iOS, both of which are CPU-based. The first one performed ok on the iPhone but very poorly on the iPad (17 fps...
High performance drawing on iOS — Part 1
Jan 16, 2019, 9:09 PM
High performance drawing on iOS — Part 1Source: Tim Arterbury — UnsplashAs I was building my recently released drawing game, I explored different ways to perform 2D drawing on iOS. Throughout this 2-part series, I will share what I’ve...
How I built my first open source library
Oct 31, 2018, 10:43 PM
Credit: Susan YinLast week I published my first open source library, QuickTicker. It’s a Swift library that lets you create simple ticker animations using one line of code. The result looks like this:In this post, I’d like to talk about...