Categories
Featured iPhone Development Resources iOS Development Libraries iOS Programming Tools And Utilities Swift

SwiftTrace – Library For Automatically Printing Swift Method Execution

SwiftTrace submitted by John Holdsworth is a library allowing you to automatically print Swift method executions within your classes with minimal additions to your code.

SwiftTrace works on non-finalized Swift classes, and on Objective-C classes.

This example from the reamde shows some sample output:

RxSwift.SingleAssignmentDisposable.dispose () -> ()
RxSwift.SingleAssignmentDisposable.disposable.setter : RxSwift.Disposable11
RxSwift.CompositeDisposable.addDisposable (RxSwift.Disposable11) -> Swift.Optional .BagKey>
RxSwift.CurrentThreadScheduler.schedule (A, action : (A) -> RxSwift.Disposable11) -> RxSwift.Disposable11
-[RxSwift.CurrentThreadSchedulerKey copyWithZone:] -> @[email protected]:8^v16
RxSwift.CompositeDisposable.addDisposable (RxSwift.Disposable11) -> Swift.Optional BagKey>
RxSwift.CompositeDisposable.addDisposable (RxSwift.Disposable11) -> Swift.Optional.BagKey>
RxSwift.SerialDisposable.disposable.setter : RxSwift.Disposable11
RxSwift.SingleAssignmentDisposable.dispose () -> ()
RxSwift.SingleAssignmentDisposable.disposable.setter : RxSwift.Disposable11
RxSwift.SingleAssignmentDisposable.dispose () -> ()
RxSwift.CompositeDisposable.removeDisposable (RxSwift.BagKey) -> ()
RxSwift.SingleAssignmentDisposable.dispose () -> ()

You can find SwiftTrace on Github here.

A handy tool for easier Swift debugging.