iOS Developer Library

Developer

GLKit Framework Reference GLKViewControllerDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

GLKViewControllerDelegate

Objects that implement the GLKViewControllerDelegate protocol may act as delegates for a GLKViewController object. A delegate is called each time the controller is about to display a new frame of animation. It is also called before the view controller’s rendering loop pauses or resumes sending updates.

Inheritance


Not Applicable

Import Statement


import GLKit @import GLKit;

Availability


Available in iOS 5.0 and later.
  • Called before each frame is displayed. (required)

    Declaration

    Swift

    func glkViewControllerUpdate(_ controller: GLKViewController!)

    Objective-C

    - (void)glkViewControllerUpdate:(GLKViewController *)controller

    Parameters

    controller

    The controller that is about to display a new frame.

    Discussion

    This method is used by your application if it wants to updates state information on each frame of animation. A typical implementation might read the controller’s timeSinceLastUpdate property to determine how much time has actually passed, and use that time to calculate the positions for any objects to be rendered in the next frame.

    Import Statement

    import GLKit

    Availability

    Available in iOS 5.0 and later.

  • Called before the rendering loop is paused or resumed.

    Declaration

    Swift

    optional func glkViewController(_ controller: GLKViewController!, willPause pause: Bool)

    Objective-C

    - (void)glkViewController:(GLKViewController *)controller willPause:(BOOL)pause

    Parameters

    controller

    The controller that is about to change the rendering loop state.

    pause

    YEStrue if the loop is being paused, NOfalse if it is being resumed.

    Import Statement

    import GLKit

    Availability

    Available in iOS 5.0 and later.