├── .gitignore ├── AWNotification-Info.plist ├── AWNotification.h ├── AWNotification.m ├── AWNotification.xcodeproj └── project.pbxproj ├── AWNotificationViewController.xib ├── AWNotification_Prefix.pch ├── Classes ├── AWNotificationAppDelegate.h ├── AWNotificationAppDelegate.m ├── AWNotificationViewController.h └── AWNotificationViewController.m ├── MainWindow.xib ├── README.mdown ├── Screenshots ├── FullScreen_Failure.png ├── FullScreen_Normal.png ├── FullScreen_Success.png ├── Pill_Failure.png ├── Pill_Normal.png ├── Pill_Success.png ├── RoundedRect_Failure.png ├── RoundedRect_Normal.png └── RoundedRect_Success.png ├── check.png ├── main.m └── x.png /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | *~.nib 4 | 5 | build/ 6 | 7 | *.pbxuser 8 | *.pbxtree 9 | *.perspective 10 | *.perspectivev3 11 | *.mode1v3 12 | *.mode2v3 13 | 14 | *.xcodeproj/project.xcworkspace/xcuserdata/* 15 | *.xcodeproj/xcuserdata/* 16 | 17 | # if not using Xcode 4: 18 | *.xcodeproj/project.xcworkspace/* 19 | -------------------------------------------------------------------------------- /AWNotification-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /AWNotification.h: -------------------------------------------------------------------------------- 1 | // 2 | // AWNotification.h 3 | // RoundedNotification 4 | // 5 | // Created by Alex Wiltschko on 8/22/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #define kDefaultWidthRoundedCenterLarge 250.0 12 | #define kDefaultHeightRoundedCenterLarge 250.0 13 | #define kDefaultWidthRoundedThin 200.0f 14 | #define kDefaultHeightRoundedThin 40.0 15 | 16 | #define kFontSizePill 16 17 | #define kFontSizeRoundedRect 20 18 | #define kFontSizeFullScreen 18 19 | 20 | #define kDefaultFont @"Helvetica Neue" 21 | 22 | CGRect CGRectMakeCentered(CGRect containingRect, float width, float height); 23 | 24 | 25 | typedef enum { 26 | AWNotificationStyleFullScreen, 27 | AWNotificationStyleRoundedRect, 28 | AWNotificationStylePill 29 | } AWNotificationStyle; 30 | 31 | 32 | 33 | 34 | @interface AWNotification : UIView { 35 | NSString *message; 36 | UILabel *messageLabel; 37 | UIActivityIndicatorView *spinner; 38 | AWNotificationStyle style; 39 | 40 | UIFont *font; 41 | 42 | BOOL willNeedToTurnOffOrientationNotifications; 43 | 44 | } 45 | 46 | @property (nonatomic, retain, setter=setMessage:) NSString *message; 47 | 48 | - (void)setMessage; 49 | - (id)initWithNotificationStyle:(AWNotificationStyle)style; 50 | - (void)show; 51 | - (void)hide; 52 | - (void)hideWithMessage:(NSString *)finalMessage; // use if you want to display a goodbye message, like "Success!" or "Upload complete!" 53 | - (void)hideWithSuccessMessage:(NSString *)finalMessage; 54 | - (void)hideWithFailureMessage:(NSString *)finalMessage; 55 | - (void)rotate; 56 | @end 57 | -------------------------------------------------------------------------------- /AWNotification.m: -------------------------------------------------------------------------------- 1 | // 2 | // AWNotification.m 3 | // RoundedNotification 4 | // 5 | // Created by Alex Wiltschko on 8/22/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AWNotification.h" 10 | 11 | @implementation AWNotification 12 | @synthesize message; 13 | 14 | - (void)dealloc 15 | { 16 | if (willNeedToTurnOffOrientationNotifications) { 17 | [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; 18 | } 19 | 20 | [font release]; 21 | [super dealloc]; 22 | } 23 | 24 | - (id)initWithNotificationStyle:(AWNotificationStyle)newStyle { 25 | 26 | CGRect frame; 27 | style = newStyle; 28 | 29 | self.userInteractionEnabled = NO; 30 | 31 | switch (style) { 32 | case AWNotificationStyleFullScreen: 33 | 34 | frame = [[UIScreen mainScreen] bounds]; 35 | font = [UIFont fontWithName:kDefaultFont size:kFontSizeFullScreen]; 36 | 37 | if (self = [super initWithFrame:frame]) { 38 | 39 | self.backgroundColor = [UIColor colorWithWhite:0.3 alpha:0.75]; 40 | self.alpha = 1.0; 41 | 42 | CGRect labelFrame = CGRectMakeCentered(frame, frame.size.width*0.75, frame.size.height*0.4); 43 | labelFrame.origin.y += 85.0f; 44 | messageLabel = [[UILabel alloc] initWithFrame:labelFrame]; 45 | messageLabel.text = @"Hold on..."; 46 | messageLabel.font = font; 47 | messageLabel.textColor = [UIColor colorWithWhite:0.8 alpha:1.0]; 48 | messageLabel.numberOfLines = 3; 49 | messageLabel.backgroundColor = [UIColor clearColor]; 50 | messageLabel.textAlignment = UITextAlignmentCenter; 51 | [messageLabel setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin | 52 | UIViewAutoresizingFlexibleLeftMargin | 53 | UIViewAutoresizingFlexibleTopMargin | 54 | UIViewAutoresizingFlexibleBottomMargin ]; 55 | 56 | [self addSubview:messageLabel]; 57 | 58 | spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; 59 | [spinner setCenter:CGPointMake(frame.size.width/2.0f, frame.size.height/2.0)]; 60 | [spinner setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin | 61 | UIViewAutoresizingFlexibleLeftMargin | 62 | UIViewAutoresizingFlexibleTopMargin | 63 | UIViewAutoresizingFlexibleBottomMargin]; 64 | 65 | [self addSubview:spinner]; 66 | 67 | [self setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin | 68 | UIViewAutoresizingFlexibleLeftMargin | 69 | UIViewAutoresizingFlexibleTopMargin | 70 | UIViewAutoresizingFlexibleBottomMargin | 71 | UIViewAutoresizingFlexibleWidth | 72 | UIViewAutoresizingFlexibleHeight ]; 73 | 74 | 75 | } 76 | 77 | break; 78 | case AWNotificationStyleRoundedRect: 79 | 80 | frame = CGRectMakeCentered([[UIScreen mainScreen] bounds], kDefaultWidthRoundedCenterLarge, kDefaultHeightRoundedCenterLarge); 81 | font = [UIFont fontWithName:kDefaultFont size:kFontSizeRoundedRect]; 82 | 83 | if (self = [super initWithFrame:frame]) { 84 | 85 | self.backgroundColor = [UIColor clearColor]; 86 | 87 | self.layer.cornerRadius = 20; 88 | self.layer.backgroundColor = [[UIColor colorWithWhite:0 alpha:0.85] CGColor]; 89 | self.layer.opacity = 0.5; 90 | 91 | CGRect labelFrame = CGRectMakeCentered(frame, frame.size.width*0.85, frame.size.height*0.3); 92 | labelFrame.origin.y = frame.size.height*0.75; 93 | 94 | messageLabel = [[UILabel alloc] initWithFrame:labelFrame]; 95 | messageLabel.text = @"Hold on..."; 96 | messageLabel.font = font; 97 | messageLabel.textColor = [UIColor whiteColor]; 98 | messageLabel.numberOfLines = 3; 99 | messageLabel.backgroundColor = [UIColor clearColor]; 100 | messageLabel.textAlignment = UITextAlignmentCenter; 101 | [messageLabel setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin]; 102 | 103 | [self addSubview:messageLabel]; 104 | 105 | spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; 106 | [spinner setCenter:CGPointMake(frame.size.width/2.0f, frame.size.height/2.0f)]; 107 | [spinner setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleTopMargin]; 108 | 109 | [self addSubview:spinner]; 110 | 111 | [self setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin | 112 | UIViewAutoresizingFlexibleLeftMargin | 113 | UIViewAutoresizingFlexibleTopMargin | 114 | UIViewAutoresizingFlexibleBottomMargin]; 115 | 116 | 117 | } 118 | 119 | break; 120 | 121 | 122 | 123 | case AWNotificationStylePill: 124 | 125 | frame = CGRectMakeCentered([[UIScreen mainScreen] bounds], kDefaultWidthRoundedThin, kDefaultHeightRoundedThin); 126 | font = [UIFont fontWithName:kDefaultFont size:kFontSizePill]; 127 | 128 | if (self = [super initWithFrame:frame]) { 129 | 130 | self.backgroundColor = [UIColor clearColor]; 131 | 132 | self.layer.cornerRadius = 20; 133 | self.layer.backgroundColor = [[UIColor colorWithWhite:0.2 alpha:0.85] CGColor]; 134 | self.layer.opacity = 0.5; 135 | 136 | float xOffset = 45.0f; 137 | float fontsize = kFontSizePill; 138 | CGRect labelFrame = CGRectMake(xOffset, frame.size.height/2.0 - fontsize/2.0, kDefaultWidthRoundedThin - xOffset, frame.size.height/2.0); 139 | messageLabel = [[UILabel alloc] initWithFrame:labelFrame]; 140 | messageLabel.text = @"Hold on..."; 141 | messageLabel.font = font; 142 | messageLabel.textColor = [UIColor whiteColor]; 143 | messageLabel.numberOfLines = 1; 144 | messageLabel.backgroundColor = [UIColor clearColor]; 145 | messageLabel.textAlignment = UITextAlignmentLeft; 146 | messageLabel.lineBreakMode = UILineBreakModeClip; 147 | messageLabel.baselineAdjustment = UIBaselineAdjustmentAlignBaselines; 148 | [messageLabel setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleRightMargin]; 149 | 150 | [self addSubview:messageLabel]; 151 | 152 | spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; 153 | [spinner setCenter:CGPointMake(22.0, frame.size.height/2.0)]; 154 | [spinner setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin]; 155 | 156 | 157 | [self addSubview:spinner]; 158 | 159 | [self setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin | 160 | UIViewAutoresizingFlexibleLeftMargin | 161 | UIViewAutoresizingFlexibleTopMargin | 162 | UIViewAutoresizingFlexibleBottomMargin]; 163 | 164 | 165 | 166 | } 167 | 168 | break; 169 | 170 | } 171 | 172 | self.autoresizesSubviews = YES; 173 | self.hidden = YES; 174 | 175 | 176 | return self; 177 | } 178 | 179 | - (void)setMessage:(NSString *)newMessage 180 | { 181 | 182 | message = newMessage; 183 | messageLabel.text = message; 184 | 185 | if (style == AWNotificationStylePill) { // then we're going to resize the message box 186 | 187 | CGSize newLabelSize = [message sizeWithFont:messageLabel.font]; 188 | CGRect newFrame = CGRectMakeCentered([[UIScreen mainScreen] bounds], 189 | newLabelSize.width + messageLabel.frame.origin.x + 20.0, 190 | kDefaultHeightRoundedThin); 191 | 192 | 193 | [UIView animateWithDuration:0.25 194 | delay:0.0 195 | options:UIViewAnimationCurveEaseInOut 196 | animations:^{ 197 | self.frame = newFrame; 198 | } 199 | completion:^(BOOL done){ 200 | 201 | } ]; 202 | } 203 | 204 | 205 | } 206 | 207 | - (void)show 208 | 209 | { 210 | 211 | [self rotate]; 212 | 213 | self.hidden = NO; 214 | float destAlpha = self.alpha; 215 | self.alpha = 0.0; 216 | 217 | [[[[UIApplication sharedApplication] windows] objectAtIndex:0] addSubview:self]; 218 | [[[[UIApplication sharedApplication] windows] objectAtIndex:0] bringSubviewToFront:self]; 219 | 220 | 221 | [UIView animateWithDuration:0.5 222 | delay:0.0 223 | options:UIViewAnimationCurveEaseInOut 224 | animations:^{ 225 | self.alpha = destAlpha; 226 | } 227 | completion:^(BOOL done){ 228 | 229 | }]; 230 | 231 | if (![[UIDevice currentDevice] isGeneratingDeviceOrientationNotifications]) { 232 | [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; 233 | willNeedToTurnOffOrientationNotifications = YES; 234 | } 235 | 236 | [[NSNotificationCenter defaultCenter] addObserver:self 237 | selector:@selector(rotate) 238 | name:@"UIDeviceOrientationDidChangeNotification" 239 | object:nil]; 240 | 241 | 242 | 243 | } 244 | 245 | - (void)rotate 246 | { 247 | 248 | 249 | 250 | UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; 251 | if (orientation == UIDeviceOrientationFaceUp || orientation == UIDeviceOrientationFaceDown) 252 | return; 253 | 254 | CGAffineTransform transform; 255 | 256 | 257 | 258 | if (UIDeviceOrientationIsLandscape(orientation)) { 259 | switch (orientation) { 260 | case UIDeviceOrientationLandscapeLeft: 261 | transform = CGAffineTransformRotate(CGAffineTransformIdentity, M_PI / 2.0); 262 | break; 263 | case UIDeviceOrientationLandscapeRight: 264 | transform = CGAffineTransformRotate(CGAffineTransformIdentity, -M_PI / 2.0); 265 | break; 266 | default: 267 | transform = CGAffineTransformIdentity; 268 | } 269 | } 270 | 271 | else { 272 | switch (orientation) { 273 | case UIDeviceOrientationPortrait: 274 | transform = CGAffineTransformIdentity; 275 | break; 276 | 277 | case UIDeviceOrientationPortraitUpsideDown: 278 | transform = CGAffineTransformRotate(CGAffineTransformIdentity, M_PI); 279 | break; 280 | default: 281 | transform = CGAffineTransformIdentity; 282 | } 283 | } 284 | 285 | self.transform = transform; 286 | 287 | if (style == AWNotificationStyleFullScreen) { 288 | if (UIDeviceOrientationIsPortrait(orientation)) { 289 | self.frame = [[UIScreen mainScreen] bounds]; 290 | } 291 | else if (UIDeviceOrientationIsLandscape(orientation)) { 292 | CGRect newFrame = [[UIScreen mainScreen] bounds]; 293 | float newheight = newFrame.size.width; 294 | // newFrame.size.width = newFrame.size.height; 295 | // newFrame.size.height = newheight; 296 | newFrame.origin.x = 0; 297 | newFrame.origin.y = 0; 298 | self.frame = newFrame; 299 | 300 | } 301 | } 302 | 303 | 304 | } 305 | 306 | 307 | - (void)hide 308 | { 309 | 310 | [UIView animateWithDuration:0.5 311 | delay:0.0 312 | options:UIViewAnimationCurveEaseInOut 313 | animations:^{ 314 | self.alpha = 0.0; 315 | } 316 | completion:^(BOOL done){ 317 | self.hidden = YES; 318 | [self removeFromSuperview]; 319 | }]; 320 | 321 | } 322 | 323 | - (void)hideWithMessage:(NSString *)finalMessage 324 | { 325 | self.message = finalMessage; 326 | messageLabel.textColor = [UIColor whiteColor]; 327 | 328 | [UIView animateWithDuration:0.75 329 | delay:1.25 330 | options:UIViewAnimationCurveEaseInOut 331 | animations:^{ 332 | self.alpha = 0.0; 333 | 334 | } 335 | completion:^(BOOL done){ 336 | self.hidden = YES; 337 | [self removeFromSuperview]; 338 | }]; 339 | 340 | } 341 | 342 | - (void)hideWithSuccessMessage:(NSString *)finalMessage 343 | { 344 | // Stop the spinner and add a checkmark 345 | [spinner stopAnimating]; 346 | UIImageView *checkImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"check.png"]]; 347 | checkImageView.frame = spinner.frame; 348 | [self addSubview:checkImageView]; 349 | [checkImageView release]; 350 | 351 | [self hideWithMessage:finalMessage]; 352 | } 353 | 354 | - (void)hideWithFailureMessage:(NSString *)finalMessage 355 | { 356 | // Stop the spinner and add an "x" image 357 | [spinner stopAnimating]; 358 | UIImageView *xImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"x.png"]]; 359 | xImageView.frame = spinner.frame; 360 | [self addSubview:xImageView]; 361 | [xImageView release]; 362 | 363 | [self hideWithMessage:finalMessage]; 364 | } 365 | 366 | 367 | // Only override drawRect: if you perform custom drawing. 368 | // An empty implementation adversely affects performance during animation. 369 | - (void)drawRect:(CGRect)rect { 370 | [spinner startAnimating]; 371 | messageLabel.text = message; 372 | } 373 | 374 | 375 | CGRect CGRectMakeCentered(CGRect containingRect, float width, float height) 376 | { 377 | float x = containingRect.size.width/2.0 - width/2.0; 378 | float y = containingRect.size.height/2.0 - height/2.0; 379 | 380 | return CGRectMake(x, y, width, height); 381 | 382 | } 383 | 384 | 385 | 386 | 387 | @end 388 | -------------------------------------------------------------------------------- /AWNotification.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* AWNotificationAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AWNotificationAppDelegate.m */; }; 11 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 12 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 13 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 14 | 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; 15 | 2899E5220DE3E06400AC0155 /* AWNotificationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* AWNotificationViewController.xib */; }; 16 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 17 | 28D7ACF80DDB3853001CB0EB /* AWNotificationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* AWNotificationViewController.m */; }; 18 | FA3265D012270BA400D0B36D /* AWNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3265CF12270BA400D0B36D /* AWNotification.m */; }; 19 | FABE3E791225668B00BCE045 /* check.png in Resources */ = {isa = PBXBuildFile; fileRef = FABE3E771225668B00BCE045 /* check.png */; }; 20 | FABE3E7A1225668B00BCE045 /* x.png in Resources */ = {isa = PBXBuildFile; fileRef = FABE3E781225668B00BCE045 /* x.png */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 25 | 1D3623240D0F684500981E51 /* AWNotificationAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AWNotificationAppDelegate.h; sourceTree = ""; }; 26 | 1D3623250D0F684500981E51 /* AWNotificationAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AWNotificationAppDelegate.m; sourceTree = ""; }; 27 | 1D6058910D05DD3D006BFB54 /* AWNotification.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AWNotification.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 29 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 30 | 2899E5210DE3E06400AC0155 /* AWNotificationViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AWNotificationViewController.xib; sourceTree = ""; }; 31 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 32 | 28D7ACF60DDB3853001CB0EB /* AWNotificationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AWNotificationViewController.h; sourceTree = ""; }; 33 | 28D7ACF70DDB3853001CB0EB /* AWNotificationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AWNotificationViewController.m; sourceTree = ""; }; 34 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | 32CA4F630368D1EE00C91783 /* AWNotification_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AWNotification_Prefix.pch; sourceTree = ""; }; 36 | 8D1107310486CEB800E47090 /* AWNotification-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "AWNotification-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 37 | FA3265CE12270BA400D0B36D /* AWNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AWNotification.h; sourceTree = SOURCE_ROOT; }; 38 | FA3265CF12270BA400D0B36D /* AWNotification.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AWNotification.m; sourceTree = SOURCE_ROOT; }; 39 | FABE3E771225668B00BCE045 /* check.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = check.png; sourceTree = ""; }; 40 | FABE3E781225668B00BCE045 /* x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = x.png; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 49 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 50 | 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | /* End PBXFrameworksBuildPhase section */ 55 | 56 | /* Begin PBXGroup section */ 57 | 080E96DDFE201D6D7F000001 /* Classes */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | FA3265CE12270BA400D0B36D /* AWNotification.h */, 61 | FA3265CF12270BA400D0B36D /* AWNotification.m */, 62 | 1D3623240D0F684500981E51 /* AWNotificationAppDelegate.h */, 63 | 1D3623250D0F684500981E51 /* AWNotificationAppDelegate.m */, 64 | 28D7ACF60DDB3853001CB0EB /* AWNotificationViewController.h */, 65 | 28D7ACF70DDB3853001CB0EB /* AWNotificationViewController.m */, 66 | ); 67 | path = Classes; 68 | sourceTree = ""; 69 | }; 70 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 1D6058910D05DD3D006BFB54 /* AWNotification.app */, 74 | ); 75 | name = Products; 76 | sourceTree = ""; 77 | }; 78 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 080E96DDFE201D6D7F000001 /* Classes */, 82 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 83 | 29B97317FDCFA39411CA2CEA /* Resources */, 84 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 85 | 19C28FACFE9D520D11CA2CBB /* Products */, 86 | ); 87 | name = CustomTemplate; 88 | sourceTree = ""; 89 | }; 90 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | FABE3E771225668B00BCE045 /* check.png */, 94 | FABE3E781225668B00BCE045 /* x.png */, 95 | 32CA4F630368D1EE00C91783 /* AWNotification_Prefix.pch */, 96 | 29B97316FDCFA39411CA2CEA /* main.m */, 97 | ); 98 | name = "Other Sources"; 99 | sourceTree = ""; 100 | }; 101 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 2899E5210DE3E06400AC0155 /* AWNotificationViewController.xib */, 105 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 106 | 8D1107310486CEB800E47090 /* AWNotification-Info.plist */, 107 | ); 108 | name = Resources; 109 | sourceTree = ""; 110 | }; 111 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 115 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 116 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */, 117 | ); 118 | name = Frameworks; 119 | sourceTree = ""; 120 | }; 121 | /* End PBXGroup section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | 1D6058900D05DD3D006BFB54 /* AWNotification */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AWNotification" */; 127 | buildPhases = ( 128 | 1D60588D0D05DD3D006BFB54 /* Resources */, 129 | 1D60588E0D05DD3D006BFB54 /* Sources */, 130 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 131 | ); 132 | buildRules = ( 133 | ); 134 | dependencies = ( 135 | ); 136 | name = AWNotification; 137 | productName = AWNotification; 138 | productReference = 1D6058910D05DD3D006BFB54 /* AWNotification.app */; 139 | productType = "com.apple.product-type.application"; 140 | }; 141 | /* End PBXNativeTarget section */ 142 | 143 | /* Begin PBXProject section */ 144 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 145 | isa = PBXProject; 146 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AWNotification" */; 147 | compatibilityVersion = "Xcode 3.1"; 148 | hasScannedForEncodings = 1; 149 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 150 | projectDirPath = ""; 151 | projectRoot = ""; 152 | targets = ( 153 | 1D6058900D05DD3D006BFB54 /* AWNotification */, 154 | ); 155 | }; 156 | /* End PBXProject section */ 157 | 158 | /* Begin PBXResourcesBuildPhase section */ 159 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 160 | isa = PBXResourcesBuildPhase; 161 | buildActionMask = 2147483647; 162 | files = ( 163 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, 164 | 2899E5220DE3E06400AC0155 /* AWNotificationViewController.xib in Resources */, 165 | FABE3E791225668B00BCE045 /* check.png in Resources */, 166 | FABE3E7A1225668B00BCE045 /* x.png in Resources */, 167 | ); 168 | runOnlyForDeploymentPostprocessing = 0; 169 | }; 170 | /* End PBXResourcesBuildPhase section */ 171 | 172 | /* Begin PBXSourcesBuildPhase section */ 173 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 174 | isa = PBXSourcesBuildPhase; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 178 | 1D3623260D0F684500981E51 /* AWNotificationAppDelegate.m in Sources */, 179 | 28D7ACF80DDB3853001CB0EB /* AWNotificationViewController.m in Sources */, 180 | FA3265D012270BA400D0B36D /* AWNotification.m in Sources */, 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | /* End PBXSourcesBuildPhase section */ 185 | 186 | /* Begin XCBuildConfiguration section */ 187 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 188 | isa = XCBuildConfiguration; 189 | buildSettings = { 190 | ALWAYS_SEARCH_USER_PATHS = NO; 191 | COPY_PHASE_STRIP = NO; 192 | GCC_DYNAMIC_NO_PIC = NO; 193 | GCC_OPTIMIZATION_LEVEL = 0; 194 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 195 | GCC_PREFIX_HEADER = AWNotification_Prefix.pch; 196 | INFOPLIST_FILE = "AWNotification-Info.plist"; 197 | PRODUCT_NAME = AWNotification; 198 | }; 199 | name = Debug; 200 | }; 201 | 1D6058950D05DD3E006BFB54 /* Release */ = { 202 | isa = XCBuildConfiguration; 203 | buildSettings = { 204 | ALWAYS_SEARCH_USER_PATHS = NO; 205 | COPY_PHASE_STRIP = YES; 206 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 207 | GCC_PREFIX_HEADER = AWNotification_Prefix.pch; 208 | INFOPLIST_FILE = "AWNotification-Info.plist"; 209 | PRODUCT_NAME = AWNotification; 210 | VALIDATE_PRODUCT = YES; 211 | }; 212 | name = Release; 213 | }; 214 | C01FCF4F08A954540054247B /* Debug */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 218 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 219 | GCC_C_LANGUAGE_STANDARD = c99; 220 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 221 | GCC_WARN_UNUSED_VARIABLE = YES; 222 | PREBINDING = NO; 223 | SDKROOT = iphoneos4.0; 224 | }; 225 | name = Debug; 226 | }; 227 | C01FCF5008A954540054247B /* Release */ = { 228 | isa = XCBuildConfiguration; 229 | buildSettings = { 230 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 231 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 232 | GCC_C_LANGUAGE_STANDARD = c99; 233 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 234 | GCC_WARN_UNUSED_VARIABLE = YES; 235 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 236 | PREBINDING = NO; 237 | SDKROOT = iphoneos4.0; 238 | }; 239 | name = Release; 240 | }; 241 | /* End XCBuildConfiguration section */ 242 | 243 | /* Begin XCConfigurationList section */ 244 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AWNotification" */ = { 245 | isa = XCConfigurationList; 246 | buildConfigurations = ( 247 | 1D6058940D05DD3E006BFB54 /* Debug */, 248 | 1D6058950D05DD3E006BFB54 /* Release */, 249 | ); 250 | defaultConfigurationIsVisible = 0; 251 | defaultConfigurationName = Release; 252 | }; 253 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AWNotification" */ = { 254 | isa = XCConfigurationList; 255 | buildConfigurations = ( 256 | C01FCF4F08A954540054247B /* Debug */, 257 | C01FCF5008A954540054247B /* Release */, 258 | ); 259 | defaultConfigurationIsVisible = 0; 260 | defaultConfigurationName = Release; 261 | }; 262 | /* End XCConfigurationList section */ 263 | }; 264 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 265 | } 266 | -------------------------------------------------------------------------------- /AWNotificationViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10F569 6 | 788 7 | 1038.29 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 117 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | {320, 460} 44 | 45 | 46 | 1 47 | MC4yMjk1OTE4MzY3IDAuMjI5NTkxODM2NyAwLjIyOTU5MTgzNjcAA 48 | 49 | NO 50 | 51 | IBCocoaTouchFramework 52 | 53 | 54 | 55 | 56 | YES 57 | 58 | 59 | view 60 | 61 | 62 | 63 | 7 64 | 65 | 66 | 67 | 68 | YES 69 | 70 | 0 71 | 72 | 73 | 74 | 75 | 76 | -1 77 | 78 | 79 | File's Owner 80 | 81 | 82 | -2 83 | 84 | 85 | 86 | 87 | 6 88 | 89 | 90 | 91 | 92 | 93 | 94 | YES 95 | 96 | YES 97 | -1.CustomClassName 98 | -2.CustomClassName 99 | 6.IBEditorWindowLastContentRect 100 | 6.IBPluginDependency 101 | 102 | 103 | YES 104 | AWNotificationViewController 105 | UIResponder 106 | {{239, 526}, {320, 480}} 107 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 108 | 109 | 110 | 111 | YES 112 | 113 | 114 | YES 115 | 116 | 117 | 118 | 119 | YES 120 | 121 | 122 | YES 123 | 124 | 125 | 126 | 7 127 | 128 | 129 | 130 | YES 131 | 132 | AWNotificationViewController 133 | UIViewController 134 | 135 | IBProjectSource 136 | Classes/AWNotificationViewController.h 137 | 138 | 139 | 140 | 141 | YES 142 | 143 | NSObject 144 | 145 | IBFrameworkSource 146 | Foundation.framework/Headers/NSError.h 147 | 148 | 149 | 150 | NSObject 151 | 152 | IBFrameworkSource 153 | Foundation.framework/Headers/NSFileManager.h 154 | 155 | 156 | 157 | NSObject 158 | 159 | IBFrameworkSource 160 | Foundation.framework/Headers/NSKeyValueCoding.h 161 | 162 | 163 | 164 | NSObject 165 | 166 | IBFrameworkSource 167 | Foundation.framework/Headers/NSKeyValueObserving.h 168 | 169 | 170 | 171 | NSObject 172 | 173 | IBFrameworkSource 174 | Foundation.framework/Headers/NSKeyedArchiver.h 175 | 176 | 177 | 178 | NSObject 179 | 180 | IBFrameworkSource 181 | Foundation.framework/Headers/NSObject.h 182 | 183 | 184 | 185 | NSObject 186 | 187 | IBFrameworkSource 188 | Foundation.framework/Headers/NSRunLoop.h 189 | 190 | 191 | 192 | NSObject 193 | 194 | IBFrameworkSource 195 | Foundation.framework/Headers/NSThread.h 196 | 197 | 198 | 199 | NSObject 200 | 201 | IBFrameworkSource 202 | Foundation.framework/Headers/NSURL.h 203 | 204 | 205 | 206 | NSObject 207 | 208 | IBFrameworkSource 209 | Foundation.framework/Headers/NSURLConnection.h 210 | 211 | 212 | 213 | NSObject 214 | 215 | IBFrameworkSource 216 | UIKit.framework/Headers/UIAccessibility.h 217 | 218 | 219 | 220 | NSObject 221 | 222 | IBFrameworkSource 223 | UIKit.framework/Headers/UINibLoading.h 224 | 225 | 226 | 227 | NSObject 228 | 229 | IBFrameworkSource 230 | UIKit.framework/Headers/UIResponder.h 231 | 232 | 233 | 234 | UIResponder 235 | NSObject 236 | 237 | 238 | 239 | UISearchBar 240 | UIView 241 | 242 | IBFrameworkSource 243 | UIKit.framework/Headers/UISearchBar.h 244 | 245 | 246 | 247 | UISearchDisplayController 248 | NSObject 249 | 250 | IBFrameworkSource 251 | UIKit.framework/Headers/UISearchDisplayController.h 252 | 253 | 254 | 255 | UIView 256 | 257 | IBFrameworkSource 258 | UIKit.framework/Headers/UITextField.h 259 | 260 | 261 | 262 | UIView 263 | UIResponder 264 | 265 | IBFrameworkSource 266 | UIKit.framework/Headers/UIView.h 267 | 268 | 269 | 270 | UIViewController 271 | 272 | IBFrameworkSource 273 | UIKit.framework/Headers/UINavigationController.h 274 | 275 | 276 | 277 | UIViewController 278 | 279 | IBFrameworkSource 280 | UIKit.framework/Headers/UIPopoverController.h 281 | 282 | 283 | 284 | UIViewController 285 | 286 | IBFrameworkSource 287 | UIKit.framework/Headers/UISplitViewController.h 288 | 289 | 290 | 291 | UIViewController 292 | 293 | IBFrameworkSource 294 | UIKit.framework/Headers/UITabBarController.h 295 | 296 | 297 | 298 | UIViewController 299 | UIResponder 300 | 301 | IBFrameworkSource 302 | UIKit.framework/Headers/UIViewController.h 303 | 304 | 305 | 306 | 307 | 0 308 | IBCocoaTouchFramework 309 | 310 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 311 | 312 | 313 | 314 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 315 | 316 | 317 | YES 318 | AWNotification.xcodeproj 319 | 3 320 | 117 321 | 322 | 323 | -------------------------------------------------------------------------------- /AWNotification_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'AWNotification' target in the 'AWNotification' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Classes/AWNotificationAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AWNotificationAppDelegate.h 3 | // AWNotification 4 | // 5 | // Copyright (c) 2010 Alex Wiltschko 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import 27 | 28 | @class AWNotificationViewController; 29 | 30 | @interface AWNotificationAppDelegate : NSObject { 31 | UIWindow *window; 32 | AWNotificationViewController *viewController; 33 | } 34 | 35 | @property (nonatomic, retain) IBOutlet UIWindow *window; 36 | @property (nonatomic, retain) IBOutlet AWNotificationViewController *viewController; 37 | 38 | @end 39 | 40 | -------------------------------------------------------------------------------- /Classes/AWNotificationAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AWNotificationAppDelegate.m 3 | // AWNotification 4 | // 5 | // Copyright (c) 2010 Alex Wiltschko 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import "AWNotificationAppDelegate.h" 27 | #import "AWNotificationViewController.h" 28 | 29 | @implementation AWNotificationAppDelegate 30 | 31 | @synthesize window; 32 | @synthesize viewController; 33 | 34 | 35 | #pragma mark - 36 | #pragma mark Application lifecycle 37 | 38 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 39 | 40 | // Override point for customization after application launch. 41 | 42 | // Add the view controller's view to the window and display. 43 | [window addSubview:viewController.view]; 44 | [window makeKeyAndVisible]; 45 | 46 | return YES; 47 | } 48 | 49 | 50 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 51 | { 52 | return YES; 53 | } 54 | 55 | - (void)dealloc { 56 | [viewController release]; 57 | [window release]; 58 | [super dealloc]; 59 | } 60 | 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Classes/AWNotificationViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AWNotificationViewController.h 3 | // AWNotification 4 | // 5 | // Copyright (c) 2010 Alex Wiltschko 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import 27 | #import "AWNotification.h" 28 | 29 | @interface AWNotificationViewController : UIViewController { 30 | AWNotification *notification; 31 | } 32 | 33 | @end 34 | 35 | -------------------------------------------------------------------------------- /Classes/AWNotificationViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AWNotificationViewController.m 3 | // AWNotification 4 | // 5 | // Copyright (c) 2010 Alex Wiltschko 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import "AWNotificationViewController.h" 27 | 28 | @implementation AWNotificationViewController 29 | 30 | 31 | - (void)viewDidAppear:(BOOL)animated 32 | { 33 | [super viewDidAppear:animated]; 34 | 35 | notification = [[AWNotification alloc] initWithNotificationStyle:AWNotificationStyleFullScreen]; 36 | notification.message = @"Trying really hard..."; 37 | 38 | } 39 | 40 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 41 | { 42 | return YES; 43 | } 44 | 45 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 46 | { 47 | 48 | static BOOL didStartNotification = NO; 49 | 50 | if (!didStartNotification) { 51 | [notification show]; 52 | didStartNotification = YES; 53 | } 54 | else { 55 | [notification hideWithSuccessMessage:@"Congrats!"]; 56 | } 57 | } 58 | 59 | - (void)dealloc { 60 | [super dealloc]; 61 | [notification release]; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D571 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | AWNotificationViewController 45 | 46 | 47 | 1 48 | 49 | IBCocoaTouchFramework 50 | NO 51 | 52 | 53 | 54 | 292 55 | {320, 480} 56 | 57 | 1 58 | MSAxIDEAA 59 | 60 | NO 61 | NO 62 | 63 | IBCocoaTouchFramework 64 | YES 65 | 66 | 67 | 68 | 69 | YES 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 4 77 | 78 | 79 | 80 | viewController 81 | 82 | 83 | 84 | 11 85 | 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 14 93 | 94 | 95 | 96 | 97 | YES 98 | 99 | 0 100 | 101 | 102 | 103 | 104 | 105 | -1 106 | 107 | 108 | File's Owner 109 | 110 | 111 | 3 112 | 113 | 114 | AWNotification App Delegate 115 | 116 | 117 | -2 118 | 119 | 120 | 121 | 122 | 10 123 | 124 | 125 | 126 | 127 | 12 128 | 129 | 130 | 131 | 132 | 133 | 134 | YES 135 | 136 | YES 137 | -1.CustomClassName 138 | -2.CustomClassName 139 | 10.CustomClassName 140 | 10.IBEditorWindowLastContentRect 141 | 10.IBPluginDependency 142 | 12.IBEditorWindowLastContentRect 143 | 12.IBPluginDependency 144 | 3.CustomClassName 145 | 3.IBPluginDependency 146 | 147 | 148 | YES 149 | UIApplication 150 | UIResponder 151 | AWNotificationViewController 152 | {{234, 376}, {320, 480}} 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | {{525, 346}, {320, 480}} 155 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 156 | AWNotificationAppDelegate 157 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 158 | 159 | 160 | 161 | YES 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 169 | YES 170 | 171 | 172 | YES 173 | 174 | 175 | 176 | 15 177 | 178 | 179 | 180 | YES 181 | 182 | UIWindow 183 | UIView 184 | 185 | IBUserSource 186 | 187 | 188 | 189 | 190 | AWNotificationAppDelegate 191 | NSObject 192 | 193 | YES 194 | 195 | YES 196 | viewController 197 | window 198 | 199 | 200 | YES 201 | AWNotificationViewController 202 | UIWindow 203 | 204 | 205 | 206 | YES 207 | 208 | YES 209 | viewController 210 | window 211 | 212 | 213 | YES 214 | 215 | viewController 216 | AWNotificationViewController 217 | 218 | 219 | window 220 | UIWindow 221 | 222 | 223 | 224 | 225 | IBProjectSource 226 | Classes/AWNotificationAppDelegate.h 227 | 228 | 229 | 230 | AWNotificationAppDelegate 231 | NSObject 232 | 233 | IBUserSource 234 | 235 | 236 | 237 | 238 | AWNotificationViewController 239 | UIViewController 240 | 241 | IBProjectSource 242 | Classes/AWNotificationViewController.h 243 | 244 | 245 | 246 | 247 | YES 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSError.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSFileManager.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | Foundation.framework/Headers/NSKeyValueCoding.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | Foundation.framework/Headers/NSKeyValueObserving.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | Foundation.framework/Headers/NSKeyedArchiver.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | Foundation.framework/Headers/NSObject.h 288 | 289 | 290 | 291 | NSObject 292 | 293 | IBFrameworkSource 294 | Foundation.framework/Headers/NSRunLoop.h 295 | 296 | 297 | 298 | NSObject 299 | 300 | IBFrameworkSource 301 | Foundation.framework/Headers/NSThread.h 302 | 303 | 304 | 305 | NSObject 306 | 307 | IBFrameworkSource 308 | Foundation.framework/Headers/NSURL.h 309 | 310 | 311 | 312 | NSObject 313 | 314 | IBFrameworkSource 315 | Foundation.framework/Headers/NSURLConnection.h 316 | 317 | 318 | 319 | NSObject 320 | 321 | IBFrameworkSource 322 | UIKit.framework/Headers/UIAccessibility.h 323 | 324 | 325 | 326 | NSObject 327 | 328 | IBFrameworkSource 329 | UIKit.framework/Headers/UINibLoading.h 330 | 331 | 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UIResponder.h 337 | 338 | 339 | 340 | UIApplication 341 | UIResponder 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UIApplication.h 345 | 346 | 347 | 348 | UIResponder 349 | NSObject 350 | 351 | 352 | 353 | UISearchBar 354 | UIView 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UISearchBar.h 358 | 359 | 360 | 361 | UISearchDisplayController 362 | NSObject 363 | 364 | IBFrameworkSource 365 | UIKit.framework/Headers/UISearchDisplayController.h 366 | 367 | 368 | 369 | UIView 370 | 371 | IBFrameworkSource 372 | UIKit.framework/Headers/UITextField.h 373 | 374 | 375 | 376 | UIView 377 | UIResponder 378 | 379 | IBFrameworkSource 380 | UIKit.framework/Headers/UIView.h 381 | 382 | 383 | 384 | UIViewController 385 | 386 | IBFrameworkSource 387 | UIKit.framework/Headers/UINavigationController.h 388 | 389 | 390 | 391 | UIViewController 392 | 393 | IBFrameworkSource 394 | UIKit.framework/Headers/UIPopoverController.h 395 | 396 | 397 | 398 | UIViewController 399 | 400 | IBFrameworkSource 401 | UIKit.framework/Headers/UISplitViewController.h 402 | 403 | 404 | 405 | UIViewController 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UITabBarController.h 409 | 410 | 411 | 412 | UIViewController 413 | UIResponder 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIViewController.h 417 | 418 | 419 | 420 | UIWindow 421 | UIView 422 | 423 | IBFrameworkSource 424 | UIKit.framework/Headers/UIWindow.h 425 | 426 | 427 | 428 | 429 | 0 430 | IBCocoaTouchFramework 431 | 432 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 433 | 434 | 435 | 436 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 437 | 438 | 439 | YES 440 | AWNotification.xcodeproj 441 | 3 442 | 112 443 | 444 | 445 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | AWNotification 2 | ======= 3 | 4 | AWNotification is a simple class to show non-interactive pop-up views. This is useful e.g. if you're performing a long-running task that the user cares about. 5 | 6 | ![Pill Normal](http://github.com/alexbw/AWNotification/raw/master/Screenshots/Pill_Normal.png "Pill Normal") 7 | ![Pill Success](http://github.com/alexbw/AWNotification/raw/master/Screenshots/Pill_Success.png "Pill Success") 8 | ![Pill Failure](http://github.com/alexbw/AWNotification/raw/master/Screenshots/Pill_Failure.png "Pill Failure") 9 | 10 | ![Rounded Rect Normal](http://github.com/alexbw/AWNotification/raw/master/Screenshots/RoundedRect_Normal.png "Rounded Rect Normal") 11 | ![Rounded Rect Success](http://github.com/alexbw/AWNotification/raw/master/Screenshots/RoundedRect_Success.png "Rounded Rect Success") 12 | ![Rounded Rect Failure](http://github.com/alexbw/AWNotification/raw/master/Screenshots/RoundedRect_Failure.png "Rounded Rect Failure") 13 | 14 | ![Full Screen Normal](http://github.com/alexbw/AWNotification/raw/master/Screenshots/FullScreen_Normal.png "Full Screen Normal") 15 | ![Full Screen Success](http://github.com/alexbw/AWNotification/raw/master/Screenshots/FullScreen_Success.png "Full Screen Success") 16 | ![Full Screen Failure](http://github.com/alexbw/AWNotification/raw/master/Screenshots/FullScreen_Failure.png "Full Screen Failure") 17 | 18 | 19 | How to use the darn thing 20 | ========================= 21 | 22 | **First, to your project add:** 23 | 24 | * AWNotification.m 25 | * AWNotification.h 26 | * x.png 27 | * check.png 28 | 29 | Briefly, here's how it works: 30 | 31 | // Start some long-running process you want the user to know about... 32 | 33 | AWNotification *notification = [[AWNotification alloc] initWithNotificationStyle:AWNotificationStylePill]; 34 | notification.message = @"Getting to work..."; 35 | notification.center = CGPointMake(160.0, 400.0); // optionally move the notification view around 36 | [notification show]; 37 | 38 | // ... the status of the process changes 39 | notification.message = @"Almost finished..." 40 | 41 | // ... and then, finally, you're done 42 | if (success) 43 | [notification hideWithSuccessMessage:@"We did it!"]; 44 | 45 | else if (failure) 46 | [notification hideWithFailureMessage:@"Sorry, didn't work."]; 47 | 48 | else 49 | [notification hideWithMessage:@"Age of Aquarius"] 50 | 51 | [notification release]; 52 | 53 | Pretty straight-forward, eh? 54 | 55 | There are three notification styles: 56 | 57 | - AWNotificationStyleRoundedRect (think of the Twitter app, formerly Tweetie 2, when publishing to Instapaper) 58 | - AWNotificationStylePill (thin rounded rectangle) 59 | - AWNotificationStyleFullScreen 60 | 61 | Also, you can modify the center of the notification view to move it around. 62 | Oh, and you're free to do whatever you want with this code, blah blah blah, for commercial use or otherwise, without paying me. MIT LICENSE GO: 63 | 64 | Copyright (c) 2010 Alex Wiltschko 65 | 66 | Permission is hereby granted, free of charge, to any person obtaining a copy 67 | of this software and associated documentation files (the "Software"), to deal 68 | in the Software without restriction, including without limitation the rights 69 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 70 | copies of the Software, and to permit persons to whom the Software is 71 | furnished to do so, subject to the following conditions: 72 | 73 | The above copyright notice and this permission notice shall be included in 74 | all copies or substantial portions of the Software. 75 | 76 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 77 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 78 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 79 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 80 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 81 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 82 | THE SOFTWARE. 83 | -------------------------------------------------------------------------------- /Screenshots/FullScreen_Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/Screenshots/FullScreen_Failure.png -------------------------------------------------------------------------------- /Screenshots/FullScreen_Normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/Screenshots/FullScreen_Normal.png -------------------------------------------------------------------------------- /Screenshots/FullScreen_Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/Screenshots/FullScreen_Success.png -------------------------------------------------------------------------------- /Screenshots/Pill_Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/Screenshots/Pill_Failure.png -------------------------------------------------------------------------------- /Screenshots/Pill_Normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/Screenshots/Pill_Normal.png -------------------------------------------------------------------------------- /Screenshots/Pill_Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/Screenshots/Pill_Success.png -------------------------------------------------------------------------------- /Screenshots/RoundedRect_Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/Screenshots/RoundedRect_Failure.png -------------------------------------------------------------------------------- /Screenshots/RoundedRect_Normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/Screenshots/RoundedRect_Normal.png -------------------------------------------------------------------------------- /Screenshots/RoundedRect_Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/Screenshots/RoundedRect_Success.png -------------------------------------------------------------------------------- /check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/check.png -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AWNotification 4 | // 5 | // Created by Alex Wiltschko on 8/25/10. 6 | // Copyright __MyCompanyName__ 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbw/AWNotification/8bc1564c06cd6a2d3bc83be591e263bc7dcd7d53/x.png --------------------------------------------------------------------------------