mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 04:39:36 +00:00
Merge pull request #1320 from facebook/ASVCFrame
[ASViewController] Call -[super loadView] in order to harvest frame v alue and apply it to node's view.
This commit is contained in:
commit
b45d34a96d
@ -49,7 +49,21 @@
|
|||||||
- (void)loadView
|
- (void)loadView
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssertTrue(!_node.layerBacked);
|
ASDisplayNodeAssertTrue(!_node.layerBacked);
|
||||||
self.view = _node.view;
|
|
||||||
|
// Apple applies a frame and autoresizing masks we need. Allocating a view is not
|
||||||
|
// nearly as expensive as adding and removing it from a hierarchy, and fortunately
|
||||||
|
// we can avoid that here. Enabling layerBacking on a single node in the hierarchy
|
||||||
|
// will have a greater performance benefit than the impact of this transient view.
|
||||||
|
[super loadView];
|
||||||
|
UIView *view = self.view;
|
||||||
|
CGRect frame = view.frame;
|
||||||
|
UIViewAutoresizing autoresizingMask = view.autoresizingMask;
|
||||||
|
|
||||||
|
// We have what we need, so now create and assign the view we actually want.
|
||||||
|
view = _node.view;
|
||||||
|
_node.frame = frame;
|
||||||
|
_node.autoresizingMask = autoresizingMask;
|
||||||
|
self.view = view;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewWillLayoutSubviews
|
- (void)viewWillLayoutSubviews
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user