diff --git a/STOverlay.xcodeproj/project.pbxproj b/STOverlay.xcodeproj/project.pbxproj index d59cf65..5a0b0e0 100644 --- a/STOverlay.xcodeproj/project.pbxproj +++ b/STOverlay.xcodeproj/project.pbxproj @@ -12,11 +12,14 @@ 2441F57514DA954000F3D64D /* STOverlayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2441F57414DA954000F3D64D /* STOverlayController.m */; }; 2441F58F14DAEFCF00F3D64D /* README.markdown in Resources */ = {isa = PBXBuildFile; fileRef = 2441F58E14DAEFCF00F3D64D /* README.markdown */; }; 249860FF14DA3AAB004D1710 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 249860FE14DA3AAB004D1710 /* Cocoa.framework */; }; - 2498610914DA3AAB004D1710 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2498610714DA3AAB004D1710 /* InfoPlist.strings */; }; - 2498610B14DA3AAC004D1710 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2498610A14DA3AAB004D1710 /* main.m */; }; - 2498610F14DA3AAC004D1710 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2498610D14DA3AAC004D1710 /* Credits.rtf */; }; - 2498611214DA3AAC004D1710 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2498611114DA3AAC004D1710 /* AppDelegate.m */; }; - 2498611514DA3AAC004D1710 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2498611314DA3AAC004D1710 /* MainMenu.xib */; }; + 7D932BC716A35AE300C45439 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D932BBD16A35AE300C45439 /* AppDelegate.m */; }; + 7D932BC816A35AE300C45439 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 7D932BBE16A35AE300C45439 /* Credits.rtf */; }; + 7D932BC916A35AE300C45439 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7D932BC016A35AE300C45439 /* InfoPlist.strings */; }; + 7D932BCA16A35AE300C45439 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D932BC216A35AE300C45439 /* MainMenu.xib */; }; + 7D932BCB16A35AE300C45439 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D932BC416A35AE300C45439 /* main.m */; }; + 7D932BCC16A35AE300C45439 /* STOverlay-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7D932BC516A35AE300C45439 /* STOverlay-Info.plist */; }; + 7D932BD116A3646400C45439 /* close.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D932BCF16A3646400C45439 /* close.png */; }; + 7D932BD216A3646400C45439 /* close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D932BD016A3646400C45439 /* close@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -32,14 +35,16 @@ 2498610114DA3AAB004D1710 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 2498610214DA3AAB004D1710 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 2498610314DA3AAB004D1710 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 2498610614DA3AAB004D1710 /* STOverlay-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "STOverlay-Info.plist"; sourceTree = ""; }; - 2498610814DA3AAB004D1710 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 2498610A14DA3AAB004D1710 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 2498610C14DA3AAC004D1710 /* STOverlay-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "STOverlay-Prefix.pch"; sourceTree = ""; }; - 2498610E14DA3AAC004D1710 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; - 2498611014DA3AAC004D1710 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 2498611114DA3AAC004D1710 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 2498611414DA3AAC004D1710 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; + 7D932BBC16A35AE300C45439 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 7D932BBD16A35AE300C45439 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 7D932BBF16A35AE300C45439 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + 7D932BC116A35AE300C45439 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 7D932BC316A35AE300C45439 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; + 7D932BC416A35AE300C45439 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 7D932BC516A35AE300C45439 /* STOverlay-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "STOverlay-Info.plist"; sourceTree = ""; }; + 7D932BC616A35AE300C45439 /* STOverlay-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "STOverlay-Prefix.pch"; sourceTree = ""; }; + 7D932BCF16A3646400C45439 /* close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = close.png; sourceTree = ""; }; + 7D932BD016A3646400C45439 /* close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "close@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -58,6 +63,7 @@ isa = PBXGroup; children = ( 2441F58E14DAEFCF00F3D64D /* README.markdown */, + 7D932BBB16A35AE300C45439 /* SampleApp */, 2498610414DA3AAB004D1710 /* STOverlay */, 249860FD14DA3AAB004D1710 /* Frameworks */, 249860FB14DA3AAB004D1710 /* Products */, @@ -94,32 +100,49 @@ 2498610414DA3AAB004D1710 /* STOverlay */ = { isa = PBXGroup; children = ( - 2498611014DA3AAC004D1710 /* AppDelegate.h */, - 2498611114DA3AAC004D1710 /* AppDelegate.m */, + 7D932BCE16A3646400C45439 /* Images */, 2441F56C14DA822400F3D64D /* STOverlayWindow.h */, 2441F56D14DA822400F3D64D /* STOverlayWindow.m */, 2441F57014DA83E500F3D64D /* STOverlayView.h */, 2441F57114DA83E500F3D64D /* STOverlayView.m */, 2441F57314DA954000F3D64D /* STOverlayController.h */, 2441F57414DA954000F3D64D /* STOverlayController.m */, - 2498611314DA3AAC004D1710 /* MainMenu.xib */, - 2498610514DA3AAB004D1710 /* Supporting Files */, ); path = STOverlay; sourceTree = ""; }; - 2498610514DA3AAB004D1710 /* Supporting Files */ = { + 7D932BBB16A35AE300C45439 /* SampleApp */ = { isa = PBXGroup; children = ( - 2498610614DA3AAB004D1710 /* STOverlay-Info.plist */, - 2498610714DA3AAB004D1710 /* InfoPlist.strings */, - 2498610A14DA3AAB004D1710 /* main.m */, - 2498610C14DA3AAC004D1710 /* STOverlay-Prefix.pch */, - 2498610D14DA3AAC004D1710 /* Credits.rtf */, + 7D932BCD16A35AFE00C45439 /* Supporting Files */, + 7D932BBC16A35AE300C45439 /* AppDelegate.h */, + 7D932BBD16A35AE300C45439 /* AppDelegate.m */, + 7D932BC216A35AE300C45439 /* MainMenu.xib */, + ); + path = SampleApp; + sourceTree = ""; + }; + 7D932BCD16A35AFE00C45439 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 7D932BBE16A35AE300C45439 /* Credits.rtf */, + 7D932BC016A35AE300C45439 /* InfoPlist.strings */, + 7D932BC416A35AE300C45439 /* main.m */, + 7D932BC516A35AE300C45439 /* STOverlay-Info.plist */, + 7D932BC616A35AE300C45439 /* STOverlay-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; + 7D932BCE16A3646400C45439 /* Images */ = { + isa = PBXGroup; + children = ( + 7D932BCF16A3646400C45439 /* close.png */, + 7D932BD016A3646400C45439 /* close@2x.png */, + ); + path = Images; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -170,10 +193,13 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2498610914DA3AAB004D1710 /* InfoPlist.strings in Resources */, - 2498610F14DA3AAC004D1710 /* Credits.rtf in Resources */, - 2498611514DA3AAC004D1710 /* MainMenu.xib in Resources */, 2441F58F14DAEFCF00F3D64D /* README.markdown in Resources */, + 7D932BC816A35AE300C45439 /* Credits.rtf in Resources */, + 7D932BC916A35AE300C45439 /* InfoPlist.strings in Resources */, + 7D932BCA16A35AE300C45439 /* MainMenu.xib in Resources */, + 7D932BCC16A35AE300C45439 /* STOverlay-Info.plist in Resources */, + 7D932BD116A3646400C45439 /* close.png in Resources */, + 7D932BD216A3646400C45439 /* close@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -184,37 +210,37 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2498610B14DA3AAC004D1710 /* main.m in Sources */, - 2498611214DA3AAC004D1710 /* AppDelegate.m in Sources */, 2441F56E14DA822400F3D64D /* STOverlayWindow.m in Sources */, 2441F57214DA83E500F3D64D /* STOverlayView.m in Sources */, 2441F57514DA954000F3D64D /* STOverlayController.m in Sources */, + 7D932BC716A35AE300C45439 /* AppDelegate.m in Sources */, + 7D932BCB16A35AE300C45439 /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 2498610714DA3AAB004D1710 /* InfoPlist.strings */ = { + 7D932BBE16A35AE300C45439 /* Credits.rtf */ = { isa = PBXVariantGroup; children = ( - 2498610814DA3AAB004D1710 /* en */, + 7D932BBF16A35AE300C45439 /* en */, ); - name = InfoPlist.strings; + name = Credits.rtf; sourceTree = ""; }; - 2498610D14DA3AAC004D1710 /* Credits.rtf */ = { + 7D932BC016A35AE300C45439 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 2498610E14DA3AAC004D1710 /* en */, + 7D932BC116A35AE300C45439 /* en */, ); - name = Credits.rtf; + name = InfoPlist.strings; sourceTree = ""; }; - 2498611314DA3AAC004D1710 /* MainMenu.xib */ = { + 7D932BC216A35AE300C45439 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( - 2498611414DA3AAC004D1710 /* en */, + 7D932BC316A35AE300C45439 /* en */, ); name = MainMenu.xib; sourceTree = ""; @@ -272,8 +298,8 @@ buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "STOverlay/STOverlay-Prefix.pch"; - INFOPLIST_FILE = "STOverlay/STOverlay-Info.plist"; + GCC_PREFIX_HEADER = "SampleApp/STOverlay-Prefix.pch"; + INFOPLIST_FILE = "$(SRCROOT)/SampleApp/STOverlay-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -284,8 +310,8 @@ buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "STOverlay/STOverlay-Prefix.pch"; - INFOPLIST_FILE = "STOverlay/STOverlay-Info.plist"; + GCC_PREFIX_HEADER = "SampleApp/STOverlay-Prefix.pch"; + INFOPLIST_FILE = "$(SRCROOT)/SampleApp/STOverlay-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; diff --git a/STOverlay/Images/close.png b/STOverlay/Images/close.png new file mode 100644 index 0000000..70b4847 Binary files /dev/null and b/STOverlay/Images/close.png differ diff --git a/STOverlay/Images/close@2x.png b/STOverlay/Images/close@2x.png new file mode 100644 index 0000000..6401843 Binary files /dev/null and b/STOverlay/Images/close@2x.png differ diff --git a/STOverlay/STOverlayController.h b/STOverlay/STOverlayController.h index f5c100d..678b97e 100644 --- a/STOverlay/STOverlayController.h +++ b/STOverlay/STOverlayController.h @@ -28,14 +28,31 @@ @interface STOverlayController : NSObject +@property (strong, nonatomic) NSFont *labelFont; +@property (strong, nonatomic) NSColor *labelColor; + +@property (nonatomic) float hasCloseButton; +@property (nonatomic) NSUInteger closeButtonOffset; + - (void)beginOverlayToView:(NSView *)targetView withLabel:(NSString *)label radius:(CGFloat)radius offset:(CGFloat)offset; +- (void)beginOverlayToView:(NSView *)targetView + withLabel:(NSString *)label + radius:(CGFloat)radius + offset:(CGFloat)offset + hideAfter:(NSInteger)delay; - (void)beginOverlayToView:(NSView *)targetView withLabel:(NSString *)label radius:(CGFloat)radius size:(NSSize)size; +- (void)beginOverlayToView:(NSView *)targetView + withLabel:(NSString *)label + radius:(CGFloat)radius + size:(NSSize)size + hideAfter:(NSInteger)delay; + - (void)endOverlay; - (BOOL)isOverlay; diff --git a/STOverlay/STOverlayController.m b/STOverlay/STOverlayController.m index a0319c7..23078db 100644 --- a/STOverlay/STOverlayController.m +++ b/STOverlay/STOverlayController.m @@ -37,9 +37,73 @@ - (void)beginOverlayToView:(NSView *)targetView withLabel:(NSString *)label radi @implementation STOverlayController { STOverlayWindow *_overlayWindow; __weak NSView *_targetView; + NSButton *closeButton; +} + +@synthesize labelColor = _labelColor, labelFont = _labelFont; + +- (id)init { + self = [super init]; + if (self) { + //init label font, color and close button properties + self.labelFont = [NSFont systemFontOfSize:48.0]; + self.labelColor = [NSColor whiteColor]; + self.hasCloseButton = YES; + self.closeButtonOffset = 8.0f; + } + + return self; +} + +- (void)createCloseButtonInView:(NSView *)overlayView { + if (closeButton) { + closeButton = nil; + } + + CGRect f = CGRectZero; + f.size.width = f.size.height = 24; + closeButton = [[NSButton alloc] initWithFrame:f]; + closeButton.imagePosition = NSImageOnly; + closeButton.image = [NSImage imageNamed:@"close"]; + closeButton.bezelStyle = NSShadowlessSquareBezelStyle; + [closeButton setBordered:NO]; + closeButton.showsBorderOnlyWhileMouseInside = YES; + [[closeButton cell] setHighlightsBy:NSChangeGrayCellMask]; + + [closeButton setButtonType:NSMomentaryChangeButton]; + + closeButton.action = @selector(closeButtonPressed:); + closeButton.target = self; + closeButton.translatesAutoresizingMaskIntoConstraints = NO; + + [overlayView addSubview:closeButton]; + + //make button sits in top right corner + NSMutableArray *constraints = [NSMutableArray array]; + + NSDictionary *metrics = [NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:self.closeButtonOffset] + forKey:@"offset"]; + + [constraints addObjectsFromArray:[NSLayoutConstraint + constraintsWithVisualFormat:@"[closeButton(24)]-(offset)-|" + options:0 + metrics:metrics + views:NSDictionaryOfVariableBindings(closeButton)]]; + + [constraints addObjectsFromArray:[NSLayoutConstraint + constraintsWithVisualFormat:@"V:|-(offset)-[closeButton(24)]" + options:0 + metrics:metrics + views:NSDictionaryOfVariableBindings(closeButton)]]; + + [overlayView addConstraints:constraints]; } - (void)beginOverlayToView:(NSView *)targetView withLabel:(NSString *)label radius:(CGFloat)radius { + //if currently displayed, hide first + if ([self isOverlay]) { + [self endOverlay]; + } _targetView = targetView; [targetView addObserver:self forKeyPath:@"frame" @@ -50,8 +114,17 @@ - (void)beginOverlayToView:(NSView *)targetView withLabel:(NSString *)label radi _overlayWindow = [[STOverlayWindow alloc] initWithContentRect:overlayRect]; [_overlayWindow setReleasedWhenClosed:NO]; STOverlayView *overlayView = [_overlayWindow overlayView]; + //configure label overlayView.label = label; + overlayView.labelColor = self.labelColor; + overlayView.labelFont = self.labelFont; overlayView.bezelRadius = radius; + + //create button if needed + if (self.hasCloseButton) { + [self createCloseButtonInView:overlayView]; + } + [parentWindow addChildWindow:_overlayWindow ordered:NSWindowAbove]; } @@ -65,6 +138,8 @@ - (void)beginOverlayToView:(NSView *)targetView NSDictionary *views = [NSDictionary dictionaryWithObject:[_overlayWindow overlayView] forKey:@"overlayView"]; NSMutableArray *constraints = [NSMutableArray array]; + + [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"|-(offset)-[overlayView]-(offset)-|" options:0 metrics:metrics @@ -73,9 +148,20 @@ - (void)beginOverlayToView:(NSView *)targetView options:0 metrics:metrics views:views]]; + [_overlayWindow.contentView addConstraints:constraints]; } +- (void)beginOverlayToView:(NSView *)targetView + withLabel:(NSString *)label + radius:(CGFloat)radius + offset:(CGFloat)offset + hideAfter:(NSInteger)delay { + [self beginOverlayToView:targetView withLabel:label radius:radius offset:offset]; + + [self hideOverlayAfter:delay]; +} + - (void)beginOverlayToView:(NSView *)targetView withLabel:(NSString *)label radius:(CGFloat)radius @@ -113,6 +199,24 @@ - (void)beginOverlayToView:(NSView *)targetView [_overlayWindow.contentView addConstraints:constraints]; } +- (void)beginOverlayToView:(NSView *)targetView + withLabel:(NSString *)label + radius:(CGFloat)radius + size:(NSSize)size + hideAfter:(NSInteger)delay { + [self beginOverlayToView:targetView withLabel:label radius:radius size:size]; + + [self hideOverlayAfter:delay]; + +} + +- (void)hideOverlayAfter:(NSInteger)delay { + //set timeout to hide view + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_current_queue(), ^{ + [self endOverlay]; + }); +} + - (void)endOverlay { NSWindow *parentWindow = _overlayWindow.parentWindow; [parentWindow removeChildWindow:_overlayWindow]; @@ -121,6 +225,10 @@ - (void)endOverlay { [_targetView removeObserver:self forKeyPath:@"frame"]; } +- (IBAction)closeButtonPressed:(id)sender { + [self endOverlay]; +} + - (BOOL)isOverlay { return _overlayWindow != nil; } diff --git a/STOverlay/STOverlayView.h b/STOverlay/STOverlayView.h index 85b25d4..4367ed7 100644 --- a/STOverlay/STOverlayView.h +++ b/STOverlay/STOverlayView.h @@ -32,5 +32,7 @@ extern CGFloat STOverlayViewStandardRadius; @property CGFloat bezelRadius; @property (copy) NSString *label; +@property (copy) NSFont *labelFont; +@property (copy) NSColor *labelColor; @end diff --git a/STOverlay/STOverlayView.m b/STOverlay/STOverlayView.m index ca122ec..2d999c5 100644 --- a/STOverlay/STOverlayView.m +++ b/STOverlay/STOverlayView.m @@ -39,6 +39,7 @@ @implementation STOverlayView @synthesize bezelRadius = _bezelRadius; @synthesize label = _label; +@synthesize labelFont = _labelFont, labelColor = _labelColor; - (id)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; @@ -65,8 +66,8 @@ - (void)drawBezel { - (void)drawLabel { NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys: - [NSFont systemFontOfSize:48.0], NSFontAttributeName, - [NSColor whiteColor], NSForegroundColorAttributeName, + self.labelFont, NSFontAttributeName, + self.labelColor, NSForegroundColorAttributeName, nil]; NSAttributedString *labelToDraw = [[NSAttributedString alloc] initWithString:self.label attributes:attributes]; diff --git a/STOverlay/AppDelegate.h b/SampleApp/AppDelegate.h similarity index 100% rename from STOverlay/AppDelegate.h rename to SampleApp/AppDelegate.h diff --git a/STOverlay/AppDelegate.m b/SampleApp/AppDelegate.m similarity index 69% rename from STOverlay/AppDelegate.m rename to SampleApp/AppDelegate.m index 6bf1324..30a9852 100644 --- a/STOverlay/AppDelegate.m +++ b/SampleApp/AppDelegate.m @@ -43,27 +43,17 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification } - (IBAction)overlay1:(id)sender { - if (self.overlayController.isOverlay) { - [self.overlayController endOverlay]; - } - else { - [self.overlayController beginOverlayToView:self.targetView - withLabel:@"Loading..." - radius:self.radiusSlider.doubleValue - offset:self.offsetSlider.doubleValue]; - } + [self.overlayController beginOverlayToView:self.targetView + withLabel:@"Loading..." + radius:self.radiusSlider.doubleValue + offset:self.offsetSlider.doubleValue]; } - (IBAction)overlay2:(id)sender { - if (self.overlayController.isOverlay) { - [self.overlayController endOverlay]; - } - else { - [self.overlayController beginOverlayToView:self.targetView - withLabel:@"Loading..." - radius:self.radiusSlider.doubleValue - size:NSMakeSize(self.widthSlider.doubleValue, self.heightSlider.doubleValue)]; - } + [self.overlayController beginOverlayToView:self.targetView + withLabel:@"Loading..." + radius:self.radiusSlider.doubleValue + size:NSMakeSize(self.widthSlider.doubleValue, self.heightSlider.doubleValue)]; } @end diff --git a/STOverlay/STOverlay-Info.plist b/SampleApp/STOverlay-Info.plist similarity index 100% rename from STOverlay/STOverlay-Info.plist rename to SampleApp/STOverlay-Info.plist diff --git a/STOverlay/STOverlay-Prefix.pch b/SampleApp/STOverlay-Prefix.pch similarity index 100% rename from STOverlay/STOverlay-Prefix.pch rename to SampleApp/STOverlay-Prefix.pch diff --git a/STOverlay/en.lproj/Credits.rtf b/SampleApp/en.lproj/Credits.rtf similarity index 100% rename from STOverlay/en.lproj/Credits.rtf rename to SampleApp/en.lproj/Credits.rtf diff --git a/STOverlay/en.lproj/InfoPlist.strings b/SampleApp/en.lproj/InfoPlist.strings similarity index 100% rename from STOverlay/en.lproj/InfoPlist.strings rename to SampleApp/en.lproj/InfoPlist.strings diff --git a/STOverlay/en.lproj/MainMenu.xib b/SampleApp/en.lproj/MainMenu.xib similarity index 100% rename from STOverlay/en.lproj/MainMenu.xib rename to SampleApp/en.lproj/MainMenu.xib diff --git a/STOverlay/main.m b/SampleApp/main.m similarity index 100% rename from STOverlay/main.m rename to SampleApp/main.m