/ObservableObjectDebugger

Watch for ObservableObject in real time.

Primary LanguageSwift

Observable Object Debugger

Watch for ObservableObject in real time. (This is the Alpha version)

Quick Start

  1. Add package to you project.
let package = Package(
    dependencies: [
        .package(url: "https://github.com/YusukeHosonuma/ObservableObjectDebugger.git", branch: "main"),
    ],
    targets: [
        .target(name: "<your-target>", dependencies: [
             "ObservableObjectDebugger",
        ]),
    ]
)
  1. Add debugObserve modifier to any View.
import ObservableObjectDebugger // ✅ Add import

struct ContentView: View {
    @StateObject private var viewModel: ContentViewModel = .init()

    var body: some View {
        Text("Hello")
            .debugObserve(viewModel) // ✅ You can specify any `ObservableObject`.
    }
}
  1. Build and launch the Viewer app or reference to folder /tmp/ObservableObjectDebugger (with VSCode and others).

image

image

Requirements

  • iOS 14+ (Simulator only)
  • macOS 12+ (Viewer app)

Author

Yusuke Hosonuma / @tobi462