5 Stranger Things you can do with Timelane at NSSpain

For my talk at NSSpain 2020 I’ve prepared a beyond-the-basics Timelane talk. I think everyone who’s heard about Timelane by now knows what it does for its simplest use case - debugging some Combine based code. However, you can do much, much more with Timelane! So for my NSSpain 2020 talk I prepared 5 little examples on how to use Timelane beyond the simplest use case. I’ve pushed all the demo apps I use in my talk to this repository: https://github. …

Posted on

How to create a custom instrument on top of Timelane!

You can easily log data in Instruments by using the functions in Apple’s os framework. All you need is to use os_log(…) and that will log data in Instruments. If you’d like to read more about this check out Recording Performance Data Apple article. Creating a real custom instrument, however, is a little more complicated as you can learn in Creating Custom Instruments WWDC2018 video and it involves XML, CLIPS, and more complex stuff. …

Posted on

Timelane - the first two weeks!

It’s been two weeks since I released Timelane and I’m really humbled by the community’s super positive response. Since much has happened since the launch, I’m writing this to give everyone a detailed update. The current versions are as follows: TimelaneCombine 1.0.4 RxTimelane 1.0.3 TimelaneCore 1.0.3 I’ve merged 18 PRs (in the 14 days since launch!) on all Timelane repos and I pushed some changes myself too. …

Posted on

Announcing: Timelane

Today I’m announcing the public release of Timelane. Timelane is a free, open source Instrument that helps you profile and debug asynchronous code. Timelane is available today on: http://timelane.tools. The Timelane Instrument leverages signpost logging and the powerful Instruments UI to help you visually inspect asynchronous subscriptions and drill down through logged events over time. Installation Install the latest build from http://timelane.tools or fork the repository on GitHub and build the app yourself. …

Posted on

Property Wrappers with Combine

In this post I’ll look into making more out of Combine code by using the newly introduced in Swift 5.1: Property Wrappers. Let’s very quickly go into what property wrappers are in general and then dive into a Combine example. Swift Property Wrappers Property wrappers are a new feature in Swift 5.1 that allows you to abstract redundant functionality around handling type properties. Property wrappers are very handy in (my experience so far 🤓 ) two ways: …

Posted on

subscribe(on:) vs receive(on:)

In this post, instead of looking into the basics of multi-threading with Combine, we are going to have a look at the difference between subscribe(on:) and receive(on:) specifically. We’re going to look at a typical subscription chain starting with a root publisher, a couple of operators, and a subscriber at the end. We’ll look into more diagrams and some example code of how subscribe(on:) and receive(on:) affect subscriptions. subscribe(on:) subscribe(on:) sets the scheduler on which you’d like the current subscription to be “managed” on. …

Posted on

Binding a list with multiple sections and different cells

Today’s post showcases another real-life use case of using CombineDataSources, namely binding a list to a table view with multiple sections using different cell types. In my last post Binding a simple list to a UITableView we had a look at binding a list of data elements to a table view. It’s pretty simple to bind a plain table view when you have a coherent list of elements. In this post I’m gonna show some code on how to bind a list to a table with multiple sections that also needs to use different cell types for the different sections. …

Posted on

Binding a simple list to a UITableView

While still keep improving the current version of CombineDataSources I tought it’d be nice to post few articles on the current API design along with some code samples. This would be nice in order to get some feedback and to try putting some of the code in context. CombineDataSources Introduction RxSwiftCommunity’s excellent RxDataSources allows developers to reactively bind data to table and collection views. It uses a lot of the underlaying structure of RxSwift and it’s very powerful. …

Posted on

An assert operator: assertMaxSubscriptions()

While I keep working on CombineDataSources I’ve faced some of the differences between RxSwift and Combine and those are slowing me down a bit. For example: in RxSwift when dealing with UI I’d usually use shareReplayLatestWhileConnected() - this operator shares an observable and emits the latest value to all subscribers downstream. In Combine there is currently a share() operator which does a similar thing but does not “replay” the latest value. …

Posted on

Debug logging with CombinePrintout

Logging is a really powerful way to debug code, especially if it’s asynchronous code that runs in a time sensitive way so stepping through the debugger is a pain. In Simple custom Combine operators I wrote about how to create an operator that logs to the system Console app in just few lines. After playing with Combine some more I went ahead and created a micro framework called “CombinePrintout” that adds few convenient methods to Combine allowing you to quickly print information about your subscriptions. …

Posted on