Permalink
Browse files

readme

  • Loading branch information...
1 parent 234cdd8 commit a4a82cf1ccd1b7533ce85550b1325c41f5649680 Oleg Geier committed Apr 12, 2012
Showing with 54 additions and 0 deletions.
  1. +19 −0 LICENSE.md
  2. +35 −0 README.md
View
19 LICENSE.md
@@ -0,0 +1,19 @@
+ Copyright (c) 2011 Oleg Geier
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
+ this software and associated documentation files (the "Software"), to deal in
+ the Software without restriction, including without limitation the rights to
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ of the Software, and to permit persons to whom the Software is furnished to do
+ so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
View
35 README.md
@@ -0,0 +1,35 @@
+Purpose
+---------
+
+`OGActionChooser` is an iOS control that can be used as a replacement for `UIActionSheet` or `UIAlertView`. It displays an arbitrarily long list of button items, each having a title and image. The user can select an item or close the action chooser.
+The items can optionally be disabled.
+
+Sample Code
+------------
+
+ self.actionChooser = [OGActionChooser actionChooserWithDelegate:self];
+ [self.actionChooser setTitle:@"Choose action"];
+ [self.actionChooser setButtonsWithArray:[NSArray arrayWithObjects:
+ [OGActionButton buttonWithTitle:@"Action 1"
+ imageName:@"actionChooser_Button1.png"
+ enabled:YES],
+ [OGActionButton buttonWithTitle:@"Action 2"
+ imageName:@"actionChooser_Button2.png"
+ enabled:YES],nil]];
+ [self.actionChooser presentInView:self.view];
+
+
+Delegate methods
+-----------------
+
+The caller (usually a view controller) should implement the following protocol:
+
+ @protocol OGActionChooserDelegate <NSObject>
+ - (void)actionChooserButtonPressedWithIndex:(NSInteger)index;
+ - (void)actionChooserFinished;
+ @end
+
+`actionChooserButtonPressedWithIndex:` is called when a button item is selected. You can dismiss the action chooser with the `dismiss`-method here.
+
+`actionChooserFinished` is called, when the user closes the view or when you call `dismiss` on the action chooser.
+

0 comments on commit a4a82cf

Please sign in to comment.