SkillAgentSearch skills...

SBSObservation

Tiny observation framework designed for UIKit-based apps and built with Swift macros. It automatically handles the deallocation of observations and supports iOS 12 and newer.

Install / Use

/learn @simonbs/SBSObservation
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SBSObservation

[!IMPORTANT] This framework is an experimental project that reimplements and backports parts of Apple’s Observation framework to iOS 12, with similar internals and a more ergonomic API.

The source code is provided for inspirational purposes and as-is, without any guarantees of correctness, stability, or future maintenance. Use it at your own risk.

Tiny observation framework designed for UIKit-based apps and built with Swift macros. It automatically handles the deallocation of observations and supports iOS 12 and newer.

@SBSObservable
final class Car {
    var speed: Int = 0
}

@SBSObserver
final class MainViewController: UIViewController {
    private let car = Car()

    override func viewDidLoad() {
        super.viewDidLoad()
        observe(\.speed, of: car) { [unowned self] _, newValue in
            self.contentView.speedLabel.text = "\(newValue) mph"
        }
    }
}
View on GitHub
GitHub Stars67
CategoryCustomer
Updated2mo ago
Forks0

Languages

Swift

Security Score

85/100

Audited on Jan 17, 2026

No findings