PeakhealthDentistry

viewcontroller.h

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>


@interface ViewController : UIViewController<UIScrollViewDelegate>
@property (weak, nonatomic) IBOutlet UIBarButtonItem *menuBtn;
@property (weak, nonatomic) IBOutlet UIButton *contactBtn;

- (IBAction)contactAct:(id)sender;
@property (weak, nonatomic) IBOutlet UIButton *webBtn;

- (IBAction)webAct:(id)sender;

@property UIImageView *imageView;
@property UIScrollView *scrollView;
@property (weak, nonatomic) IBOutlet UIButton *mapBtn;
- (IBAction)mapAction:(id)sender;
@end


viewcontroller.m

#import "ViewController.h"
#import "SWRevealViewController.h"
#import "webViewController.h"
#import "MKViewController.h"
@interface ViewController ()

@end

@implementation ViewController
int i;
- (void)viewDidLoad {
    [super viewDidLoad];
    self.menuBtn.target=self.revealViewController;
    self.menuBtn.action=@selector(revealToggle:);
    
    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
    // slideshow
    
    UIImage *image1 = [UIImage imageNamed:@"1.jpeg"];
    UIImage *image2 = [UIImage imageNamed:@"2.jpg"];
    UIImage *image3 = [UIImage imageNamed:@"offers.jpeg"];
    
    NSArray *images = [[NSArray alloc] initWithObjects:image1,image2,image3,nil];
    
    // Now create a UIScrollView to hold the UIImageViews
    _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,30,450,270)];
    
    _scrollView.pagingEnabled = YES;
    _scrollView.showsHorizontalScrollIndicator=NO;
    _scrollView.showsVerticalScrollIndicator=NO;
    [_scrollView setIndicatorStyle:UIScrollViewIndicatorStyleWhite];
    
    int numberOfViews = 3;
    for (int i = 0; i < numberOfViews; i++) {
        CGFloat xOrigin = i * 450;
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(xOrigin,0,450,270)];
        [imageView setImage:[images objectAtIndex:i]];
        [_scrollView addSubview:imageView];
      //  [imageView release];
    }
    
    // Set the contentSize equal to the size of the UIImageView
    // scrollView.contentSize = imageView.scrollview.size;
    _scrollView.contentSize = CGSizeMake(numberOfViews * 450, 270);
    
    
    // Finally, add the UIScrollView to the controller's view
    [self.view addSubview:_scrollView];
    

    
}

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

- (IBAction)contactAct:(id)sender {

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",@"8686882314"]]];

}
- (IBAction)webAct:(id)sender {
//    webViewController *web=[self.storyboard instantiateViewControllerWithIdentifier:@"webVC"];
//    [self presentViewController:web animated:YES completion:^{
//        
//        [[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://www.oursmp3.tk"]];
//        
//    }];
    
    [self performSegueWithIdentifier:@"webVC" sender:self];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://www.oursmp3.tk"]];
}
- (IBAction)mapAction:(id)sender {
    
    
}
@end

menuTableViewController.h

#import <UIKit/UIKit.h>

@interface menuTableViewController : UITableViewController

@property NSMutableArray *ary,*imageAry;

@end

menuTableViewController.m

#import "menuTableViewController.h"
#import "SWRevealViewController.h"
#import "infoTableViewController.h"
#import "appointmentViewController.h"
#import "offersViewController.h"
#import "teamViewController.h"
#import "contactViewController.h"
@interface menuTableViewController ()

@end

@implementation menuTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //_imageAry =[[NSMutableArray alloc]initWithObjects:[UIImage imageNamed:@"1.jpeg"], nil];
    _ary=[[NSMutableArray alloc]initWithObjects:@"Home",@"Info",@"Appointment",@"Offers",@"Team",@"Contact", nil];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
     self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

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

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return [_ary count];
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSString *identifier=[_ary objectAtIndex:indexPath.row];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath];
    
    // Configure the cell...
    
    return cell;
}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/


#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 {
    
    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    UINavigationController *destViewController = segue.destinationViewController;
    destViewController.title = [[_ary objectAtIndex:indexPath.row] capitalizedString];
    if ([segue.identifier isEqualToString:@"info"]) {
        infoTableViewController *infoVC = segue.destinationViewController;
        //        NSString *photoFilename = [NSString stringWithFormat:@"%@", [self.imgArray objectAtIndex:indexPath.row]];
        //        NSLog(@"%@",photoFilename);
        //        detailController.imgString = photoFilename;
        
        
    }
   else if ([segue.identifier isEqualToString:@"appointment"]) {
        appointmentViewController *appointmentVC = segue.destinationViewController;
        
        
    }
   else if ([segue.identifier isEqualToString:@"offers"]) {
       offersViewController *offerVC = segue.destinationViewController;
       
       
   }
   else if ([segue.identifier isEqualToString:@"team"]) {
       teamViewController *teamVC = segue.destinationViewController;
       
       
   }
   else if ([segue.identifier isEqualToString:@"contact"]) {
       contactViewController *contactVC = segue.destinationViewController;
       
       
   }
    
    if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] ) {
        SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;
        
        swSegue.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) {
            
            UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
            [navController setViewControllers: @[dvc] animated: NO ];
            [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
        };
        
    }

    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}


@end

infoTableViewController.h

#import <UIKit/UIKit.h>

@interface infoTableViewController : UITableViewController<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UIBarButtonItem *menuBtn;
@property NSMutableArray *infoAry;
@end

infoTableViewController.m

#import "infoTableViewController.h"
#import "SWRevealViewController.h"
#import "menuTableViewController.h"
@interface infoTableViewController ()

@end

@implementation infoTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _menuBtn.target=self.revealViewController;
    _menuBtn.action=@selector(revealToggle:);
    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
    
    _infoAry=[[NSMutableArray alloc]initWithObjects:@"OralFit Score",@"OverView",@"Dental Emergencies & Tips", nil];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
     self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

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

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return [_infoAry count];
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSString *identifier=[_infoAry objectAtIndex:indexPath.row];
    UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:identifier];
                    //forIndexPath:indexPath];
    if(cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
        
    }
    cell.textLabel.text=[_infoAry objectAtIndex:indexPath.row];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    // Configure the cell...
    
    return cell;
}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#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

appointmentViewController.h

#import <UIKit/UIKit.h>

@interface appointmentViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIBarButtonItem *menuBtn;
@end

appointmentViewController.m

#import "appointmentViewController.h"
#import "SWRevealViewController.h"
@interface appointmentViewController ()

@end

@implementation appointmentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _menuBtn.target=self.revealViewController;
    _menuBtn.action=@selector(revealToggle:);
    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
    // 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

offersViewController.h

#import <UIKit/UIKit.h>

@interface offersViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIBarButtonItem *menuBtn;
@end

offersViewController.m

#import "offersViewController.h"
#import "SWRevealViewController.h"
@interface offersViewController ()

@end

@implementation offersViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _menuBtn.target=self.revealViewController;
    _menuBtn.action=@selector(revealToggle:);
    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
    // 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

teamViewController.h

#import <UIKit/UIKit.h>

@interface teamViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIBarButtonItem *menuBtn;
@end

teamViewController.m

#import "teamViewController.h"
#import "SWRevealViewController.h"
@interface teamViewController ()

@end

@implementation teamViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _menuBtn.target=self.revealViewController;
    _menuBtn.action=@selector(revealToggle:);
    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
    // 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

contactViewController.h

#import <UIKit/UIKit.h>

@interface contactViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIBarButtonItem *menuBtn;

@end
contactViewController.m

#import "contactViewController.h"
#import "SWRevealViewController.h"
@interface contactViewController ()

@end

@implementation contactViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _menuBtn.target=self.revealViewController;
    _menuBtn.action=@selector(revealToggle:);
    [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
    // 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
Previous
Next Post »

1 comments:

Write comments
Unknown
AUTHOR
10 November 2016 at 08:36 delete

https://drive.google.com/open?id=0BwU5Y4Xqfa42RDhuTHdrcUVYV2s

Reply
avatar