Skip to content
Timelane + RxSwift
Swift Ruby Objective-C
Branch: master
Clone or download

Latest commit

Latest commit 3ae130b Mar 31, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
.swiftpm/xcode/package.xcworkspace
RxTimelane 1.0.6 Mar 31, 2020
Sources/RxTimelane
Tests
etc
.gitignore
LICENSE
Package.resolved
Package.swift
README.md
RxTimelane.podspec

README.md

RxTimelane

Timelane Icon

RxTimelane provides RxSwift bindings for profiling RxSwift code with the Timelane Instrument.

Timelane Instrument

Contents:

Usage

Import the RxTimelane framework in your code:

import RxTimelane

Use the lane(_) operator to profile a subscription via the TimelaneInstrument. Insert lane(_) at the precise spot in your code you'd like to profile like so:

downloadImage(at: url).
  .lane("Download: \(url.path)")
  .assign(to: \.image, on: myImageView)

Then profile your project by clicking Product > Profile in Xcode's main menu.

Select the Timelane Instrument template:

Timelane Instrument Template

Inspect your subscriptions on the timeline:

Timelane Live Recording

For a more detailed walkthrough go to http://timelane.tools.

API Reference

lane(_:filter:)

Use lane("Lane name") to send data to both the subscriptions and events lanes in the Timelane Instrument.

lane("Lane name", filter: [.subscriptions]) sends begin/completion events to the Subscriptions lane. Use this syntax if you only want to observe concurrent subscriptions.

lane("Lane name", filter: [.events]) sends events and values to the Events lane. Use this filter if you are only interested in values a subscription would emit (e.g. for example subjects).

Additionally you can transform the values logged in Timelane by using the optional transformValue trailing closure:

lane("Lane name", transformValue: { value in
  return "Value: \(value)"
})

Installation

Swift Package Manager

I . Automatically in Xcode:

  • Click File > Swift Packages > Add Package Dependency...
  • Use the package URL https://github.com/icanzilb/RxTimelane to add TimelaneCombine to your project.

II . Manually in your Package.swift file add:

.package(url: "https://github.com/icanzilb/RxTimelane", .from("1.0.0"))

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate TimelaneCombine into your Xcode project using CocoaPods, add it to your Podfile:

pod 'RxTimelane', '~> 1.0'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate RxTimelane into your Xcode project using Carthage, add it in your Cartfile:

github "icanzilb/RxTimelane" "1.0"

Demo

This repo contains a simple demo app. To give it a try open RxTimelane/RxTimelane.xcodeproj and run the "RxTimelaneDemo" scheme.

Timelane demo app

License

Copyright (c) Marin Todorov 2020 This package is provided under the MIT License.

You can’t perform that action at this time.