//
//  TipsViewController.m
//  GMEDemoAudio
//
//  Created by tobinchen on 20/06/2018.
//  Copyright © 2018 tobinchen. All rights reserved.
//

#pragma clang diagnostic ignored "-Wunguarded-availability"

#import "TipsViewController.h"
#import "GMESDK/TMGEngine.h"


@implementation TipsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do view setup here.
}

-(void)viewWillAppear{
    
    if(_tipsTimer){
        [_tipsTimer invalidate];
        _tipsTimer = nil;
    }
//    __weak typeof(self)weakSelf = self;
    _tipsTimer = [NSTimer scheduledTimerWithTimeInterval:1 repeats:YES block:^(NSTimer * _Nonnull timer) {
       // __strong typeof(weakSelf)strongSelf = weakSelf;
        //NSString* tipsString = [[[ITMGContext GetInstance] GetRoom] GetQualityTips];
        
//
//        tipsString = [NSString stringWithFormat:@"tips len:%lu,Tips:\n%@",tipsString.length,tipsString];
//
//        NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:tipsString];
//
//        NSDictionary *attributes = @{
//                                     NSForegroundColorAttributeName : [NSColor blueColor],
//                                     NSFontAttributeName : [NSFont fontWithName:@"HelveticaNeue-Bold" size:20.f]
//                                     };
//        [attributedString setAttributes:attributes range:NSMakeRange(0, [tipsString rangeOfString:@"\n"].location)];
//        [strongSelf->_tipsView.textStorage setAttributedString:attributedString];
    }];
}

-(void)viewDidDisappear{
    if(_tipsTimer){
        [_tipsTimer invalidate];
        _tipsTimer = nil;
    }
}

@end
