AdaptiveAutoLayout icon indicating copy to clipboard operation
AdaptiveAutoLayout copied to clipboard

What is the purpose of offScreenView?

Open liuxuan30 opened this issue 10 years ago • 8 comments

I have read the code, and I am loosing the understanding of the reason for offScreenView. what I saw is updating a view's frame, but why not direclty utilize greenView's frame?

liuxuan30 avatar Apr 03 '15 07:04 liuxuan30

Hey Xuan,

Did you watch the Adaptive Auto Layout talk that this code was part of? If not, you'll want to watch that, or at least the part that covers this Offscreen Layout technique (here's the relevant portion).

Let me know if you still have any questions.

smileyborg avatar Apr 03 '15 16:04 smileyborg

Sorry I did, but the volume is not very loud so I don't get much information.

liuxuan30 avatar Apr 07 '15 01:04 liuxuan30

What is your question then? I'm not sure I understand what you are asking.

smileyborg avatar Apr 08 '15 16:04 smileyborg

I am not sure why to use offScreen views, as the talk video not explained it well, kind of noisy and not very clear what you said

liuxuan30 avatar Apr 09 '15 03:04 liuxuan30

This is an advanced technique that lets you use Auto Layout to do things that are traditionally impossible to do. Offscreen views are used to perform a number of layout calculations quickly, and then store the outputs of those calculations (view frames) for later use.

If you are just getting started with Auto Layout, this is not something you should or need to worry about.

smileyborg avatar Apr 09 '15 15:04 smileyborg

Thanks, I having been using Auto layout for a while, and I want to go to the next level. Could you give some links or docs that explains this advanced technique?

liuxuan30 avatar Apr 11 '15 03:04 liuxuan30

Sorry, I don't have any documentation or links beyond the video of this talk and the slides. If I get some time to write up a description I will include it in the README of this project.

smileyborg avatar Apr 16 '15 21:04 smileyborg

Alright, looking forward your README :)

liuxuan30 avatar Apr 17 '15 02:04 liuxuan30