Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaykz52 committed Nov 24, 2012
0 parents commit 731487c
Show file tree
Hide file tree
Showing 24 changed files with 822 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .gitignore
@@ -0,0 +1,14 @@
.DS_Store
*.swp

.idea/

build/

*.pbxuser
*.perspective
*.perspectivev3
xcuserdata

*.mode1v3
*.mode2v3
341 changes: 341 additions & 0 deletions Example/CKSideBarController.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Example/CKSideBarController/CKAppDelegate.h
@@ -0,0 +1,17 @@
//
// CKAppDelegate.h
// CKSideBarController
//
// Created by Jason Kozemczak on 11/23/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@class CKSideBarController;

@interface CKAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end
81 changes: 81 additions & 0 deletions Example/CKSideBarController/CKAppDelegate.m
@@ -0,0 +1,81 @@
//
// CKAppDelegate.m
// CKSideBarController
//
// Created by Jason Kozemczak on 11/23/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "CKAppDelegate.h"
#import "CKSideBarController.h"

@interface CKAppDelegate ()

@property(nonatomic) CKSideBarController *barController;

@end

@implementation CKAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];

self.barController = [[CKSideBarController alloc] init];
self.window.rootViewController = self.barController;

self.barController.viewControllers = @[
[self navControllerWithTitle:@"Tweets" backgroundColor:[UIColor whiteColor] barImage:[UIImage imageNamed:@"messages.png"]],
[self navControllerWithTitle:@"Messages" backgroundColor:[UIColor whiteColor] barImage:[UIImage imageNamed:@"compose.png"]],
[self navControllerWithTitle:@"Connect" backgroundColor:[UIColor whiteColor] barImage:[UIImage imageNamed:@"search.png"]]
];

return YES;
}

- (UINavigationController *)navControllerWithTitle:(NSString *)title backgroundColor:(UIColor *)backgroundColor barImage:(UIImage *)image {
UIViewController *controller = [[UIViewController alloc] init];
controller.title = title;
controller.view.backgroundColor = backgroundColor;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
navController.tabBarItem.title = title;
navController.tabBarItem.image = image;
return navController;
}

- (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, this method is called instead of applicationWillTerminate: when the user quits.

}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the 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. Save data if appropriate. See also applicationDidEnterBackground:.

}

@end
39 changes: 39 additions & 0 deletions Example/CKSideBarController/CKSideBarController-Info.plist
@@ -0,0 +1,39 @@
<?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>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.asynchrony.${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>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Example/CKSideBarController/CKSideBarController-Prefix.pch
@@ -0,0 +1,16 @@
//
// Prefix header for all source files of the 'CKSideBarController' target in the 'CKSideBarController' project
//

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#endif

#ifdef __OBJC__
#import <UIKit/UIKit.h>

#import <Foundation/Foundation.h>

#endif
Binary file added Example/CKSideBarController/Default-568h@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/CKSideBarController/Default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/CKSideBarController/Default@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/CKSideBarController/compose.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/CKSideBarController/compose@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Example/CKSideBarController/en.lproj/InfoPlist.strings
@@ -0,0 +1 @@
/* Localized versions of Info.plist keys */
19 changes: 19 additions & 0 deletions Example/CKSideBarController/main.m
@@ -0,0 +1,19 @@
//
// main.m
// CKSideBarController
//
// Created by Jason Kozemczak on 11/23/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "CKAppDelegate.h"

int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([CKAppDelegate class]));
}

}
Binary file added Example/CKSideBarController/messages.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/CKSideBarController/messages@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/CKSideBarController/search.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/CKSideBarController/search@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions Source/CKSideBarController.h
@@ -0,0 +1,39 @@
//
// Copyright (c) 2012 Jason Kozemczak
//
// 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 <Foundation/Foundation.h>

@protocol CKSideBarControllerDelegate;

@interface CKSideBarController : UIViewController

@property (nonatomic, copy) NSArray *viewControllers;

@property (nonatomic, assign) UIViewController *selectedViewController;
@property (nonatomic) NSUInteger selectedIndex;

@property (nonatomic, assign) id<CKSideBarControllerDelegate> delegate;

@end

@protocol CKSideBarControllerDelegate <NSObject>

@optional
- (BOOL)sideBarController:(CKSideBarController *)sideBarController shouldSelectViewController:(UIViewController *)viewController;
- (void)sideBarController:(CKSideBarController *)sideBarController didSelectViewController:(UIViewController *)viewController;

@end

0 comments on commit 731487c

Please sign in to comment.