Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Try subclassing and archiving instead of swizzling.

  • Loading branch information...
commit bce0b4d02201815c0e5f0808b0af358788f0820a 1 parent d2c711d
@scelis authored
View
17 Classes/SCAppDelegate.h
@@ -1,17 +1,16 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
+//
+// SCAppDelegate.h
+// ExampleNavBarBackground
+//
+// Created by Sebastian Celis on 6/7/2010.
+// Copyright 2010-2012 Sebastian Celis. All rights reserved.
+//
#import <UIKit/UIKit.h>
@interface SCAppDelegate : NSObject <UIApplicationDelegate>
-{
- UIWindow *window;
- UINavigationController *navController;
-}
+@property (nonatomic, retain) UINavigationController *navigationController;
@property (nonatomic, retain) IBOutlet UIWindow *window;
-@property (nonatomic, retain) UINavigationController *navController;
@end
View
74 Classes/SCAppDelegate.m
@@ -1,38 +1,78 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
+//
+// SCAppDelegate.m
+// ExampleNavBarBackground
+//
+// Created by Sebastian Celis on 6/7/2010.
+// Copyright 2010-2012 Sebastian Celis. All rights reserved.
+//
#import "SCAppDelegate.h"
-#import "SCAppUtils.h"
+
+#import "SCNavigationBar.h"
#import "SCTestTableViewController.h"
+@interface SCAppDelegate ()
+- (UINavigationController *)customizedNavigationController;
+@end
+
+
@implementation SCAppDelegate
-@synthesize window;
-@synthesize navController;
+@synthesize navigationController = _navigationController;
+@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
+ UINavigationController *navigationController = [self customizedNavigationController];
SCTestTableViewController *tvc = [[SCTestTableViewController alloc] initWithStyle:UITableViewStylePlain];
- UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:tvc];
- [SCAppUtils customizeNavigationController:nc];
- [self setNavController:nc];
-
- [window addSubview:[nc view]];
- [window makeKeyAndVisible];
-
+ [navigationController setViewControllers:[NSArray arrayWithObject:tvc]];
+ [self setNavigationController:navigationController];
[tvc release];
- [nc release];
+
+ [[self window] setRootViewController:navigationController];
+ [[self window] makeKeyAndVisible];
return YES;
}
- (void)dealloc
{
- [navController release];
- [window release];
+ [_navigationController release];
+ [_window release];
[super dealloc];
}
+- (UINavigationController *)customizedNavigationController
+{
+ UINavigationController *navController = [[UINavigationController alloc] initWithNibName:nil bundle:nil];
+
+ // Ensure the UINavigationBar is created so that it can be archived. If we do not access the
+ // navigation bar then it will not be allocated, and thus, it will not be archived by the
+ // NSKeyedArchvier.
+ [navController navigationBar];
+
+ // Archive the navigation controller.
+ NSMutableData *data = [NSMutableData data];
+ NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
+ [archiver encodeObject:navController forKey:@"root"];
+ [archiver finishEncoding];
+ [archiver release];
+ [navController release];
+
+ // Unarchive the navigation controller and ensure that our UINavigationBar subclass is used.
+ NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
+ [unarchiver setClass:[SCNavigationBar class] forClassName:@"UINavigationBar"];
+ UINavigationController *customizedNavController = [unarchiver decodeObjectForKey:@"root"];
+ [unarchiver finishDecoding];
+ [unarchiver release];
+
+ // Modify the navigation bar to have a background image.
+ SCNavigationBar *navBar = (SCNavigationBar *)[customizedNavController navigationBar];
+ [navBar setTintColor:[UIColor colorWithRed:0.39 green:0.72 blue:0.62 alpha:1.0]];
+ [navBar setBackgroundImage:[UIImage imageNamed:@"navigation-bar-bg.png"] forBarMetrics:UIBarMetricsDefault];
+ [navBar setBackgroundImage:[UIImage imageNamed:@"navigation-bar-bg-landscape.png"] forBarMetrics:UIBarMetricsLandscapePhone];
+
+ return customizedNavController;
+}
+
@end
View
17 Classes/SCAppUtils.h
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
-
-#import <UIKit/UIKit.h>
-
-#define kSCNavigationBarBackgroundImageTag 6183746
-#define kSCNavigationBarTintColor [UIColor colorWithRed:0.39 green:0.72 blue:0.62 alpha:1.0]
-
-@interface SCAppUtils : NSObject
-{
-}
-
-+ (void)customizeNavigationController:(UINavigationController *)navController;
-
-@end
View
32 Classes/SCAppUtils.m
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
-
-#import "SCAppUtils.h"
-
-@implementation SCAppUtils
-
-+ (void)customizeNavigationController:(UINavigationController *)navController
-{
- UINavigationBar *navBar = [navController navigationBar];
- [navBar setTintColor:kSCNavigationBarTintColor];
-
- if ([navBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)])
- {
- [navBar setBackgroundImage:[UIImage imageNamed:@"navigation-bar-bg.png"] forBarMetrics:UIBarMetricsDefault];
- }
- else
- {
- UIImageView *imageView = (UIImageView *)[navBar viewWithTag:kSCNavigationBarBackgroundImageTag];
- if (imageView == nil)
- {
- imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navigation-bar-bg.png"]];
- [imageView setTag:kSCNavigationBarBackgroundImageTag];
- [navBar insertSubview:imageView atIndex:0];
- [imageView release];
- }
- }
-}
-
-@end
View
14 Classes/SCClassUtils.h
@@ -1,14 +0,0 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
-
-#import <Foundation/Foundation.h>
-
-@interface SCClassUtils : NSObject
-{
-}
-
-+ (void)swizzleSelector:(SEL)orig ofClass:(Class)c withSelector:(SEL)new;
-
-@end
View
31 Classes/SCClassUtils.m
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
-
-#import "SCClassUtils.h"
-
-#if OBJC_API_VERSION >= 2
-#import <objc/runtime.h>
-#else
-#import <objc/objc-class.h>
-#endif
-
-@implementation SCClassUtils
-
-+ (void)swizzleSelector:(SEL)orig ofClass:(Class)c withSelector:(SEL)new;
-{
- Method origMethod = class_getInstanceMethod(c, orig);
- Method newMethod = class_getInstanceMethod(c, new);
-
- if (class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod)))
- {
- class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
- }
- else
- {
- method_exchangeImplementations(origMethod, newMethod);
- }
-}
-
-@end
View
15 Classes/SCNavigationBar.h
@@ -0,0 +1,15 @@
+//
+// SCNavigationBar.h
+// ExampleNavBarBackground
+//
+// Created by Sebastian Celis on 3/1/2012.
+// Copyright 2012-2012 Sebastian Celis. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface SCNavigationBar : UINavigationBar
+
+- (void)setBackgroundImage:(UIImage *)backgroundImage forBarMetrics:(UIBarMetrics)barMetrics;
+
+@end
View
97 Classes/SCNavigationBar.m
@@ -0,0 +1,97 @@
+//
+// SCNavigationBar.m
+// ExampleNavBarBackground
+//
+// Created by Sebastian Celis on 3/1/2012.
+// Copyright 2012-2012 Sebastian Celis. All rights reserved.
+//
+
+#import "SCNavigationBar.h"
+
+@interface SCNavigationBar ()
+@property (nonatomic, retain) UIImageView *backgroundImageView;
+@property (nonatomic, retain) NSMutableDictionary *backgroundImages;
+- (void)updateBackgroundImage;
+@end
+
+
+@implementation SCNavigationBar
+
+@synthesize backgroundImages = _backgroundImages;
+@synthesize backgroundImageView = _backgroundImageView;
+
+#pragma mark - View Lifecycle
+
+- (void)dealloc
+{
+ [_backgroundImages release];
+ [_backgroundImageView release];
+ [super dealloc];
+}
+
+#pragma mark - Background Image
+
+- (NSMutableDictionary *)backgroundImages
+{
+ if (_backgroundImages == nil)
+ {
+ _backgroundImages = [[NSMutableDictionary alloc] init];
+ }
+
+ return _backgroundImages;
+}
+
+- (UIImageView *)backgroundImageView
+{
+ if (_backgroundImageView == nil)
+ {
+ _backgroundImageView = [[UIImageView alloc] initWithFrame:[self bounds]];
+ [_backgroundImageView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
+ [self insertSubview:_backgroundImageView atIndex:0];
+ }
+
+ return _backgroundImageView;
+}
+
+- (void)setBackgroundImage:(UIImage *)backgroundImage forBarMetrics:(UIBarMetrics)barMetrics
+{
+ if ([UINavigationBar instancesRespondToSelector:@selector(setBackgroundImage:forBarMetrics:)])
+ {
+ [self setBackgroundImage:backgroundImage forBarMetrics:barMetrics];
+ }
+ else
+ {
+ [[self backgroundImages] setObject:backgroundImage forKey:[NSNumber numberWithInt:barMetrics]];
+ [self updateBackgroundImage];
+ }
+}
+
+- (void)updateBackgroundImage
+{
+ UIBarMetrics metrics = ([self bounds].size.height > 40.0) ? UIBarMetricsDefault : UIBarMetricsLandscapePhone;
+ UIImage *image = [[self backgroundImages] objectForKey:[NSNumber numberWithInt:metrics]];
+ if (image == nil && metrics != UIBarMetricsDefault)
+ {
+ image = [[self backgroundImages] objectForKey:[NSNumber numberWithInt:UIBarMetricsDefault]];
+ }
+
+ if (image != nil)
+ {
+ [[self backgroundImageView] setImage:image];
+ }
+}
+
+#pragma mark - Layout
+
+- (void)layoutSubviews
+{
+ [super layoutSubviews];
+
+ if (_backgroundImageView != nil)
+ {
+ [self updateBackgroundImage];
+ [self sendSubviewToBack:_backgroundImageView];
+ }
+}
+
+@end
View
13 Classes/SCTestTableViewController.h
@@ -1,12 +1,13 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
+//
+// SCTestTableViewController.h
+// ExampleNavBarBackground
+//
+// Created by Sebastian Celis on 6/7/2010.
+// Copyright 2010-2012 Sebastian Celis. All rights reserved.
+//
#import <UIKit/UIKit.h>
@interface SCTestTableViewController : UITableViewController <UITableViewDataSource, UITableViewDelegate>
-{
-}
@end
View
28 Classes/SCTestTableViewController.m
@@ -1,18 +1,20 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
+//
+// SCTestTableViewController.m
+// ExampleNavBarBackground
+//
+// Created by Sebastian Celis on 6/7/2010.
+// Copyright 2010-2012 Sebastian Celis. All rights reserved.
+//
#import "SCTestTableViewController.h"
@implementation SCTestTableViewController
-#pragma mark -
-#pragma mark View Lifecycle
+#pragma mark - Controller Lifecycle
- (id)initWithStyle:(UITableViewStyle)style
{
- if (self = [super initWithStyle:style])
+ if ((self = [super initWithStyle:style]))
{
[self setTitle:@"Test Table View"];
}
@@ -20,13 +22,14 @@ - (id)initWithStyle:(UITableViewStyle)style
return self;
}
-- (void)dealloc
+#pragma mark - Rotation
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
- [super dealloc];
+ return YES;
}
-#pragma mark -
-#pragma mark UITableViewDataSource
+#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
@@ -47,8 +50,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return cell;
}
-#pragma mark -
-#pragma mark UITableViewDelegate
+#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
View
13 Classes/UINavigationBar+SCBackgroundImage.h
@@ -1,13 +0,0 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
-
-#import <UIKit/UIKit.h>
-
-@interface UINavigationBar (SCBackgroundImage)
-
-- (void)scInsertSubview:(UIView *)view atIndex:(NSInteger)index;
-- (void)scSendSubviewToBack:(UIView *)view;
-
-@end
View
33 Classes/UINavigationBar+SCBackgroundImage.m
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
-
-#import "UINavigationBar+SCBackgroundImage.h"
-#import "SCAppUtils.h"
-
-@implementation UINavigationBar (SCBackgroundImage)
-
-- (void)scInsertSubview:(UIView *)view atIndex:(NSInteger)index
-{
- [self scInsertSubview:view atIndex:index];
-
- UIView *backgroundImageView = [self viewWithTag:kSCNavigationBarBackgroundImageTag];
- if (backgroundImageView != nil)
- {
- [self scSendSubviewToBack:backgroundImageView];
- }
-}
-
-- (void)scSendSubviewToBack:(UIView *)view
-{
- [self scSendSubviewToBack:view];
-
- UIView *backgroundImageView = [self viewWithTag:kSCNavigationBarBackgroundImageTag];
- if (backgroundImageView != nil)
- {
- [self scSendSubviewToBack:backgroundImageView];
- }
-}
-
-@end
View
7 ExampleNavBarBackground-Info.plist
@@ -26,5 +26,12 @@
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
</dict>
</plist>
View
30 ExampleNavBarBackground.xcodeproj/project.pbxproj
@@ -12,9 +12,8 @@
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
- 63D9C27211BD49CD007A1AD0 /* SCAppUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 63D9C27111BD49CD007A1AD0 /* SCAppUtils.m */; };
- 63D9C27511BD4A37007A1AD0 /* UINavigationBar+SCBackgroundImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 63D9C27411BD4A37007A1AD0 /* UINavigationBar+SCBackgroundImage.m */; };
- 63D9C27811BD4A6B007A1AD0 /* SCClassUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 63D9C27711BD4A6B007A1AD0 /* SCClassUtils.m */; };
+ 6340A63715006379004A5FEF /* navigation-bar-bg-landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 6340A63615006379004A5FEF /* navigation-bar-bg-landscape.png */; };
+ 63D9C27511BD4A37007A1AD0 /* SCNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 63D9C27411BD4A37007A1AD0 /* SCNavigationBar.m */; };
63D9C2B411BD4BDC007A1AD0 /* SCTestTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 63D9C2B311BD4BDC007A1AD0 /* SCTestTableViewController.m */; };
63D9C30111BD50D9007A1AD0 /* navigation-bar-bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 63D9C30011BD50D9007A1AD0 /* navigation-bar-bg.png */; };
/* End PBXBuildFile section */
@@ -28,12 +27,9 @@
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* ExampleNavBarBackground_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExampleNavBarBackground_Prefix.pch; sourceTree = "<group>"; };
- 63D9C27011BD49CD007A1AD0 /* SCAppUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCAppUtils.h; sourceTree = "<group>"; };
- 63D9C27111BD49CD007A1AD0 /* SCAppUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCAppUtils.m; sourceTree = "<group>"; };
- 63D9C27311BD4A37007A1AD0 /* UINavigationBar+SCBackgroundImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationBar+SCBackgroundImage.h"; sourceTree = "<group>"; };
- 63D9C27411BD4A37007A1AD0 /* UINavigationBar+SCBackgroundImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationBar+SCBackgroundImage.m"; sourceTree = "<group>"; };
- 63D9C27611BD4A6B007A1AD0 /* SCClassUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCClassUtils.h; sourceTree = "<group>"; };
- 63D9C27711BD4A6B007A1AD0 /* SCClassUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCClassUtils.m; sourceTree = "<group>"; };
+ 6340A63615006379004A5FEF /* navigation-bar-bg-landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "navigation-bar-bg-landscape.png"; sourceTree = "<group>"; };
+ 63D9C27311BD4A37007A1AD0 /* SCNavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCNavigationBar.h; sourceTree = "<group>"; };
+ 63D9C27411BD4A37007A1AD0 /* SCNavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCNavigationBar.m; sourceTree = "<group>"; };
63D9C2B211BD4BDC007A1AD0 /* SCTestTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCTestTableViewController.h; sourceTree = "<group>"; };
63D9C2B311BD4BDC007A1AD0 /* SCTestTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCTestTableViewController.m; sourceTree = "<group>"; };
63D9C30011BD50D9007A1AD0 /* navigation-bar-bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "navigation-bar-bg.png"; sourceTree = "<group>"; };
@@ -58,14 +54,10 @@
children = (
1D3623240D0F684500981E51 /* SCAppDelegate.h */,
1D3623250D0F684500981E51 /* SCAppDelegate.m */,
- 63D9C27011BD49CD007A1AD0 /* SCAppUtils.h */,
- 63D9C27111BD49CD007A1AD0 /* SCAppUtils.m */,
- 63D9C27611BD4A6B007A1AD0 /* SCClassUtils.h */,
- 63D9C27711BD4A6B007A1AD0 /* SCClassUtils.m */,
+ 63D9C27311BD4A37007A1AD0 /* SCNavigationBar.h */,
+ 63D9C27411BD4A37007A1AD0 /* SCNavigationBar.m */,
63D9C2B211BD4BDC007A1AD0 /* SCTestTableViewController.h */,
63D9C2B311BD4BDC007A1AD0 /* SCTestTableViewController.m */,
- 63D9C27311BD4A37007A1AD0 /* UINavigationBar+SCBackgroundImage.h */,
- 63D9C27411BD4A37007A1AD0 /* UINavigationBar+SCBackgroundImage.m */,
);
path = Classes;
sourceTree = "<group>";
@@ -103,6 +95,7 @@
isa = PBXGroup;
children = (
63D9C30011BD50D9007A1AD0 /* navigation-bar-bg.png */,
+ 6340A63615006379004A5FEF /* navigation-bar-bg-landscape.png */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* ExampleNavBarBackground-Info.plist */,
);
@@ -144,7 +137,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0420;
+ LastUpgradeCheck = 0430;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ExampleNavBarBackground" */;
compatibilityVersion = "Xcode 3.2";
@@ -169,6 +162,7 @@
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
63D9C30111BD50D9007A1AD0 /* navigation-bar-bg.png in Resources */,
+ 6340A63715006379004A5FEF /* navigation-bar-bg-landscape.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -181,9 +175,7 @@
files = (
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* SCAppDelegate.m in Sources */,
- 63D9C27211BD49CD007A1AD0 /* SCAppUtils.m in Sources */,
- 63D9C27511BD4A37007A1AD0 /* UINavigationBar+SCBackgroundImage.m in Sources */,
- 63D9C27811BD4A6B007A1AD0 /* SCClassUtils.m in Sources */,
+ 63D9C27511BD4A37007A1AD0 /* SCNavigationBar.m in Sources */,
63D9C2B411BD4BDC007A1AD0 /* SCTestTableViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
View
19 main.m
@@ -1,20 +1,15 @@
-/*
- * Copyright (c) 2010-2010 Sebastian Celis
- * All rights reserved.
- */
+//
+// main.m
+// ExampleNavBarBackground
+//
+// Created by Sebastian Celis on 6/7/2010.
+// Copyright 2010-2012 Sebastian Celis. All rights reserved.
+//
#import <UIKit/UIKit.h>
-#import "SCClassUtils.h"
int main(int argc, char *argv[])
{
- [SCClassUtils swizzleSelector:@selector(insertSubview:atIndex:)
- ofClass:[UINavigationBar class]
- withSelector:@selector(scInsertSubview:atIndex:)];
- [SCClassUtils swizzleSelector:@selector(sendSubviewToBack:)
- ofClass:[UINavigationBar class]
- withSelector:@selector(scSendSubviewToBack:)];
-
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
View
BIN  navigation-bar-bg-landscape.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.