iosobjective-cavplayerviewcontroller

AVPlayerViewController delegate usage in Obj-C


I wish to add a delegate method responding to an AVPlayerViewController event.

The event is about the visibility change of the transport bar.

But I can only find related documentation in Swift ...

optional func playerViewController(_ playerViewController: AVPlayerViewController, 
willTransitionToVisibilityOfTransportBar visible: Bool, with coordinator: AVPlayerViewControllerAnimationCoordinator)

Can anybody who are knowledgeable about this can help in giving the corresponding method signature in Obj-C ?


Solution

  • You can see documentation for Objective-C by selecting it from the language dropdown on Apple's developer site: https://developer.apple.com/documentation/avkit/avplayerviewcontrollerdelegate/2876484-playerviewcontroller?language=objc

    For that particular method the signature is

    - (void)playerViewController:(AVPlayerViewController *)playerViewController 
    willTransitionToVisibilityOfTransportBar:(BOOL)visible 
        withAnimationCoordinator:(id<AVPlayerViewControllerAnimationCoordinator>)coordinator;
    

    Another way is command-clicking the symbol in Xcode to jump to symbol's definition and then selecting Navigate -> Jump to Original Source/Generated Interface