//
//  DietWebViewController.m
//  MedicalHelp
//
//  Created by mac on 7/14/14.
//  Copyright (c) 2014 mac. All rights reserved.
//

#import "DietWebViewController.h"

@implementation DietWebViewController

@synthesize htmlSource,wwDiet;

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

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    htmlSource = [NSMutableString stringWithString:[[NSString alloc]initWithData:[Base64 decode:htmlSource] encoding:NSUTF8StringEncoding]];

    [wwDiet loadHTMLString:htmlSource baseURL:nil];
    
    //Add bar button item to top
    UIBarButtonItem *btnHome = [[UIBarButtonItem alloc]initWithTitle:@"Home" style:UIBarButtonItemStyleBordered target:self action:@selector(goHome)];
    
    [self.navigationItem setRightBarButtonItem:btnHome];
    
    //and set title
    [self.navigationItem setTitle:@"Diet Information"];
}

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

-(void)goHome
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

@end
