Permalink
Browse files

Initial commit of app

  • Loading branch information...
cwalcott committed Feb 17, 2011
0 parents commit 0f0260530172b61c3a2bb2ee3b67a09cd1752f69
@@ -0,0 +1,3 @@
+build
+*.pbxuser
+*.perspectivev3
@@ -0,0 +1,22 @@
+//
+// KeyboardDoneBarAppDelegate.h
+// KeyboardDoneBar
+//
+// Created by Costa Walcott on 2/16/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class KeyboardDoneBarViewController;
+
+@interface KeyboardDoneBarAppDelegate : NSObject <UIApplicationDelegate> {
+ UIWindow *window;
+ KeyboardDoneBarViewController *viewController;
+}
+
+@property (nonatomic, retain) IBOutlet UIWindow *window;
+@property (nonatomic, retain) IBOutlet KeyboardDoneBarViewController *viewController;
+
+@end
+
@@ -0,0 +1,88 @@
+//
+// KeyboardDoneBarAppDelegate.m
+// KeyboardDoneBar
+//
+// Created by Costa Walcott on 2/16/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "KeyboardDoneBarAppDelegate.h"
+#import "KeyboardDoneBarViewController.h"
+
+@implementation KeyboardDoneBarAppDelegate
+
+@synthesize window;
+@synthesize viewController;
+
+
+#pragma mark -
+#pragma mark Application lifecycle
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+
+ // Override point for customization after application launch.
+
+ // Add the view controller's view to the window and display.
+ [self.window addSubview:viewController.view];
+ [self.window makeKeyAndVisible];
+
+ return YES;
+}
+
+
+- (void)applicationWillResignActive:(UIApplication *)application {
+ /*
+ Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ */
+}
+
+
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+ /*
+ Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
+ */
+}
+
+
+- (void)applicationWillEnterForeground:(UIApplication *)application {
+ /*
+ Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
+ */
+}
+
+
+- (void)applicationDidBecomeActive:(UIApplication *)application {
+ /*
+ Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+ */
+}
+
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+ /*
+ Called when the application is about to terminate.
+ See also applicationDidEnterBackground:.
+ */
+}
+
+
+#pragma mark -
+#pragma mark Memory management
+
+- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
+ /*
+ Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
+ */
+}
+
+
+- (void)dealloc {
+ [viewController release];
+ [window release];
+ [super dealloc];
+}
+
+
+@end
@@ -0,0 +1,22 @@
+//
+// KeyboardDoneBarViewController.h
+// KeyboardDoneBar
+//
+// Created by Costa Walcott on 2/16/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface KeyboardDoneBarViewController : UIViewController {
+ UITextView *textView;
+ UIToolbar *keyboardToolbar;
+}
+
+@property (nonatomic, retain) IBOutlet UITextView *textView;
+@property (nonatomic, retain) IBOutlet UIView *keyboardToolbar;
+
+- (IBAction)hideKeyboard:(id)sender;
+
+@end
+
@@ -0,0 +1,112 @@
+//
+// KeyboardDoneBarViewController.m
+// KeyboardDoneBar
+//
+// Created by Costa Walcott on 2/16/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "KeyboardDoneBarViewController.h"
+
+@implementation KeyboardDoneBarViewController
+
+@synthesize textView, keyboardToolbar;
+
+- (void)viewWillAppear:(BOOL)animated {
+ [super viewWillAppear:animated];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
+}
+
+- (void)viewWillDisappear:(BOOL)animated {
+ [super viewWillDisappear:animated];
+
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
+}
+
+#pragma mark -
+#pragma mark IBActions
+
+- (IBAction)hideKeyboard:(id)sender {
+ [self.textView resignFirstResponder];
+}
+
+#pragma mark -
+#pragma mark Notifications
+
+- (void)keyboardWillShow:(NSNotification *)notification {
+ [UIView beginAnimations:nil context:NULL];
+ [UIView setAnimationDuration:0.3];
+
+ CGRect frame = self.keyboardToolbar.frame;
+ frame.origin.y = self.view.frame.size.height - 260.0;
+ self.keyboardToolbar.frame = frame;
+
+ [UIView commitAnimations];
+}
+
+- (void)keyboardWillHide:(NSNotification *)notification {
+ [UIView beginAnimations:nil context:NULL];
+ [UIView setAnimationDuration:0.3];
+
+ CGRect frame = self.keyboardToolbar.frame;
+ frame.origin.y = self.view.frame.size.height;
+ self.keyboardToolbar.frame = frame;
+
+ [UIView commitAnimations];
+}
+
+/*
+// The designated initializer. Override to perform setup that is required before the view is loaded.
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ // 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];
+}
+*/
+
+
+/*
+// Override to allow orientations other than the default portrait orientation.
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+*/
+
+- (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
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>NSMainNibFile</key>
+ <string>MainWindow</string>
+</dict>
+</plist>
Oops, something went wrong.

0 comments on commit 0f02605

Please sign in to comment.