Swiftpack.co - nkristek/ReactiveTimelane as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by nkristek.
nkristek/ReactiveTimelane 1.1.3
Timelane + ReactiveSwift
⭐️ 14
🕓 3 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/nkristek/ReactiveTimelane.git", from: "1.1.3")

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: 14
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1.1.3
3 years ago

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

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics