Struct cacao::view::ViewController
source · [−]Expand description
A ViewController
is a wrapper around NSViewController
in AppKit, and UIViewController
in
UIKit
This type is interchangeable with a standard View<T>
, in that using this simply forwards
standard view controller lifecycle methods onto your ViewDelegate
. You would use this if you
need to be notified of when something is going to be used (e.g, for lifecycle event-based
cleanup routines, or something).
Example
use cacao::view::ViewDelegate;
struct ContentViewDelegate;
impl ViewDelegate for ContentViewDelegate {
const NAME: &'static str = "ContentViewDelegate";
fn will_appear(&self, animated: bool) {
println!("This controller is about to appear!");
}
}
Fields
objc: ShareId<Object>
The underlying Objective-C pointer.
view: View<T>
The underlying View that we manage.
Implementations
sourceimpl<T> ViewController<T> where
T: ViewDelegate + 'static,
impl<T> ViewController<T> where
T: ViewDelegate + 'static,
Trait Implementations
sourceimpl<T> Controller for ViewController<T>
impl<T> Controller for ViewController<T>
sourcefn get_backing_node(&self) -> ShareId<Object>
fn get_backing_node(&self) -> ShareId<Object>
Returns the underlying Objective-C object.
Auto Trait Implementations
impl<T> !RefUnwindSafe for ViewController<T>
impl<T> !Send for ViewController<T>
impl<T> !Sync for ViewController<T>
impl<T> Unpin for ViewController<T>
impl<T> !UnwindSafe for ViewController<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more