show spinner immediately in preview

This commit is contained in:
Sami Samhuri 2015-05-15 21:21:24 -07:00
parent 2cb9adf357
commit abe7a1b1c6

View file

@ -49,13 +49,14 @@
[super viewWillAppear:animated];
if (self.initialRequest) {
[self.centerIndicatorView startAnimating];
[self.cornerIndicatorView stopAnimating];
self.webView.hidden = YES;
PMKPromise *p = self.promise ?: [PMKPromise promiseWithValue:nil];
__weak typeof(self) welf = self;
p.then(^{
typeof(self) self = welf;
[self.centerIndicatorView startAnimating];
[self.cornerIndicatorView stopAnimating];
self.webView.hidden = YES;
[self.webView loadRequest:self.initialRequest];
}).finally(^{
typeof(self) self = welf;