Permalink
Browse files

first import of a demo-able showoff app

  • Loading branch information...
schacon committed May 6, 2010
0 parents commit b32fe8ef42a41a09ecc422a338f479dfda8e2ef6
@@ -0,0 +1,9 @@
+.DS_Store
+*.swp
+*~.nib
+
+build/
+
+*.pbxuser
+*.perspective
+*.perspectivev3
@@ -0,0 +1,22 @@
+//
+// ShowOffPadAppDelegate.h
+// ShowOffPad
+//
+// Created by Scott Chacon on 5/5/10.
+// Copyright GitHub 2010. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class ShowOffPadViewController;
+
+@interface ShowOffPadAppDelegate : NSObject <UIApplicationDelegate> {
+ UIWindow *window;
+ ShowOffPadViewController *viewController;
+}
+
+@property (nonatomic, retain) IBOutlet UIWindow *window;
+@property (nonatomic, retain) IBOutlet ShowOffPadViewController *viewController;
+
+@end
+
@@ -0,0 +1,33 @@
+//
+// ShowOffPadAppDelegate.m
+// ShowOffPad
+//
+// Created by Scott Chacon on 5/5/10.
+// Copyright GitHub 2010. All rights reserved.
+//
+
+#import "ShowOffPadAppDelegate.h"
+#import "ShowOffPadViewController.h"
+
+@implementation ShowOffPadAppDelegate
+
+@synthesize window;
+@synthesize viewController;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+
+ // Override point for customization after app launch
+ [window addSubview:viewController.view];
+ [window makeKeyAndVisible];
+
+ return YES;
+}
+
+- (void)dealloc {
+ [viewController release];
+ [window release];
+ [super dealloc];
+}
+
+
+@end
@@ -0,0 +1,28 @@
+//
+// ShowOffPadViewController.h
+// ShowOffPad
+//
+// Created by Scott Chacon on 5/5/10.
+// Copyright GitHub 2010. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ShowOffPadViewController : UIViewController {
+ IBOutlet UIWebView *webDisplayiPad;
+ UIButton *nextButton;
+ UIButton *prevButton;
+ UILabel *notesArea;
+}
+
+@property(nonatomic,retain) UIWebView *webDisplayiPad;
+
+@property (nonatomic, retain) IBOutlet UIButton *nextButton;
+@property (nonatomic, retain) IBOutlet UIButton *prevButton;
+@property (nonatomic, retain) IBOutlet UILabel *notesArea;
+
+- (IBAction)doNextButton;
+- (IBAction)doPrevButton;
+
+@end
+
@@ -0,0 +1,97 @@
+//
+// ShowOffPadViewController.m
+// ShowOffPad
+//
+// Created by Scott Chacon on 5/5/10.
+// Copyright GitHub 2010. All rights reserved.
+//
+
+#import "ShowOffPadViewController.h"
+
+@implementation ShowOffPadViewController
+
+@synthesize webDisplayiPad;
+@synthesize nextButton, prevButton, notesArea;
+
+- (IBAction) doNextButton {
+ NSLog(@"NEXT");
+ NSString *output = [webDisplayiPad stringByEvaluatingJavaScriptFromString:@"nextStep()"];
+ NSLog(@"OUT :%@", output);
+ notesArea.text = output;
+}
+
+- (IBAction) doPrevButton {
+ NSLog(@"PREV");
+ NSString *output = [webDisplayiPad stringByEvaluatingJavaScriptFromString:@"prevStep()"];
+ NSLog(@"OUT :%@", output);
+}
+
+
+/*
+// The designated initializer. Override to perform setup that is required before the view is loaded.
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
+ // Custom initialization
+ }
+ return self;
+}
+*/
+
+/*
+// Implement loadView to create a view hierarchy programmatically, without using a nib.
+- (void)loadView {
+}
+*/
+
+
+/*
+// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
+- (void)viewDidLoad {
+ [super viewDidLoad];
+}
+*/
+
+- (void)viewDidLoad {
+ NSString *urlAddress = @"http://localhost:9090";
+
+ //Create a URL object.
+ NSURL *url = [NSURL URLWithString:urlAddress];
+ //URL Requst Object
+ NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
+
+ //Load the request in the UIWebView.
+ //webDisplayiPad.scalesPageToFit = TRUE;
+ [webDisplayiPad loadRequest:requestObj];
+
+ [super viewDidLoad];
+}
+
+// Override to allow orientations other than the default portrait orientation.
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
+ return YES;
+ }
+ if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
+ return YES;
+ }
+ return NO;
+}
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+- (void)viewDidUnload {
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+@end
Oops, something went wrong.

0 comments on commit b32fe8e

Please sign in to comment.