NewsBlur/media/ios/Classes/GoogleReaderViewController.m

69 lines
1.7 KiB
Mathematica
Raw Normal View History

2012-06-15 16:35:54 -07:00
//
// GoogleReaderViewController.m
// NewsBlur
//
// Created by Roy Yang on 6/15/12.
// Copyright (c) 2012 NewsBlur. All rights reserved.
//
#import "GoogleReaderViewController.h"
#import "NewsBlurAppDelegate.h"
@implementation GoogleReaderViewController
@synthesize appDelegate;
@synthesize webView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[webView setDelegate:self];
NSString *urlAddress = @"http://newsblur.com/import/authorize/";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)viewDidUnload
{
[self setWebView:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
NSString *URLString = [[request URL] absoluteString];
2012-06-15 16:35:54 -07:00
if ([URLString isEqualToString:@"http://www.newsblur.com/"]) {
[self dismissModalViewControllerAnimated:YES];
[appDelegate addedGoogleReader];
2012-06-15 16:35:54 -07:00
return NO;
}
return YES;
}
- (IBAction)tapCancelButton:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
2012-06-15 16:35:54 -07:00
@end