Skip to content

Commit

Permalink
Add the Base Auth View Controller
Browse files Browse the repository at this point in the history
  • Loading branch information
sdkdimon committed Sep 10, 2014
1 parent 7efb604 commit a398793
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
25 changes: 25 additions & 0 deletions TouchBase/BaseOAuthViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#import <UIKit/UIKit.h>


extern NSString * const OAVCMessageLoading;
extern NSString * const OAVCMessageFetchAccess;
extern NSString * const OAVCMessageFetchRequest;


@class BaseOAuthViewController;

@protocol OAuthVCActivityDelegate <NSObject>
-(void)oAuthViewController:(BaseOAuthViewController *)viewController becomeActiveWithMessage:(NSString *)message;
-(void)oAuthViewControllerDoneActivity:(BaseOAuthViewController *)viewController;
-(void)oAuthViewControllerDismissed:(BaseOAuthViewController *)viewController;
-(void)oAuthViewControllerDidCancel:(BaseOAuthViewController *)viewController;
@end

@interface BaseOAuthViewController : UIViewController{
@protected NSNotificationCenter *_notificationCenter;
@protected __weak id <OAuthVCActivityDelegate> _activityDelegate;
}

@property(weak,nonatomic) id <OAuthVCActivityDelegate> activityDelegate;

@end
47 changes: 47 additions & 0 deletions TouchBase/BaseOAuthViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#import "BaseOAuthViewController.h"

NSString * const OAVCMessageLoading = @"Loading...";
NSString * const OAVCMessageFetchAccess = @"Fetch access token...";
NSString * const OAVCMessageFetchRequest = @"Fetch request token...";

@interface BaseOAuthViewController ()

@end

@implementation BaseOAuthViewController
@synthesize activityDelegate = _activityDelegate;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
_notificationCenter = [NSNotificationCenter defaultCenter];
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/

@end

0 comments on commit a398793

Please sign in to comment.