|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
#include <UIKitAdapter.hpp>
| - adapters: |
| - adapters: |
| - adapters: | (const UIKitAdapter &) |
| - (UIKitAdapter &) adapters: | (const UIKitAdapter &) |
| - (string_view) aria: | const |
Implements aria::binding::IViewAdapter.
| - (UIKitView &) adapters: | (UIView *) | view |
Wrap a native UIView* as an IView owned by this adapter.
Every host used to hand-roll this: allocate a UIKitView, then park it in a keepalive container because BindingEngine takes IView& and does not own its views. (The common workaround — a process-global std::vector<UIKitView> — never releases anything, so it leaks by construction.) The adapter already keeps a per-view registry for its ObjC control targets, so it is the natural owner.
engine.bind_text(vm.name, adapter->view_for(nameField));
Calling - view_for twice for the same UIView* returns the same UIKitView, so multiple bindings on one control share a single per-view subscription bucket in BindingEngine.
Lifetime — matches the AppKit adapter, and differs from Qt's on purpose: UIKitView retains its UIView* via ARC, so a cached view keeps the control alive and there is no "native handle died first" event to evict on. Entries live until the adapter is destroyed (which fires each IView's destroy signal and releases the bindings), or until - release_view is called for a control the host discards early — a popped view controller, a recycled cell.
Passing nil is a programming error and throws std::invalid_argument.
| - (void) adapters: | (UIView *) | view |
Drop the cached UIKitView for view, if any.
Fires that view's destroy signal, so BindingEngine releases every binding wired to it, and releases the adapter's ARC reference to the control. Calling it for an unknown view is a harmless no-op.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (std::string_view) | text |
Implements aria::binding::IViewAdapter.
| - (string) aria: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(std::string_view)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (bool) | value |
Implements aria::binding::IViewAdapter.
| - (bool) adapters: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(bool)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (int) | value |
Implements aria::binding::IViewAdapter.
| - (int) adapters: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(int)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (std::int64_t) | value |
Implements aria::binding::IViewAdapter.
| - (int64_t) aria: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(std::int64_t)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (std::uint64_t) | value |
Implements aria::binding::IViewAdapter.
| - (uint64_t) aria: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(std::uint64_t)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (float) | value |
Implements aria::binding::IViewAdapter.
| - (float) adapters: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(float)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (double) | value |
Implements aria::binding::IViewAdapter.
| - (double) adapters: | (::aria::binding::IView &) | v |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void(double)>) | cb |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (bool) | visible |
Implements aria::binding::IViewAdapter.
| - (void) adapters: | (::aria::binding::IView &) | v | |
| (bool) | enabled |
Implements aria::binding::IViewAdapter.
| - aria: | (::aria::binding::IView &) | v | |
| (std::function< void()>) | cb |
Implements aria::binding::IViewAdapter.