Permalink
Browse files

Added actionButton to the example project

  • Loading branch information...
coneybeare committed Jun 17, 2012
1 parent 6f3ec88 commit c4ea2c1cc3f8ad6742b379291581e58d047e1e6d
@@ -11,6 +11,10 @@
E64F520614BA98FA009CB18D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E64F520514BA98FA009CB18D /* UIKit.framework */; };
E64F520814BA98FA009CB18D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E64F520714BA98FA009CB18D /* Foundation.framework */; };
E64F520A14BA98FA009CB18D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E64F520914BA98FA009CB18D /* CoreGraphics.framework */; };
+ E659BE00158D633F0031B337 /* modalButton.png in Resources */ = {isa = PBXBuildFile; fileRef = E659BDFE158D633F0031B337 /* modalButton.png */; };
+ E659BE01158D633F0031B337 /* modalButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E659BDFF158D633F0031B337 /* modalButton@2x.png */; };
+ E659BE11158D6AFF0031B337 /* modalButton-selected.png in Resources */ = {isa = PBXBuildFile; fileRef = E659BE0F158D6AFF0031B337 /* modalButton-selected.png */; };
+ E659BE12158D6AFF0031B337 /* modalButton-selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E659BE10158D6AFF0031B337 /* modalButton-selected@2x.png */; };
E65CAB1914CFB930004F3776 /* UIView+JMNoise.m in Sources */ = {isa = PBXBuildFile; fileRef = E65CAB0914CFB930004F3776 /* UIView+JMNoise.m */; };
E65CAB1A14CFB930004F3776 /* close.png in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB0B14CFB930004F3776 /* close.png */; };
E65CAB1B14CFB930004F3776 /* close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E65CAB0C14CFB930004F3776 /* close@2x.png */; };
@@ -37,6 +41,10 @@
E64F520514BA98FA009CB18D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
E64F520714BA98FA009CB18D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
E64F520914BA98FA009CB18D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ E659BDFE158D633F0031B337 /* modalButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = modalButton.png; sourceTree = "<group>"; };
+ E659BDFF158D633F0031B337 /* modalButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "modalButton@2x.png"; sourceTree = "<group>"; };
+ E659BE0F158D6AFF0031B337 /* modalButton-selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "modalButton-selected.png"; sourceTree = "<group>"; };
+ E659BE10158D6AFF0031B337 /* modalButton-selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "modalButton-selected@2x.png"; sourceTree = "<group>"; };
E65CAB0814CFB930004F3776 /* UIView+JMNoise.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+JMNoise.h"; sourceTree = "<group>"; };
E65CAB0914CFB930004F3776 /* UIView+JMNoise.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+JMNoise.m"; sourceTree = "<group>"; };
E65CAB0B14CFB930004F3776 /* close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = close.png; sourceTree = "<group>"; };
@@ -148,6 +156,10 @@
children = (
E65CAB0B14CFB930004F3776 /* close.png */,
E65CAB0C14CFB930004F3776 /* close@2x.png */,
+ E659BDFE158D633F0031B337 /* modalButton.png */,
+ E659BDFF158D633F0031B337 /* modalButton@2x.png */,
+ E659BE0F158D6AFF0031B337 /* modalButton-selected.png */,
+ E659BE10158D6AFF0031B337 /* modalButton-selected@2x.png */,
);
name = Images;
path = Panel/Images;
@@ -275,6 +287,10 @@
E65CAB4314CFB9A8004F3776 /* UAViewController_iPhone.xib in Resources */,
E65CAB4414CFB9A8004F3776 /* UAViewController_iPad.xib in Resources */,
E65CAB4514CFB9A8004F3776 /* InfoPlist.strings in Resources */,
+ E659BE00158D633F0031B337 /* modalButton.png in Resources */,
+ E659BE01158D633F0031B337 /* modalButton@2x.png in Resources */,
+ E659BE11158D6AFF0031B337 /* modalButton-selected.png in Resources */,
+ E659BE12158D6AFF0031B337 /* modalButton-selected@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -51,6 +51,9 @@ - (id)initWithFrame:(CGRect)frame title:(NSString *)title {
// Shows the bounce animation. Default = YES
self.shouldBounce = (arc4random() % 2);
+ // Shows the actionButton. Default title is nil, thus the button is hidden by default
+ [self.actionButton setTitle:@"Foobar" forState:UIControlStateNormal];
+
// Height of the title view. Default = 40.0f
[self setTitleBarHeight:((arc4random() % 5) + 2) * 20.0f];
@@ -42,6 +42,13 @@ - (IBAction)showModalPanel:(id)sender {
[panel hideWithOnComplete:^(BOOL finished) {
[panel removeFromSuperview];
}];
+ UADebugLog(@"onClosePressed block called from panel: %@", modalPanel);
+ };
+
+ ///////////////////////////////////////////
+ // Panel is a reference to the modalPanel
+ modalPanel.onActionPressed = ^(UAModalPanel* panel) {
+ UADebugLog(@"onActionPressed block called from panel: %@", modalPanel);
};
UADebugLog(@"UAModalView will display using blocks: %@", modalPanel);
@@ -96,6 +103,13 @@ - (BOOL)shouldCloseModalPanel:(UAModalPanel *)modalPanel {
return YES;
}
+// Optional: This is called when the action button is pressed
+// Action button is only visible when its title is non-nil;
+// Only used if delegate is set and not using blocks.
+- (void)didSelectActionButton:(UAModalPanel *)modalPanel {
+ UADebugLog(@"didSelectActionButton called with modalPanel: %@", modalPanel);
+}
+
// Optional: This is called before the close animations.
// Only used if delegate is set.
- (void)willCloseModalPanel:(UAModalPanel *)modalPanel {

0 comments on commit c4ea2c1

Please sign in to comment.