Permalink
Browse files

Created PrettyToolbar. Added ModalViewController to demonstrate its u…

…se, which is identical to the PrettyNavigationBar
  • Loading branch information...
sethgho committed Apr 26, 2012
1 parent 5ce2d89 commit 5825b8397c50388b1586f4e2058df331671a0764
@@ -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 */
@@ -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 */
@@ -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 */,
@@ -163,6 +174,8 @@
578998C01535E02000E06FCA /* PrettyShadowPlainTableview.m */,
578998C11535E02000E06FCA /* PrettyTabBar.h */,
578998C21535E02000E06FCA /* PrettyTabBar.m */,
+ EDA7DCAF1548EBD1002219BA /* PrettyToolbar.h */,
+ EDA7DCB01548EBD1002219BA /* PrettyToolbar.m */,
);
path = PrettyKit;
sourceTree = SOURCE_ROOT;
@@ -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;
};
@@ -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;
};
@@ -8,6 +8,7 @@
#import "ExampleViewController.h"
#import "PrettyKit.h"
+#import "ModalViewController.h"
@implementation ExampleViewController
@@ -21,6 +22,12 @@ - (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];
+}
+
#pragma mark - View lifecycle
- (void)viewDidLoad
@@ -33,7 +40,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"]];
}
@@ -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
@@ -0,0 +1,47 @@
+//
+// 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];
+
+}
+
+- (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,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1296</int>
+ <string key="IBDocument.SystemVersion">11D50b</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+ <string key="IBDocument.AppKitVersion">1138.32</string>
+ <string key="IBDocument.HIToolboxVersion">568.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">1179</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBUIBarButtonItem</string>
+ <string>IBUIToolbar</string>
+ <string>IBUIView</string>
+ <string>IBProxyObject</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUIToolbar" id="924059982">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrameSize">{320, 44}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <array class="NSMutableArray" key="IBUIItems">
+ <object class="IBUIBarButtonItem" id="899784186">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIStyle">2</int>
+ <reference key="IBUIToolbar" ref="924059982"/>
+ <int key="IBUISystemItemIdentifier">0</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="655854416">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="924059982"/>
+ <int key="IBUISystemItemIdentifier">5</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="865645241">
+ <string key="IBUITitle">Compose</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="924059982"/>
+ </object>
+ <object class="IBUIBarButtonItem" id="791451608">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="924059982"/>
+ <int key="IBUISystemItemIdentifier">5</int>
+ </object>
+ </array>
+ </object>
+ </array>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="924059982"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">onDoneClick:</string>
+ <reference key="source" ref="899784186"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">6</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="924059982"/>
+ </array>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="924059982"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="899784186"/>
+ <reference ref="791451608"/>
+ <reference ref="865645241"/>
+ <reference ref="655854416"/>
+ </array>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="899784186"/>
+ <reference key="parent" ref="924059982"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="791451608"/>
+ <reference key="parent" ref="924059982"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">11</int>
+ <reference key="object" ref="655854416"/>
+ <reference key="parent" ref="924059982"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="865645241"/>
+ <reference key="parent" ref="924059982"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.CustomClassName">ModalViewController</string>
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="10.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="4.CustomClassName">PrettyToolbar</string>
+ <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">14</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">ModalViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">onDoneClick:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">onDoneClick:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">onDoneClick:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/ModalViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">PrettyToolbar</string>
+ <string key="superclassName">UIToolbar</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/PrettyToolbar.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <real value="1296" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">1179</string>
+ </data>
+</archive>
Oops, something went wrong.

0 comments on commit 5825b83

Please sign in to comment.