add iPad demo.

This commit is contained in:
Tito Ciuro
2012-05-25 17:24:16 -07:00
parent 1510116ba3
commit 85d64a2208
13 changed files with 862 additions and 0 deletions

View File

@@ -0,0 +1,317 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
7477C26D1570573300D0E620 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7477C26C1570573300D0E620 /* UIKit.framework */; };
7477C26F1570573300D0E620 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7477C26E1570573300D0E620 /* Foundation.framework */; };
7477C2711570573300D0E620 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7477C2701570573300D0E620 /* CoreGraphics.framework */; };
7477C2771570573300D0E620 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7477C2751570573300D0E620 /* InfoPlist.strings */; };
7477C2791570573300D0E620 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7477C2781570573300D0E620 /* main.m */; };
7477C27D1570573300D0E620 /* WBAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7477C27C1570573300D0E620 /* WBAppDelegate.m */; };
7477C2801570573300D0E620 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7477C27E1570573300D0E620 /* MainStoryboard.storyboard */; };
7477C2831570573300D0E620 /* WBMasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7477C2821570573300D0E620 /* WBMasterViewController.m */; };
7477C2861570573300D0E620 /* WBDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7477C2851570573300D0E620 /* WBDetailViewController.m */; };
74D33BFD157057A000225A76 /* NoticeView.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 74D33BF8157057A000225A76 /* NoticeView.bundle */; };
74D33BFE157057A000225A76 /* UILabel+WBExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 74D33BFA157057A000225A76 /* UILabel+WBExtensions.m */; };
74D33BFF157057A000225A76 /* WBNoticeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 74D33BFC157057A000225A76 /* WBNoticeView.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
7477C2681570573300D0E620 /* NoticeViewiPad.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NoticeViewiPad.app; sourceTree = BUILT_PRODUCTS_DIR; };
7477C26C1570573300D0E620 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
7477C26E1570573300D0E620 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
7477C2701570573300D0E620 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
7477C2741570573300D0E620 /* NoticeViewiPad-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NoticeViewiPad-Info.plist"; sourceTree = "<group>"; };
7477C2761570573300D0E620 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
7477C2781570573300D0E620 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
7477C27A1570573300D0E620 /* NoticeViewiPad-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NoticeViewiPad-Prefix.pch"; sourceTree = "<group>"; };
7477C27B1570573300D0E620 /* WBAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WBAppDelegate.h; sourceTree = "<group>"; };
7477C27C1570573300D0E620 /* WBAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WBAppDelegate.m; sourceTree = "<group>"; };
7477C27F1570573300D0E620 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = "<group>"; };
7477C2811570573300D0E620 /* WBMasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WBMasterViewController.h; sourceTree = "<group>"; };
7477C2821570573300D0E620 /* WBMasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WBMasterViewController.m; sourceTree = "<group>"; };
7477C2841570573300D0E620 /* WBDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WBDetailViewController.h; sourceTree = "<group>"; };
7477C2851570573300D0E620 /* WBDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WBDetailViewController.m; sourceTree = "<group>"; };
74D33BF8157057A000225A76 /* NoticeView.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = NoticeView.bundle; sourceTree = "<group>"; };
74D33BF9157057A000225A76 /* UILabel+WBExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+WBExtensions.h"; sourceTree = "<group>"; };
74D33BFA157057A000225A76 /* UILabel+WBExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+WBExtensions.m"; sourceTree = "<group>"; };
74D33BFB157057A000225A76 /* WBNoticeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WBNoticeView.h; sourceTree = "<group>"; };
74D33BFC157057A000225A76 /* WBNoticeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WBNoticeView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
7477C2651570573300D0E620 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7477C26D1570573300D0E620 /* UIKit.framework in Frameworks */,
7477C26F1570573300D0E620 /* Foundation.framework in Frameworks */,
7477C2711570573300D0E620 /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
7477C25D1570573300D0E620 = {
isa = PBXGroup;
children = (
7477C2721570573300D0E620 /* NoticeViewiPad */,
7477C26B1570573300D0E620 /* Frameworks */,
7477C2691570573300D0E620 /* Products */,
);
sourceTree = "<group>";
};
7477C2691570573300D0E620 /* Products */ = {
isa = PBXGroup;
children = (
7477C2681570573300D0E620 /* NoticeViewiPad.app */,
);
name = Products;
sourceTree = "<group>";
};
7477C26B1570573300D0E620 /* Frameworks */ = {
isa = PBXGroup;
children = (
7477C26C1570573300D0E620 /* UIKit.framework */,
7477C26E1570573300D0E620 /* Foundation.framework */,
7477C2701570573300D0E620 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
7477C2721570573300D0E620 /* NoticeViewiPad */ = {
isa = PBXGroup;
children = (
7477C27E1570573300D0E620 /* MainStoryboard.storyboard */,
7477C27B1570573300D0E620 /* WBAppDelegate.h */,
7477C27C1570573300D0E620 /* WBAppDelegate.m */,
7477C2811570573300D0E620 /* WBMasterViewController.h */,
7477C2821570573300D0E620 /* WBMasterViewController.m */,
7477C2841570573300D0E620 /* WBDetailViewController.h */,
7477C2851570573300D0E620 /* WBDetailViewController.m */,
74D33BF7157057A000225A76 /* WBNoticeView */,
7477C2731570573300D0E620 /* Supporting Files */,
);
path = NoticeViewiPad;
sourceTree = "<group>";
};
7477C2731570573300D0E620 /* Supporting Files */ = {
isa = PBXGroup;
children = (
7477C2741570573300D0E620 /* NoticeViewiPad-Info.plist */,
7477C2751570573300D0E620 /* InfoPlist.strings */,
7477C2781570573300D0E620 /* main.m */,
7477C27A1570573300D0E620 /* NoticeViewiPad-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
74D33BF7157057A000225A76 /* WBNoticeView */ = {
isa = PBXGroup;
children = (
74D33BF8157057A000225A76 /* NoticeView.bundle */,
74D33BF9157057A000225A76 /* UILabel+WBExtensions.h */,
74D33BFA157057A000225A76 /* UILabel+WBExtensions.m */,
74D33BFB157057A000225A76 /* WBNoticeView.h */,
74D33BFC157057A000225A76 /* WBNoticeView.m */,
);
name = WBNoticeView;
path = ../../NoticeView/WBNoticeView;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
7477C2671570573300D0E620 /* NoticeViewiPad */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7477C2891570573300D0E620 /* Build configuration list for PBXNativeTarget "NoticeViewiPad" */;
buildPhases = (
7477C2641570573300D0E620 /* Sources */,
7477C2651570573300D0E620 /* Frameworks */,
7477C2661570573300D0E620 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = NoticeViewiPad;
productName = NoticeViewiPad;
productReference = 7477C2681570573300D0E620 /* NoticeViewiPad.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
7477C25F1570573300D0E620 /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = WB;
LastUpgradeCheck = 0430;
ORGANIZATIONNAME = "Webbo, LLC";
};
buildConfigurationList = 7477C2621570573300D0E620 /* Build configuration list for PBXProject "NoticeViewiPad" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 7477C25D1570573300D0E620;
productRefGroup = 7477C2691570573300D0E620 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
7477C2671570573300D0E620 /* NoticeViewiPad */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
7477C2661570573300D0E620 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7477C2771570573300D0E620 /* InfoPlist.strings in Resources */,
7477C2801570573300D0E620 /* MainStoryboard.storyboard in Resources */,
74D33BFD157057A000225A76 /* NoticeView.bundle in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
7477C2641570573300D0E620 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7477C2791570573300D0E620 /* main.m in Sources */,
7477C27D1570573300D0E620 /* WBAppDelegate.m in Sources */,
7477C2831570573300D0E620 /* WBMasterViewController.m in Sources */,
7477C2861570573300D0E620 /* WBDetailViewController.m in Sources */,
74D33BFE157057A000225A76 /* UILabel+WBExtensions.m in Sources */,
74D33BFF157057A000225A76 /* WBNoticeView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
7477C2751570573300D0E620 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
7477C2761570573300D0E620 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
7477C27E1570573300D0E620 /* MainStoryboard.storyboard */ = {
isa = PBXVariantGroup;
children = (
7477C27F1570573300D0E620 /* en */,
);
name = MainStoryboard.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
7477C2871570573300D0E620 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 2;
};
name = Debug;
};
7477C2881570573300D0E620 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 2;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
7477C28A1570573300D0E620 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "NoticeViewiPad/NoticeViewiPad-Prefix.pch";
INFOPLIST_FILE = "NoticeViewiPad/NoticeViewiPad-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
7477C28B1570573300D0E620 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "NoticeViewiPad/NoticeViewiPad-Prefix.pch";
INFOPLIST_FILE = "NoticeViewiPad/NoticeViewiPad-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
7477C2621570573300D0E620 /* Build configuration list for PBXProject "NoticeViewiPad" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7477C2871570573300D0E620 /* Debug */,
7477C2881570573300D0E620 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7477C2891570573300D0E620 /* Build configuration list for PBXNativeTarget "NoticeViewiPad" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7477C28A1570573300D0E620 /* Debug */,
7477C28B1570573300D0E620 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 7477C25F1570573300D0E620 /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:NoticeViewiPad.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,47 @@
<?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.webbo.${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>UIMainStoryboardFile</key>
<string>MainStoryboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
//
// Prefix header for all source files of the 'NoticeViewiPad' target in the 'NoticeViewiPad' project
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

View File

@@ -0,0 +1,15 @@
//
// WBAppDelegate.h
// NoticeViewiPad
//
// Created by Tito Ciuro on 5/25/12.
// Copyright (c) 2012 Webbo, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WBAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

View File

@@ -0,0 +1,51 @@
//
// WBAppDelegate.m
// NoticeViewiPad
//
// Created by Tito Ciuro on 5/25/12.
// Copyright (c) 2012 Webbo, LLC. All rights reserved.
//
#import "WBAppDelegate.h"
@implementation WBAppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
splitViewController.delegate = (id)navigationController.topViewController;
return YES;
}
- (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

View File

@@ -0,0 +1,17 @@
//
// WBDetailViewController.h
// NoticeViewiPad
//
// Created by Tito Ciuro on 5/25/12.
// Copyright (c) 2012 Webbo, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WBDetailViewController : UIViewController <UISplitViewControllerDelegate>
@property (strong, nonatomic) id detailItem;
- (IBAction)showNotice:(id)sender;
@end

View File

@@ -0,0 +1,89 @@
//
// WBDetailViewController.m
// NoticeViewiPad
//
// Created by Tito Ciuro on 5/25/12.
// Copyright (c) 2012 Webbo, LLC. All rights reserved.
//
#import "WBDetailViewController.h"
#import "WBNoticeView.h"
@interface WBDetailViewController ()
@property (strong, nonatomic) UIPopoverController *masterPopoverController;
- (void)configureView;
@end
@implementation WBDetailViewController
@synthesize detailItem = _detailItem;
@synthesize masterPopoverController = _masterPopoverController;
#pragma mark - Managing the detail item
- (void)setDetailItem:(id)newDetailItem
{
if (_detailItem != newDetailItem) {
_detailItem = newDetailItem;
// Update the view.
[self configureView];
}
if (self.masterPopoverController != nil) {
[self.masterPopoverController dismissPopoverAnimated:YES];
}
}
- (void)configureView
{
// Update the user interface for the detail item.
if (self.detailItem) {
//self.detailDescriptionLabel.text = [self.detailItem description];
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self configureView];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
#pragma mark - Split view
- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
{
barButtonItem.title = NSLocalizedString(@"Master", @"Master");
[self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
self.masterPopoverController = popoverController;
}
- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
{
// Called when the view is shown again in the split view, invalidating the button and popover controller.
[self.navigationItem setLeftBarButtonItem:nil animated:YES];
self.masterPopoverController = nil;
}
#pragma mark - Action Methods
- (IBAction)showNotice:(id)sender
{
WBNoticeView *nm = [WBNoticeView defaultManager];
[nm showErrorNoticeInView:self.view title:@"Network Error" message:@"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."];
}
@end

View File

@@ -0,0 +1,17 @@
//
// WBMasterViewController.h
// NoticeViewiPad
//
// Created by Tito Ciuro on 5/25/12.
// Copyright (c) 2012 Webbo, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
@class WBDetailViewController;
@interface WBMasterViewController : UITableViewController
@property (strong, nonatomic) WBDetailViewController *detailViewController;
@end

View File

@@ -0,0 +1,120 @@
//
// WBMasterViewController.m
// NoticeViewiPad
//
// Created by Tito Ciuro on 5/25/12.
// Copyright (c) 2012 Webbo, LLC. All rights reserved.
//
#import "WBMasterViewController.h"
#import "WBDetailViewController.h"
@interface WBMasterViewController () {
NSMutableArray *_objects;
}
@end
@implementation WBMasterViewController
@synthesize detailViewController = _detailViewController;
- (void)awakeFromNib
{
self.clearsSelectionOnViewWillAppear = NO;
self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0);
[super awakeFromNib];
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.navigationItem.leftBarButtonItem = self.editButtonItem;
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
self.navigationItem.rightBarButtonItem = addButton;
self.detailViewController = (WBDetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (void)insertNewObject:(id)sender
{
if (!_objects) {
_objects = [[NSMutableArray alloc] init];
}
[_objects insertObject:[NSDate date] atIndex:0];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}
#pragma mark - Table View
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _objects.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
NSDate *object = [_objects objectAtIndex:indexPath.row];
cell.textLabel.text = [object description];
return cell;
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
[_objects removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
}
}
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSDate *object = [_objects objectAtIndex:indexPath.row];
self.detailViewController.detailItem = object;
}
@end

View File

@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.1" toolsVersion="2182" systemVersion="11E53" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="5">
<dependencies>
<deployment defaultVersion="1296" identifier="iOS"/>
<development defaultVersion="4200" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1181"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
<scene sceneID="14">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="13" sceneMemberID="firstResponder"/>
<navigationController id="3" sceneMemberID="viewController">
<navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="6">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="19" kind="relationship" relationship="rootViewController" id="25"/>
</connections>
</navigationController>
</objects>
<point key="canvasLocation" x="448" y="-630"/>
</scene>
<!--Detail View Controller - Detail-->
<scene sceneID="16">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="15" sceneMemberID="firstResponder"/>
<viewController storyboardIdentifier="" title="Detail" id="4" customClass="WBDetailViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="26">
<rect key="frame" x="0.0" y="64" width="703" height="704"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="EwK-3u-DDY">
<rect key="frame" x="287" y="333" width="128" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" title="Display Notice">
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="showNotice:" destination="4" eventType="touchUpInside" id="hrB-7t-Yo6"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
</view>
<toolbarItems/>
<navigationItem key="navigationItem" title="Detail" id="53"/>
</viewController>
</objects>
<point key="canvasLocation" x="448" y="248"/>
</scene>
<!--Split View Controller-->
<scene sceneID="18">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="17" sceneMemberID="firstResponder"/>
<splitViewController id="5" sceneMemberID="viewController">
<toolbarItems/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="blackTranslucent"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<connections>
<segue destination="3" kind="relationship" relationship="masterViewController" id="9"/>
<segue destination="42" kind="relationship" relationship="detailViewController" id="51"/>
</connections>
</splitViewController>
</objects>
<point key="canvasLocation" x="-687" y="-630"/>
</scene>
<!--Master View Controller - Master-->
<scene sceneID="24">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="23" sceneMemberID="firstResponder"/>
<tableViewController storyboardIdentifier="" title="Master" clearsSelectionOnViewWillAppear="NO" id="19" customClass="WBMasterViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="20">
<rect key="frame" x="0.0" y="64" width="320" height="704"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="tIi-5l-S0i" style="IBUITableViewCellStyleDefault" id="ZSw-0O-9Pw">
<rect key="frame" x="0.0" y="22" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="tIi-5l-S0i">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</tableViewCell>
</prototypes>
<sections/>
<connections>
<outlet property="dataSource" destination="19" id="22"/>
<outlet property="delegate" destination="19" id="21"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Master" id="40"/>
</tableViewController>
</objects>
<point key="canvasLocation" x="859" y="-631"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="50">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="49" userLabel="First Responder" sceneMemberID="firstResponder"/>
<navigationController id="42" sceneMemberID="viewController">
<navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="43">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="4" kind="relationship" relationship="rootViewController" id="52"/>
</connections>
</navigationController>
</objects>
<point key="canvasLocation" x="-366" y="248"/>
</scene>
</scenes>
<classes>
<class className="WBDetailViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/WBDetailViewController.h"/>
<relationships>
<relationship kind="action" name="showNotice:"/>
</relationships>
</class>
<class className="WBMasterViewController" superclassName="UITableViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/WBMasterViewController.h"/>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View File

@@ -0,0 +1,18 @@
//
// main.m
// NoticeViewiPad
//
// Created by Tito Ciuro on 5/25/12.
// Copyright (c) 2012 Webbo, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "WBAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([WBAppDelegate class]));
}
}