قالب وردپرس درنا توس
Home / IOS Development / IOS – Effective off-screen UIView rendering and mirroring

IOS – Effective off-screen UIView rendering and mirroring



I have an "off-screen" UIView hierarchy that I will render in different places on my screen. In addition, it should only be possible to display parts of this display hierarchy and reflect all changes made in this hierarchy.

The Difficulties:

  • UIView method drawHierarchy (i: afterScreenUpdates :) always calls draw (_ rect :) and is therefore very inefficient for large hierarchies if you will incorporate all changes in the display hierarchy. You need to upgrade it to each screen update or observe all change properties for all views. Draw view hierarchy documentation
  • UIView method snapshotView (afterScreenUpdates :) also does not help much since I have not found a way to get a proper view of the hierarchy drawing if this hierarchy is "off-screen ". Snapshot view documentation

"Off-Screen": The red view of this display hierarchy is not part of the app's user interface. It has no overview.

Below you can see a visual representation of my idea:

 example


Source link