Does swift have the same functionality as Android?[requestRender]

Does swift have the same functionality as Android? If yes, let me know the example source.


android app code

GLSurfaceView = mGLSurfaceView;

Renderer = new GLRenderer(context.getApplicationContext(), mainHandler);

GLSurfaceView.setRenderer(Renderer);

GLSurfaceView.setRenderMode(RENDERMODE_WHEN_DIRTY); -> Draw only once.


other function call

GLView.requestRender(); -> Draw only when requested.

Replies

Swift doesn’t have rendering APIs. Those are a property of the OS on which the Swift code is running. Each of our platforms supports a variety of different rendering APIs, including AppKit (macOS-specific), UIKit (iOS and tvOS), Metal, OpenGL, SceneKit, SpritKit, and so on. And each of those has their own view of how rendering is modelled.

I have some recommendations for you:

  • Decide on a platform and API.

  • Post your question to the topic area associated with that API. For example, if you’re working with UIKit there’s App Frameworks > Cocoa Touch. Or if you’re working with Metal there’s Graphics and Games > Metal

  • In your post explain what platform you’re targeting.

  • It would also help if you explained what you’re trying to achieve in terms of the API you’re using, rather than in terms of an Android API. Most folks reading your question will not be familiar with Android.

Good luck!

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"