From 85d64a22086ae52c64953c5dbe38526a1a90b943 Mon Sep 17 00:00:00 2001 From: Tito Ciuro Date: Fri, 25 May 2012 17:24:16 -0700 Subject: [PATCH] add iPad demo. --- .../NoticeViewiPad.xcodeproj/project.pbxproj | 317 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../NoticeViewiPad/NoticeViewiPad-Info.plist | 47 +++ .../NoticeViewiPad/NoticeViewiPad-Prefix.pch | 14 + NoticeViewiPad/NoticeViewiPad/WBAppDelegate.h | 15 + NoticeViewiPad/NoticeViewiPad/WBAppDelegate.m | 51 +++ .../NoticeViewiPad/WBDetailViewController.h | 17 + .../NoticeViewiPad/WBDetailViewController.m | 89 +++++ .../NoticeViewiPad/WBMasterViewController.h | 17 + .../NoticeViewiPad/WBMasterViewController.m | 120 +++++++ .../NoticeViewiPad/en.lproj/InfoPlist.strings | 2 + .../en.lproj/MainStoryboard.storyboard | 148 ++++++++ NoticeViewiPad/NoticeViewiPad/main.m | 18 + 13 files changed, 862 insertions(+) create mode 100644 NoticeViewiPad/NoticeViewiPad.xcodeproj/project.pbxproj create mode 100644 NoticeViewiPad/NoticeViewiPad.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 NoticeViewiPad/NoticeViewiPad/NoticeViewiPad-Info.plist create mode 100644 NoticeViewiPad/NoticeViewiPad/NoticeViewiPad-Prefix.pch create mode 100644 NoticeViewiPad/NoticeViewiPad/WBAppDelegate.h create mode 100644 NoticeViewiPad/NoticeViewiPad/WBAppDelegate.m create mode 100644 NoticeViewiPad/NoticeViewiPad/WBDetailViewController.h create mode 100644 NoticeViewiPad/NoticeViewiPad/WBDetailViewController.m create mode 100644 NoticeViewiPad/NoticeViewiPad/WBMasterViewController.h create mode 100644 NoticeViewiPad/NoticeViewiPad/WBMasterViewController.m create mode 100644 NoticeViewiPad/NoticeViewiPad/en.lproj/InfoPlist.strings create mode 100644 NoticeViewiPad/NoticeViewiPad/en.lproj/MainStoryboard.storyboard create mode 100644 NoticeViewiPad/NoticeViewiPad/main.m diff --git a/NoticeViewiPad/NoticeViewiPad.xcodeproj/project.pbxproj b/NoticeViewiPad/NoticeViewiPad.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d15b47b --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad.xcodeproj/project.pbxproj @@ -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 = ""; }; + 7477C2761570573300D0E620 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 7477C2781570573300D0E620 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 7477C27A1570573300D0E620 /* NoticeViewiPad-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NoticeViewiPad-Prefix.pch"; sourceTree = ""; }; + 7477C27B1570573300D0E620 /* WBAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WBAppDelegate.h; sourceTree = ""; }; + 7477C27C1570573300D0E620 /* WBAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WBAppDelegate.m; sourceTree = ""; }; + 7477C27F1570573300D0E620 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; + 7477C2811570573300D0E620 /* WBMasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WBMasterViewController.h; sourceTree = ""; }; + 7477C2821570573300D0E620 /* WBMasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WBMasterViewController.m; sourceTree = ""; }; + 7477C2841570573300D0E620 /* WBDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WBDetailViewController.h; sourceTree = ""; }; + 7477C2851570573300D0E620 /* WBDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WBDetailViewController.m; sourceTree = ""; }; + 74D33BF8157057A000225A76 /* NoticeView.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = NoticeView.bundle; sourceTree = ""; }; + 74D33BF9157057A000225A76 /* UILabel+WBExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+WBExtensions.h"; sourceTree = ""; }; + 74D33BFA157057A000225A76 /* UILabel+WBExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+WBExtensions.m"; sourceTree = ""; }; + 74D33BFB157057A000225A76 /* WBNoticeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WBNoticeView.h; sourceTree = ""; }; + 74D33BFC157057A000225A76 /* WBNoticeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WBNoticeView.m; sourceTree = ""; }; +/* 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 = ""; + }; + 7477C2691570573300D0E620 /* Products */ = { + isa = PBXGroup; + children = ( + 7477C2681570573300D0E620 /* NoticeViewiPad.app */, + ); + name = Products; + sourceTree = ""; + }; + 7477C26B1570573300D0E620 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7477C26C1570573300D0E620 /* UIKit.framework */, + 7477C26E1570573300D0E620 /* Foundation.framework */, + 7477C2701570573300D0E620 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 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 = ""; + }; + 7477C2731570573300D0E620 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 7477C2741570573300D0E620 /* NoticeViewiPad-Info.plist */, + 7477C2751570573300D0E620 /* InfoPlist.strings */, + 7477C2781570573300D0E620 /* main.m */, + 7477C27A1570573300D0E620 /* NoticeViewiPad-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 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 = ""; + }; +/* 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 = ""; + }; + 7477C27E1570573300D0E620 /* MainStoryboard.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 7477C27F1570573300D0E620 /* en */, + ); + name = MainStoryboard.storyboard; + sourceTree = ""; + }; +/* 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 */; +} diff --git a/NoticeViewiPad/NoticeViewiPad.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/NoticeViewiPad/NoticeViewiPad.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..cc63067 --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/NoticeViewiPad/NoticeViewiPad/NoticeViewiPad-Info.plist b/NoticeViewiPad/NoticeViewiPad/NoticeViewiPad-Info.plist new file mode 100644 index 0000000..8bffd75 --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/NoticeViewiPad-Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.webbo.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + MainStoryboard + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/NoticeViewiPad/NoticeViewiPad/NoticeViewiPad-Prefix.pch b/NoticeViewiPad/NoticeViewiPad/NoticeViewiPad-Prefix.pch new file mode 100644 index 0000000..334a924 --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/NoticeViewiPad-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'NoticeViewiPad' target in the 'NoticeViewiPad' project +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/NoticeViewiPad/NoticeViewiPad/WBAppDelegate.h b/NoticeViewiPad/NoticeViewiPad/WBAppDelegate.h new file mode 100644 index 0000000..9655b0a --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/WBAppDelegate.h @@ -0,0 +1,15 @@ +// +// WBAppDelegate.h +// NoticeViewiPad +// +// Created by Tito Ciuro on 5/25/12. +// Copyright (c) 2012 Webbo, LLC. All rights reserved. +// + +#import + +@interface WBAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/NoticeViewiPad/NoticeViewiPad/WBAppDelegate.m b/NoticeViewiPad/NoticeViewiPad/WBAppDelegate.m new file mode 100644 index 0000000..9f5f6b0 --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/WBAppDelegate.m @@ -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 diff --git a/NoticeViewiPad/NoticeViewiPad/WBDetailViewController.h b/NoticeViewiPad/NoticeViewiPad/WBDetailViewController.h new file mode 100644 index 0000000..6fd72d5 --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/WBDetailViewController.h @@ -0,0 +1,17 @@ +// +// WBDetailViewController.h +// NoticeViewiPad +// +// Created by Tito Ciuro on 5/25/12. +// Copyright (c) 2012 Webbo, LLC. All rights reserved. +// + +#import + +@interface WBDetailViewController : UIViewController + +@property (strong, nonatomic) id detailItem; + +- (IBAction)showNotice:(id)sender; + +@end diff --git a/NoticeViewiPad/NoticeViewiPad/WBDetailViewController.m b/NoticeViewiPad/NoticeViewiPad/WBDetailViewController.m new file mode 100644 index 0000000..3fc13f3 --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/WBDetailViewController.m @@ -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 diff --git a/NoticeViewiPad/NoticeViewiPad/WBMasterViewController.h b/NoticeViewiPad/NoticeViewiPad/WBMasterViewController.h new file mode 100644 index 0000000..e322003 --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/WBMasterViewController.h @@ -0,0 +1,17 @@ +// +// WBMasterViewController.h +// NoticeViewiPad +// +// Created by Tito Ciuro on 5/25/12. +// Copyright (c) 2012 Webbo, LLC. All rights reserved. +// + +#import + +@class WBDetailViewController; + +@interface WBMasterViewController : UITableViewController + +@property (strong, nonatomic) WBDetailViewController *detailViewController; + +@end diff --git a/NoticeViewiPad/NoticeViewiPad/WBMasterViewController.m b/NoticeViewiPad/NoticeViewiPad/WBMasterViewController.m new file mode 100644 index 0000000..0424adf --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/WBMasterViewController.m @@ -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 diff --git a/NoticeViewiPad/NoticeViewiPad/en.lproj/InfoPlist.strings b/NoticeViewiPad/NoticeViewiPad/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/NoticeViewiPad/NoticeViewiPad/en.lproj/MainStoryboard.storyboard b/NoticeViewiPad/NoticeViewiPad/en.lproj/MainStoryboard.storyboard new file mode 100644 index 0000000..ae89bdc --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/en.lproj/MainStoryboard.storyboard @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NoticeViewiPad/NoticeViewiPad/main.m b/NoticeViewiPad/NoticeViewiPad/main.m new file mode 100644 index 0000000..db24414 --- /dev/null +++ b/NoticeViewiPad/NoticeViewiPad/main.m @@ -0,0 +1,18 @@ +// +// main.m +// NoticeViewiPad +// +// Created by Tito Ciuro on 5/25/12. +// Copyright (c) 2012 Webbo, LLC. All rights reserved. +// + +#import + +#import "WBAppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([WBAppDelegate class])); + } +}