FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
AsyncDisplayKit/AsyncDisplayKit/ASViewController.m at master · bluesea/AsyncDisplayKit · GitHub
bluesea
/
AsyncDisplayKit
Public
forked from
facebookarchive/AsyncDisplayKit
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
AsyncDisplayKit
/
AsyncDisplayKit
/
ASViewController.m
Copy path
More file actions
More file actions
Latest commit
History
History
History
70 lines (57 loc) · 1.37 KB
Breadcrumbs
AsyncDisplayKit
/
AsyncDisplayKit
/
ASViewController.m
Copy path
File metadata and controls
70 lines (57 loc) · 1.37 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
//
ASViewController.m
//
AsyncDisplayKit
//
//
Created by Huy Nguyen on 16/09/15.
//
Copyright (c) 2015 Facebook. All rights reserved.
//
#
import
"
ASViewController.h
"
#
import
"
ASAssert.h
"
#
import
"
ASDimension.h
"
//
FIXME: Temporary nonsense import until method names are finalized and exposed
#
import
"
ASDisplayNode+Subclasses.h
"
@implementation
ASViewController
{
BOOL
_ensureDisplayed;
}
- (
instancetype
)
initWithNode
:
(ASDisplayNode *)
node
{
if
(!(self = [
super
initWithNibName:
nil
bundle:
nil
])) {
return
nil
;
}
ASDisplayNodeAssertNotNil
(node,
@"
Node must not be nil
"
);
ASDisplayNodeAssertTrue
(!node.
layerBacked
);
_node = node;
return
self;
}
- (
void
)
loadView
{
ASDisplayNodeAssertTrue
(!_node.
layerBacked
);
self.
view
= _node.
view
;
}
- (
void
)
viewWillLayoutSubviews
{
[
super
viewWillLayoutSubviews
];
[_node
measureWithSizeRange:
[
self
nodeConstrainedSize
]];
}
- (
void
)
viewDidLayoutSubviews
{
if
(_ensureDisplayed && self.
neverShowPlaceholders
) {
_ensureDisplayed =
NO
;
[
self
.node
recursivelyEnsureDisplay
];
}
[
super
viewDidLayoutSubviews
];
}
- (
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear:
animated];
_ensureDisplayed =
YES
;
[_node
recursivelyFetchData
];
}
//
MARK: - Layout Helpers
- (ASSizeRange)
nodeConstrainedSize
{
CGSize viewSize = self.
view
.
bounds
.
size
;
return
ASSizeRangeMake
(viewSize, viewSize);
}
@end
Back
|
FazBrowse Home
|
New Git URL