Skip to content

Commit

Permalink
Merge branch 'toolbar'
Browse files Browse the repository at this point in the history
  • Loading branch information
vicpenap committed Apr 26, 2012
2 parents 208e96e + 318118d commit 7e12245
Show file tree
Hide file tree
Showing 7 changed files with 585 additions and 1 deletion.
16 changes: 16 additions & 0 deletions PrettyExample.xcodeproj/project.pbxproj
Expand Up @@ -30,6 +30,9 @@
57A6337614FE7672004D2647 /* ExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 57A6337514FE7672004D2647 /* ExampleViewController.m */; };
57CF9FB1151BA08600BC035B /* PlainExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 57CF9FAF151BA08600BC035B /* PlainExample.m */; };
57CF9FB2151BA08600BC035B /* PlainExample.xib in Resources */ = {isa = PBXBuildFile; fileRef = 57CF9FB0151BA08600BC035B /* PlainExample.xib */; };
EDA7DCB11548EBD1002219BA /* PrettyToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = EDA7DCB01548EBD1002219BA /* PrettyToolbar.m */; };
EDA7DCB61548ED3F002219BA /* ModalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EDA7DCB41548ED3E002219BA /* ModalViewController.m */; };
EDA7DCB71548ED3F002219BA /* ModalViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = EDA7DCB51548ED3E002219BA /* ModalViewController.xib */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -72,6 +75,11 @@
57CF9FAE151BA08600BC035B /* PlainExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlainExample.h; sourceTree = "<group>"; };
57CF9FAF151BA08600BC035B /* PlainExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlainExample.m; sourceTree = "<group>"; };
57CF9FB0151BA08600BC035B /* PlainExample.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PlainExample.xib; sourceTree = "<group>"; };
EDA7DCAF1548EBD1002219BA /* PrettyToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrettyToolbar.h; sourceTree = "<group>"; };
EDA7DCB01548EBD1002219BA /* PrettyToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrettyToolbar.m; sourceTree = "<group>"; };
EDA7DCB31548ED3E002219BA /* ModalViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModalViewController.h; path = ../PrettyKit/ModalViewController.h; sourceTree = "<group>"; };
EDA7DCB41548ED3E002219BA /* ModalViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ModalViewController.m; path = ../PrettyKit/ModalViewController.m; sourceTree = "<group>"; };
EDA7DCB51548ED3E002219BA /* ModalViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = ModalViewController.xib; path = ../PrettyKit/ModalViewController.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -128,6 +136,9 @@
57A6337514FE7672004D2647 /* ExampleViewController.m */,
57360BDE14FF889B00343B7B /* ExampleViewController.xib */,
57360BDC14FF84F600343B7B /* MainWindow.xib */,
EDA7DCB31548ED3E002219BA /* ModalViewController.h */,
EDA7DCB41548ED3E002219BA /* ModalViewController.m */,
EDA7DCB51548ED3E002219BA /* ModalViewController.xib */,
57CF9FAE151BA08600BC035B /* PlainExample.h */,
57CF9FAF151BA08600BC035B /* PlainExample.m */,
57CF9FB0151BA08600BC035B /* PlainExample.xib */,
Expand Down Expand Up @@ -163,6 +174,8 @@
578998C01535E02000E06FCA /* PrettyShadowPlainTableview.m */,
578998C11535E02000E06FCA /* PrettyTabBar.h */,
578998C21535E02000E06FCA /* PrettyTabBar.m */,
EDA7DCAF1548EBD1002219BA /* PrettyToolbar.h */,
EDA7DCB01548EBD1002219BA /* PrettyToolbar.m */,
);
path = PrettyKit;
sourceTree = SOURCE_ROOT;
Expand Down Expand Up @@ -238,6 +251,7 @@
57CF9FB2151BA08600BC035B /* PlainExample.xib in Resources */,
572B2E6A153496880002228B /* background.png in Resources */,
572B2E6B153496880002228B /* background@2x.png in Resources */,
EDA7DCB71548ED3F002219BA /* ModalViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -261,6 +275,8 @@
578998C91535E02000E06FCA /* PrettyNavigationBar.m in Sources */,
578998CA1535E02000E06FCA /* PrettyShadowPlainTableview.m in Sources */,
578998CB1535E02000E06FCA /* PrettyTabBar.m in Sources */,
EDA7DCB11548EBD1002219BA /* PrettyToolbar.m in Sources */,
EDA7DCB61548ED3F002219BA /* ModalViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
14 changes: 13 additions & 1 deletion PrettyExample/ExampleViewController.m
Expand Up @@ -8,6 +8,7 @@

#import "ExampleViewController.h"
#import "PrettyKit.h"
#import "ModalViewController.h"


@implementation ExampleViewController
Expand All @@ -21,6 +22,13 @@ - (void)didReceiveMemoryWarning
// Release any cached data, images, etc that aren't in use.
}

-(void)onComposeClick:(id)sender
{
ModalViewController *modalView = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil];
[self presentModalViewController:modalView animated:YES];
[modalView release];
}

#pragma mark - View lifecycle

- (void)viewDidLoad
Expand All @@ -33,7 +41,11 @@ - (void)viewDidLoad
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.navigationItem.title = @"PrettyKit";
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:nil action:nil] autorelease];

self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemCompose
target:self
action:@selector(onComposeClick:)] autorelease];
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background"]];
}

Expand Down
15 changes: 15 additions & 0 deletions PrettyKit/ModalViewController.h
@@ -0,0 +1,15 @@
//
// ModalViewController.h
// PrettyExample
//
// Created by Seth Gholson on 4/25/12.
// Copyright (c) 2012 NA. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ModalViewController : UIViewController

- (IBAction)onDoneClick:(id)sender;

@end
48 changes: 48 additions & 0 deletions PrettyKit/ModalViewController.m
@@ -0,0 +1,48 @@
//
// ModalViewController.m
// PrettyExample
//
// Created by Seth Gholson on 4/25/12.
// Copyright (c) 2012 NA. All rights reserved.
//

#import "ModalViewController.h"

@interface ModalViewController ()

@end

@implementation ModalViewController

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

- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background"]];

}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)onDoneClick:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
@end

0 comments on commit 7e12245

Please sign in to comment.