I'm new to iOS I'm having trouble understanding the difference between scene and a view. Unfortunately Apple's documentation isn't helping me. I read that a scene is what you see on the screen. But isn't that what a view is? Are these two interchangeable terms? If not what are the differences, both functionality and best practice? How does a ViewController come into play for both of these?
Any explanations or links are much appreciated.
In simple terms:
A UIView
is a rectangular area that is displayed on the screen.
A collection of Views displayed on the screen at the moment.
In the following image, blue area and yellow area are Views, whereas the entire screen is a ViewController.
A ViewController which is a part of a specific sequence.
However, the technical definitions are a little different:
A UIIView is a wrapper to CALayer. It holds an array of subviews which implies that it's a collection of views by itself. You can imagine this as a tree structure.
A ViewController is a controller which holds a reference to the root view. This way, you can traverse the leaf node or any subview from the controller.
"Scene" is another term for a ViewController in one context of storyboard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With