mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Address comments
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
#import <AsyncDisplayKit/ASAsciiArtBoxCreator.h>
|
||||
#import <AsyncDisplayKit/ASLayoutable.h>
|
||||
|
||||
#define ASDisplayNodeLoggingEnabled 0
|
||||
|
||||
@class ASDisplayNode;
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,8 +48,11 @@ NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp = @"AS
|
||||
|
||||
@end
|
||||
|
||||
//#define LOG(...) NSLog(__VA_ARGS__)
|
||||
#define LOG(...)
|
||||
#if ASDisplayNodeLoggingEnabled
|
||||
#define LOG(...) NSLog(__VA_ARGS__)
|
||||
#else
|
||||
#define LOG(...)
|
||||
#endif
|
||||
|
||||
// Conditionally time these scopes to our debug ivars (only exist in debug/profile builds)
|
||||
#if TIME_DISPLAYNODE_OPS
|
||||
@@ -1094,13 +1097,9 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
|
||||
// try to measure the node with the largest size as possible
|
||||
if (self.supernode == nil && !self.supportsRangeManagedInterfaceState && !_flags.isMeasured) {
|
||||
if (CGRectEqualToRect(bounds, CGRectZero)) {
|
||||
// FIXME: Better log to let developers know that the node was not measured before the layout call and no frame was set
|
||||
NSLog(@"Warning: No size given for node before node was trying to layout itself: %@. Please provide a frame for the node.", self);
|
||||
LOG(@"Warning: No size given for node before node was trying to layout itself: %@. Please provide a frame for the node.", self);
|
||||
} else {
|
||||
ASSizeRange measureSizeRange = ASSizeRangeMake(CGSizeZero, bounds.size);
|
||||
if ([self shouldMeasureWithSizeRange:measureSizeRange]) {
|
||||
[self measureWithSizeRange:measureSizeRange];
|
||||
}
|
||||
[self measureWithSizeRange:ASSizeRangeMake(CGSizeZero, bounds.size)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
#import <AsyncDisplayKit/ASVideoNode.h>
|
||||
|
||||
#include <UIKit/UIKit.h>
|
||||
|
||||
@interface ViewController : UIViewController
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
*/
|
||||
|
||||
#import "ViewController.h"
|
||||
#import "ASLayoutSpec.h"
|
||||
#import "ASStaticLayoutSpec.h"
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ViewController()<ASVideoNodeDelegate>
|
||||
@property (nonatomic, strong) ASDisplayNode *rootNode;
|
||||
@@ -22,10 +21,20 @@
|
||||
|
||||
#pragma mark - UIViewController
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
self = [super initWithNibName:nil bundle:nil];
|
||||
if (self) {
|
||||
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
// Root node for the view controller
|
||||
_rootNode = [ASDisplayNode new];
|
||||
_rootNode.frame = self.view.bounds;
|
||||
|
||||
Reference in New Issue
Block a user