mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-03-25 09:25:47 +00:00
- new dark look that matches samhuri.net - improved cell layout for article list - fix yap caching - update service layer to match new API - implement authentication - fix bugs all over - add a preview
43 lines
1 KiB
Objective-C
43 lines
1 KiB
Objective-C
//
|
|
// PreviewViewController.m
|
|
// Blog
|
|
//
|
|
// Created by Sami Samhuri on 2015-04-19.
|
|
// Copyright (c) 2015 Guru Logic Inc. All rights reserved.
|
|
//
|
|
|
|
#import "PreviewViewController.h"
|
|
|
|
@interface PreviewViewController () <UIWebViewDelegate>
|
|
|
|
@property (weak, nonatomic) IBOutlet UIWebView *webView;
|
|
|
|
@end
|
|
|
|
@implementation PreviewViewController
|
|
|
|
- (void)viewWillAppear:(BOOL)animated {
|
|
[super viewWillAppear:animated];
|
|
|
|
if (self.initialRequest) {
|
|
if (self.promise) {
|
|
self.promise.then(^{
|
|
[self.webView loadRequest:self.initialRequest];
|
|
}).finally(^{
|
|
self.promise = nil;
|
|
});
|
|
}
|
|
else {
|
|
[self.webView loadRequest:self.initialRequest];
|
|
}
|
|
}
|
|
}
|
|
|
|
- (void)setInitialRequest:(NSURLRequest *)initialRequest {
|
|
_initialRequest = initialRequest;
|
|
[self.webView loadHTMLString:@"<!doctype html><html><head><title></title></head><body></body></html>" baseURL:nil];
|
|
}
|
|
|
|
#pragma mark - UIWebViewDelegate methods
|
|
|
|
@end
|