Swiftpack.co - Package - nkristek/ReactiveTimelane

ReactiveTimelane

CI Status

ReactiveTimelane provides operators for Signal, SignalProducer and Lifetime in ReactiveSwift for profiling streams and lifetimes with the Timelane Instrument.

Contents:

Usage

Before making use of ReactiveTimelane, you need to install the Timelane Instrument from http://timelane.tools

Import the ReactiveTimelane framework in your code:

import ReactiveTimelane

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:

let producer: SignalProducer<Void, Never> = SignalProducer(value: ())
producer
    .lane("Void producer")
    .start()

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

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: .subscription) sends begin/completion events to the Subscriptions lane. Use this syntax if you only want to observe the lifetime of the Signal / SignalProducer.

lane("Lane name", filter: .event) sends events and values to the Events lane. Use this filter if you are only interested in the values the Signal / SignalProducer emits.

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

lane("Lane name", transformValue: { "Value is \($0)" })

Installation

Swift Package Manager

Automatically in Xcode:

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

Manually in your Package.swift file:

.package(url: "https://github.com/nkristek/ReactiveTimelane", from: "1.1.0")

Contribution

If you find a bug feel free to open an issue. Contributions are also appreciated.

Github

link
Stars: 12

Used By

Total: 0

Releases

1.1.3 - 2020-10-02 09:23:13

This release raises the iOS deployment target from 8 to 9 (Xcode 12 support).

1.1.2 - 2020-06-05 15:06:54

This release includes better documentation.

1.1.1 - 2020-06-05 14:28:12

In this release, each extension was moved to its own file and unit tests were added.

1.1 - 2020-06-04 07:26:45

This release adds a lane(_:) operator for tracking the lifetime of a Lifetime. This makes it possible to check for memory leaks as well.

1.0.2 - 2020-05-27 10:40:14

This release drops the required target version of the SwiftPM package to macOS 10.10, iOS 8, tvOS 9 and watchOS 2. This makes it possible to include the library in projects which are targeting lower versions than the required ones for the extension (macOS 10.14, iOS 12, tvOS 12, watchOS 5) and use the extension conditionally with an #if available statement.

1.0.1 - 2020-05-26 17:52:01

  • Remove the NSLock #1 by @andersio

1.0 - 2020-05-26 09:13:41

This is the first release of ReactiveTimelane.