#[repr(C)]pub struct UIPercentDrivenInteractiveTransition { /* private fields */ }
UIViewControllerTransitioning
only.Expand description
Implementations§
Source§impl UIPercentDrivenInteractiveTransition
impl UIPercentDrivenInteractiveTransition
Sourcepub unsafe fn duration(&self) -> CGFloat
Available on crate feature objc2-core-foundation
only.
pub unsafe fn duration(&self) -> CGFloat
objc2-core-foundation
only.This is the non-interactive duration that was returned when the animators transitionDuration: method was called when the transition started.
Sourcepub unsafe fn percentComplete(&self) -> CGFloat
Available on crate feature objc2-core-foundation
only.
pub unsafe fn percentComplete(&self) -> CGFloat
objc2-core-foundation
only.The last percentComplete value specified by updateInteractiveTransition:
Sourcepub unsafe fn completionSpeed(&self) -> CGFloat
Available on crate feature objc2-core-foundation
only.
pub unsafe fn completionSpeed(&self) -> CGFloat
objc2-core-foundation
only.completionSpeed defaults to 1.0 which corresponds to a completion duration of (1 - percentComplete)*duration. It must be greater than 0.0. The actual completion is inversely proportional to the completionSpeed. This can be set before cancelInteractiveTransition or finishInteractiveTransition is called in order to speed up or slow down the non interactive part of the transition.
Sourcepub unsafe fn setCompletionSpeed(&self, completion_speed: CGFloat)
Available on crate feature objc2-core-foundation
only.
pub unsafe fn setCompletionSpeed(&self, completion_speed: CGFloat)
objc2-core-foundation
only.Setter for completionSpeed
.
Sourcepub unsafe fn completionCurve(&self) -> UIViewAnimationCurve
Available on crate feature UIView
only.
pub unsafe fn completionCurve(&self) -> UIViewAnimationCurve
UIView
only.When the interactive part of the transition has completed, this property can be set to indicate a different animation curve. It defaults to UIViewAnimationCurveEaseInOut. Note that during the interactive portion of the animation the timing curve is linear.
Sourcepub unsafe fn setCompletionCurve(&self, completion_curve: UIViewAnimationCurve)
Available on crate feature UIView
only.
pub unsafe fn setCompletionCurve(&self, completion_curve: UIViewAnimationCurve)
UIView
only.Setter for completionCurve
.
Sourcepub unsafe fn timingCurve(
&self,
) -> Option<Retained<ProtocolObject<dyn UITimingCurveProvider>>>
Available on crate feature UITimingCurveProvider
only.
pub unsafe fn timingCurve( &self, ) -> Option<Retained<ProtocolObject<dyn UITimingCurveProvider>>>
UITimingCurveProvider
only.For an interruptible animator, one can specify a different timing curve provider to use when the transition is continued. This property is ignored if the animated transitioning object does not vend an interruptible animator.
Sourcepub unsafe fn setTimingCurve(
&self,
timing_curve: Option<&ProtocolObject<dyn UITimingCurveProvider>>,
)
Available on crate feature UITimingCurveProvider
only.
pub unsafe fn setTimingCurve( &self, timing_curve: Option<&ProtocolObject<dyn UITimingCurveProvider>>, )
UITimingCurveProvider
only.Setter for timingCurve
.
Sourcepub unsafe fn wantsInteractiveStart(&self) -> bool
pub unsafe fn wantsInteractiveStart(&self) -> bool
Set this to NO in order to start an interruptible transition non interactively. By default this is YES, which is consistent with the behavior before 10.0.
Sourcepub unsafe fn setWantsInteractiveStart(&self, wants_interactive_start: bool)
pub unsafe fn setWantsInteractiveStart(&self, wants_interactive_start: bool)
Setter for wantsInteractiveStart
.
Sourcepub unsafe fn pauseInteractiveTransition(&self)
pub unsafe fn pauseInteractiveTransition(&self)
Use this method to pause a running interruptible animator. This will ensure that all blocks provided by a transition coordinator’s notifyWhenInteractionChangesUsingBlock: method are executed when a transition moves in and out of an interactive mode.
pub unsafe fn updateInteractiveTransition(&self, percent_complete: CGFloat)
objc2-core-foundation
only.pub unsafe fn cancelInteractiveTransition(&self)
pub unsafe fn finishInteractiveTransition(&self)
Methods from Deref<Target = NSObject>§
Sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
Sourcepub fn class(&self) -> &'static AnyClass
Available on crate feature UIIndirectScribbleInteraction
only.
pub fn class(&self) -> &'static AnyClass
UIIndirectScribbleInteraction
only.Dynamically find the class of this object.
§Panics
May panic if the object is invalid (which may be the case for objects
returned from unavailable init
/new
methods).
§Example
Check that an instance of NSObject
has the precise class NSObject
.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load
instead.Available on crate feature UIIndirectScribbleInteraction
only.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.UIIndirectScribbleInteraction
only.Use Ivar::load
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
Available on crate feature UIIndirectScribbleInteraction
only.
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
UIIndirectScribbleInteraction
only.Attempt to downcast the object to a class of type T
.
This is the reference-variant. Use Retained::downcast
if you want
to convert a retained object to another type.
§Mutable classes
Some classes have immutable and mutable variants, such as NSString
and NSMutableString
.
When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.
So using this method to convert a NSString
to a NSMutableString
,
while not unsound, is generally frowned upon unless you created the
string yourself, or the API explicitly documents the string to be
mutable.
See Apple’s documentation on mutability and on
isKindOfClass:
for more details.
§Generic classes
Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.
You can, however, safely downcast to generic collections where all the
type-parameters are AnyObject
.
§Panics
This works internally by calling isKindOfClass:
. That means that the
object must have the instance method of that name, and an exception
will be thrown (if CoreFoundation is linked) or the process will abort
if that is not the case. In the vast majority of cases, you don’t need
to worry about this, since both root objects NSObject
and
NSProxy
implement this method.
§Examples
Cast an NSString
back and forth from NSObject
.
use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};
let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();
Try (and fail) to cast an NSObject
to an NSString
.
use objc2_foundation::{NSObject, NSString};
let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());
Try to cast to an array of strings.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();
This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.
Downcast when processing each element instead.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
for elem in arr {
if let Some(data) = elem.downcast_ref::<NSString>() {
// handle `data`
}
}
Trait Implementations§
Source§impl ClassType for UIPercentDrivenInteractiveTransition
impl ClassType for UIPercentDrivenInteractiveTransition
Source§const NAME: &'static str = "UIPercentDrivenInteractiveTransition"
const NAME: &'static str = "UIPercentDrivenInteractiveTransition"
Source§type ThreadKind = dyn MainThreadOnly
type ThreadKind = dyn MainThreadOnly
Source§impl NSObjectProtocol for UIPercentDrivenInteractiveTransition
impl NSObjectProtocol for UIPercentDrivenInteractiveTransition
Source§fn isEqual(&self, other: Option<&AnyObject>) -> bool
fn isEqual(&self, other: Option<&AnyObject>) -> bool
Source§fn hash(&self) -> usize
fn hash(&self) -> usize
Source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
isKindOfClass
directly, or cast your objects with AnyObject::downcast_ref
Source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
Source§impl RefEncode for UIPercentDrivenInteractiveTransition
impl RefEncode for UIPercentDrivenInteractiveTransition
Source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
Source§impl UIViewControllerInteractiveTransitioning for UIPercentDrivenInteractiveTransition
impl UIViewControllerInteractiveTransitioning for UIPercentDrivenInteractiveTransition
unsafe fn startInteractiveTransition( &self, transition_context: &ProtocolObject<dyn UIViewControllerContextTransitioning>, )
Source§unsafe fn completionSpeed(&self) -> CGFloat
unsafe fn completionSpeed(&self) -> CGFloat
objc2-core-foundation
only.Source§unsafe fn completionCurve(&self) -> UIViewAnimationCurve
unsafe fn completionCurve(&self) -> UIViewAnimationCurve
UIView
only.Source§unsafe fn wantsInteractiveStart(&self) -> bool
unsafe fn wantsInteractiveStart(&self) -> bool
impl DowncastTarget for UIPercentDrivenInteractiveTransition
impl Eq for UIPercentDrivenInteractiveTransition
Auto Trait Implementations§
impl !Freeze for UIPercentDrivenInteractiveTransition
impl !RefUnwindSafe for UIPercentDrivenInteractiveTransition
impl !Send for UIPercentDrivenInteractiveTransition
impl !Sync for UIPercentDrivenInteractiveTransition
impl !Unpin for UIPercentDrivenInteractiveTransition
impl !UnwindSafe for UIPercentDrivenInteractiveTransition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<'a, T> MainThreadOnly for T
impl<'a, T> MainThreadOnly for T
Source§fn mtm(&self) -> MainThreadMarker
fn mtm(&self) -> MainThreadMarker
MainThreadMarker
from the main-thread-only object. Read more