Permalink
Browse files

Improved PrettyToolbar and exampler

- Changed topLineColor on PrettyToolbar.
- Improved Modal View Controller.
  • Loading branch information...
1 parent 6767be6 commit 318118d96c6667701f20a54f9fcad35a6e7cae9c @vicpenap committed Apr 26, 2012
@@ -26,6 +26,7 @@ -(void)onComposeClick:(id)sender
{
ModalViewController *modalView = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil];
[self presentModalViewController:modalView animated:YES];
+ [modalView release];
}
#pragma mark - View lifecycle
@@ -26,6 +26,7 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
- (void)viewDidLoad
{
[super viewDidLoad];
+ self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background"]];
}
@@ -1,19 +1,21 @@
<?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>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">10K549</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.AppKitVersion">1038.36</string>
+ <string key="IBDocument.HIToolboxVersion">461.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>
+ <string key="NS.object.0">933</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
- <string>IBUIBarButtonItem</string>
+ <string>IBUINavigationItem</string>
<string>IBUIToolbar</string>
+ <string>IBUIBarButtonItem</string>
<string>IBUIView</string>
+ <string>IBUINavigationBar</string>
<string>IBProxyObject</string>
</array>
<array key="IBDocument.PluginDependencies">
@@ -39,43 +41,80 @@
<object class="IBUIToolbar" id="924059982">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">266</int>
- <string key="NSFrameSize">{320, 44}</string>
+ <string key="NSFrame">{{0, 416}, {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">
+ <object class="IBUIBarButtonItem" id="655854416">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <int key="IBUIStyle">2</int>
<reference key="IBUIToolbar" ref="924059982"/>
- <int key="IBUISystemItemIdentifier">0</int>
+ <int key="IBUISystemItemIdentifier">5</int>
</object>
- <object class="IBUIBarButtonItem" id="655854416">
+ <object class="IBUIBarButtonItem" id="617587500">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUIToolbar" ref="924059982"/>
- <int key="IBUISystemItemIdentifier">5</int>
+ <int key="IBUISystemItemIdentifier">4</int>
</object>
- <object class="IBUIBarButtonItem" id="865645241">
- <string key="IBUITitle">Compose</string>
+ <object class="IBUIBarButtonItem" id="561044176">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <float key="IBUIWidth">42</float>
+ <reference key="IBUIToolbar" ref="924059982"/>
+ <int key="IBUISystemItemIdentifier">6</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="791148809">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="924059982"/>
+ <int key="IBUISystemItemIdentifier">7</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="610381680">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <float key="IBUIWidth">42</float>
<reference key="IBUIToolbar" ref="924059982"/>
+ <int key="IBUISystemItemIdentifier">6</int>
</object>
- <object class="IBUIBarButtonItem" id="791451608">
+ <object class="IBUIBarButtonItem" id="635057216">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUIToolbar" ref="924059982"/>
+ <int key="IBUISystemItemIdentifier">10</int>
+ </object>
+ <object class="IBUIBarButtonItem" id="20679561">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUIToolbar" ref="924059982"/>
<int key="IBUISystemItemIdentifier">5</int>
</object>
</array>
</object>
+ <object class="IBUINavigationBar" id="268625086">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">290</int>
+ <string key="NSFrameSize">{320, 44}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="924059982"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <array key="IBUIItems">
+ <object class="IBUINavigationItem" id="508029782">
+ <reference key="IBUINavigationBar" ref="268625086"/>
+ <string key="IBUITitle">Compose</string>
+ <object class="IBUIBarButtonItem" key="IBUIRightBarButtonItem" id="899784186">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIStyle">2</int>
+ <reference key="IBUINavigationItem" ref="508029782"/>
+ <int key="IBUISystemItemIdentifier">0</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </array>
+ </object>
</array>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="924059982"/>
+ <reference key="NSNextKeyView" ref="268625086"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@@ -119,6 +158,7 @@
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
<reference ref="924059982"/>
+ <reference ref="268625086"/>
</array>
<reference key="parent" ref="0"/>
</object>
@@ -137,31 +177,70 @@
<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="617587500"/>
<reference ref="655854416"/>
+ <reference ref="791148809"/>
+ <reference ref="561044176"/>
+ <reference ref="20679561"/>
+ <reference ref="610381680"/>
+ <reference ref="635057216"/>
</array>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
+ <int key="objectID">15</int>
+ <reference key="object" ref="268625086"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="508029782"/>
+ </array>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">16</int>
+ <reference key="object" ref="508029782"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="899784186"/>
+ </array>
+ <reference key="parent" ref="268625086"/>
+ </object>
+ <object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="899784186"/>
- <reference key="parent" ref="924059982"/>
+ <reference key="parent" ref="508029782"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">8</int>
- <reference key="object" ref="791451608"/>
+ <int key="objectID">17</int>
+ <reference key="object" ref="617587500"/>
<reference key="parent" ref="924059982"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">11</int>
+ <int key="objectID">18</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"/>
+ <int key="objectID">19</int>
+ <reference key="object" ref="791148809"/>
+ <reference key="parent" ref="924059982"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">20</int>
+ <reference key="object" ref="561044176"/>
+ <reference key="parent" ref="924059982"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">21</int>
+ <reference key="object" ref="20679561"/>
+ <reference key="parent" ref="924059982"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">22</int>
+ <reference key="object" ref="610381680"/>
+ <reference key="parent" ref="924059982"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="635057216"/>
<reference key="parent" ref="924059982"/>
</object>
</array>
@@ -172,18 +251,25 @@
<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="15.CustomClassName">PrettyNavigationBar</string>
+ <string key="15.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="16.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="17.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="18.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="19.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="20.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="22.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="23.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>
+ <int key="maxID">23</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -207,6 +293,14 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">PrettyNavigationBar</string>
+ <string key="superclassName">UINavigationBar</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/PrettyNavigationBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">PrettyToolbar</string>
<string key="superclassName">UIToolbar</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -220,10 +314,10 @@
<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"/>
+ <real value="1280" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">1179</string>
+ <string key="IBCocoaTouchPluginVersion">933</string>
</data>
</archive>
View
@@ -3,8 +3,24 @@
// PrettyExample
//
// Created by Seth Gholson on 4/25/12.
-// Copyright (c) 2012 NA. All rights reserved.
-//
+
+// Permission is hereby granted, free of charge, to any person obtaining a copy of
+// this software and associated documentation files (the "Software"), to deal in
+// the Software without restriction, including without limitation the rights to
+// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+// the Software, and to permit persons to whom the Software is furnished to do so,
+// subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
#import <UIKit/UIKit.h>
View
@@ -3,8 +3,24 @@
// PrettyExample
//
// Created by Seth Gholson on 4/25/12.
-// Copyright (c) 2012 NA. All rights reserved.
-//
+
+// Permission is hereby granted, free of charge, to any person obtaining a copy of
+// this software and associated documentation files (the "Software"), to deal in
+// the Software without restriction, including without limitation the rights to
+// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+// the Software, and to permit persons to whom the Software is furnished to do so,
+// subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
#import "PrettyToolbar.h"
#import <QuartzCore/QuartzCore.h>
@@ -16,7 +32,7 @@ @implementation PrettyToolbar
#define default_shadow_opacity 0.5
#define default_gradient_end_color [UIColor colorWithHex:0x297CB7]
#define default_gradient_start_color [UIColor colorWithHex:0x53A4DE]
-#define default_top_line_color [UIColor colorWithHex:0x84B7D5]
+#define default_top_line_color [UIColor colorWithHex:0x4F94C4]
#define default_bottom_line_color [UIColor colorWithHex:0x186399]
#define default_tint_color [UIColor colorWithHex:0x3D89BF]
@@ -79,7 +95,7 @@ - (void) drawBottomLine:(CGRect)rect {
- (void) drawRect:(CGRect)rect {
[super drawRect:rect];
- [self dropShadowWithOpacity:self.shadowOpacity];
+// [self dropShadowWithOpacity:self.shadowOpacity];
[PrettyDrawing drawGradient:rect fromColor:self.gradientStartColor toColor:self.gradientEndColor];
[self drawTopLine:rect];
[self drawBottomLine:rect];

0 comments on commit 318118d

Please sign in to comment.