45 lines
963 B
Objective-C
45 lines
963 B
Objective-C
//
|
|
// WaitViewController.m
|
|
// Earthquake Network
|
|
//
|
|
// Refactored by Andrea Busi on 24/07/20.
|
|
// Copyright © 2020 Earthquake Network. All rights reserved.
|
|
//
|
|
|
|
#import "WaitViewController.h"
|
|
#import "Costanti.h"
|
|
|
|
@interface WaitViewController ()
|
|
|
|
@end
|
|
|
|
@implementation WaitViewController
|
|
|
|
#pragma mark - View Lifecycle
|
|
|
|
- (void)viewDidLoad
|
|
{
|
|
[super viewDidLoad];
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadCompletedNotification:) name:NOTIFICA_DOWNLOAD_TERMINATO object:nil];
|
|
[NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(closeController) userInfo:nil repeats:NO];
|
|
}
|
|
|
|
#pragma mark - Notifications
|
|
|
|
- (void)downloadCompletedNotification:(NSNotification *)notifica
|
|
{
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
[self closeController];
|
|
});
|
|
}
|
|
|
|
#pragma mark - Private
|
|
|
|
- (void)closeController
|
|
{
|
|
[self dismissViewControllerAnimated:NO completion:nil];
|
|
}
|
|
|
|
@end
|