Search code examples
iosswiftopengl-estic-tac-toe

How do I place an image created in Open Gl ES into a UIView for iOS


I want to create a tic tac toe game for iOS using Swift. I created the tic tac toe board using OpenGL ES 2.0. However the board fills the whole screen. I want to place the board into a view, so then I can center the view making the board centered for all devices. How do I place my object I created in OpenGL ES into a UIView?


Solution

  • Use view controller containment. Add your GLKViewController as a child view controller to a UIViewController and center its view.