7 posts with this tag

Building a networking layer with operations

October 03, 2018

Networking is central to how most apps add value to their users which is why significant effort has been put into creating an easy to use networking layer by both Apple and the open-source community. When iOS was first released, NSURLConnection [https://developer.apple.com/documentation/foundation/nsurlconnection] was the native networking suite it shipped with. However the NSURLConnection story actually began long before iOS as it was first released in 2003 with Safari, this meant that NSURLCo…

Avoid queue jumping

April 17, 2017

We are often told that no matter where we end up, we shouldn't forget where we came from. Usually, this applies to people, but it can also apply to code. Specifically, code that runs on a different queue from the queue it was scheduled on. queue-jumping 🦘 It's not unusual to see queue-jumping throughout a project: DispatchQueue.main.async { in //Update UI } Even with the syntax improvements [http://www.appcoda.com/grand-central-dispatch/] of using GCD [https://developer.apple.com/refer…

Coalescing Operations - Take 2

September 07, 2016

In "Coalescing NSOperations" [https://williamboles.com/coalescing-nsoperations/] I wrote about coalescing NSOperations however, during the writing of that article, I began to explore other ways that I could coalesce operations. One solution I discovered has all the benefits of the previous coalescing approach but significantly reduces the amount of effort required by the developer to support coalescing. This new approach is the topic of this post. Take 2 📽 In "Networking with NSOperation as yo…

Coalescing Operations

August 28, 2016

> This post is now outdated, please instead check out my newer post on Coalescing Operations [https://williamboles.com/removing-bolierplate-when-coalescing-nsoperations/] for my latest solution to coalescing operations - I'm leaving this here in case anyone needs it. In "Networking with NSOperation as your wingman" [https://williamboles.com/networking-with-nsoperation-as-your-wingman/] I wrote about combining NSURLSession with NSOperation to wrap networking requests and the processing of that…

Networking with NSOperation as your wingman

February 04, 2016

> This post is based on an Objective-C example. If you are more interested in seeing how to combine networking and operations based on a Swift example, head over to the more recent "Building a networking layer with operations" [https://williamboles.com/building-a-networking-layer-with-operations/] post. The beautiful and maddening thing about programming is that there are so many ways to solve the same issue. Each solution has its own tradeoffs and as developers, it is up to us to choose the s…

Polling with NSOperation

May 16, 2011

Recently I was writing an application that analysed audio input and updated an audio visualiser on screen. Running everything in the main thread just ground UI responsiveness down so I decided to spin off the audio capture into a separate thread. My first thoughts where to use NSOperationInvocation and run across this tutorial [http://www.depl0y.com/?p=345] by Wim Haanstra on how to keep a thread alive. This solution worked but the code that I had produced using it felt messy so I decided to ex…