The goal of this project is to integrate MTKView
with UIScrollView
.
- On the top the screen is a
UIScrollView
to receive user's gestures. - Inside the
UIScrollView
is aUIView
acting as thecontentView
ofUIScrollView
. - Then comes an
MTKView
to render on-screen contents. Thesize
is just the size of the screen, and thedrawableSize
is always at the device fitting resolution.
220429 - I don't think this method is great. UIScrollViewDelegate might not work well with MTKView. It might be better to only use one MTKView to cover the full screen and render all things (deal with all user inputs).
I want to make a note taking app just like Notability
, who uses Metal
framework to render things on the screen.
However, it's not as easy as I thought. Metal is a framework at extremely low level to talk with GPU, in order to achieve the best rednering performance.
GitHub | codelynx/Metal2DScrollable: Demonstrate how to zoom and scroll MTKView using UIScrollView