TVIUserInterfaceTracker Class Reference
Inherits from | NSObject |
---|---|
Conforms to | TVICameraSourceOrientationTracker |
Declared in | TVICameraSourceOrientationTracker.h |
orientation
The currently observed orientation based upon the UIApplication or UIScene.
@property (nonatomic, assign, readonly) AVCaptureVideoOrientation orientation
Discussion
It is highly recommended to construct this class on the main thread.
When the tracker is constructed off the main thread, this property is eventually consistent with the state of the user interface, otherwise it is updated immediately.
UInterfaceOrientation
is mapped directly to AVCaptureVideoOrientation
except for UIIntefaceOrientationUnknown
which is translated to AVCaptureVideoOrientationLandscapeRight
.
Declared In
TVICameraSourceOrientationTracker.h
scene
The scene that is being monitored for orientation changes.
@property (nonatomic, weak, readonly, nullable) UIWindowScene *scene
Discussion
If +[TVIUserInterfaceTracker sceneInterfaceOrientationDidChange:]
is called, and the scene provided matches this property, then the Tracker
will read an updated orientation from the scene.
Declared In
TVICameraSourceOrientationTracker.h
+ tracker
Creates a default TVIUserInterfaceTracker
that monitors UIApplication
for orientation changes.
+ (nonnull instancetype)tracker
Return Value
An instance of TVIUserInterfaceTracker
.
Declared In
TVICameraSourceOrientationTracker.h
+ trackerWithScene:
Creates a TVIUserInterfaceTracker
that monitors a UIWindowScene
for orientation changes.
+ (nonnull instancetype)trackerWithScene:(nonnull UIWindowScene *)scene
Parameters
scene |
The scene that should be monitored for orientation changes. |
---|
Return Value
An instance of TVIUserInterfaceTracker
.
Declared In
TVICameraSourceOrientationTracker.h
+ sceneInterfaceOrientationDidChange:
Informs interested TVIUserInterfaceTracker
instances that the orientation of a UIWindowScene
has changed.
+ (void)sceneInterfaceOrientationDidChange:(nonnull UIWindowScene *)scene
Parameters
scene |
The scene that has changed. |
---|
Discussion
If you created a tracker using +[TVIUserInterfaceTracker trackerWithScene:]
then you should call this method within
-[UIWindowSceneDelegate windowScene:didUpdateCoordinateSpace:interfaceOrientation:traitCollection:]
Declared In
TVICameraSourceOrientationTracker.h