source: orbit/iOS/Orbit/Orbit/controllers/SupportViewController.m @ ab9d63b

RawEEGServoTab_Interfacepyramid
Last change on this file since ab9d63b was ab9d63b, checked in by Jonathon Horsman <jonathon@…>, 7 years ago

Initial check in to convert into a 4 tab app with tutorial, flight, advanced and support tabs.
Old controller code remains for now but about to be removed

  • Property mode set to 100644
File size: 1.6 KB
Line 
1//
2//  SupportViewController.m
3//  orbit
4//
5//  Created by Jonathon Horsman on 11/07/2013.
6//  Copyright (c) 2013 Puzzlebox Productions, LLC. All rights reserved.
7//
8
9#import "SupportViewController.h"
10
11@implementation SupportViewController
12
13@synthesize webView, retryButton, status;
14
15- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
16{
17    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
18    if (self) {
19        // Custom initialization
20    }
21    return self;
22}
23
24- (void)viewDidLoad
25{
26    [super viewDidLoad];
27    [self loadSupportSite];
28}
29
30- (void) loadSupportSite
31{
32    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: @"http://puzzlebox.info/forums/forumdisplay.php?fid=4"]]];
33}
34
35- (void)didReceiveMemoryWarning
36{
37    [super didReceiveMemoryWarning];
38    // Dispose of any resources that can be recreated.
39}
40
41#pragma mark UIWebViewDelegate methods
42
43- (void)webViewDidStartLoad:(UIWebView *)webView
44{
45    retryButton.hidden = YES;
46    status.hidden = YES;
47}
48
49- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
50{
51    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Connected" message:@"Unable to view support since you have no internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
52    [alert show];
53    retryButton.hidden = NO;
54    status.hidden = NO;
55    status.text = @"Unable to load support site";
56}
57
58#pragma mark button press methods
59
60- (IBAction) retryButtonPressed:(id) sender {
61    retryButton.hidden = YES;
62    status.text = @"Loading support website...";
63    [self loadSupportSite];
64}
65
66@end
Note: See TracBrowser for help on using the repository browser.