{"id":18270331,"url":"https://github.com/ianb821/IBActionSheet","last_synced_at":"2025-04-05T01:30:30.661Z","repository":{"id":10301468,"uuid":"12423908","full_name":"ianb821/IBActionSheet","owner":"ianb821","description":"Customizable iOS 7 style UIActionSheet ","archived":false,"fork":false,"pushed_at":"2017-04-16T21:26:54.000Z","size":738,"stargazers_count":307,"open_issues_count":9,"forks_count":65,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-05T11:52:44.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianb821.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-28T03:40:29.000Z","updated_at":"2024-10-07T09:12:52.000Z","dependencies_parsed_at":"2022-08-30T13:51:04.044Z","dependency_job_id":null,"html_url":"https://github.com/ianb821/IBActionSheet","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianb821%2FIBActionSheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianb821%2FIBActionSheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianb821%2FIBActionSheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianb821%2FIBActionSheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianb821","download_url":"https://codeload.github.com/ianb821/IBActionSheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276021,"owners_count":20912285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:38:30.942Z","updated_at":"2025-04-05T01:30:30.152Z","avatar_url":"https://github.com/ianb821.png","language":"Objective-C","funding_links":[],"categories":["etc"],"sub_categories":[],"readme":"IBActionSheet\n=========\n[![Pod Version](https://img.shields.io/cocoapods/v/IBActionSheet.svg?style=flat)](http://cocoadocs.org/docsets/IBActionSheet/)\n[![Pod Platform](https://img.shields.io/cocoapods/p/IBActionSheet.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/)\n[![Pod License](https://img.shields.io/cocoapods/l/IBActionSheet.svg?style=flat)](http://cocoadocs.org/docsets/IBActionSheet)\n\nFully customizable iOS 7/8 style UIActionSheet replacement.  Compatible with iOS 5, 6, 7, and 8.\n##Features\n\nBy default, IBActionSheet mimics the iOS 7/8 UIActionSheet exactly:\n\n\n\n![Standard](https://raw.github.com/ianb821/IBActionSheet/master/Pictures/Standard.png)\n\n\nYou then have the option to change:\n\n - The button text color\n - The button background color\n - The button text highlight color\n - The button backround highlight color\n - The button and title font\n - The effect when a button is pressed\n\n####A simple example is shown here:\n\n![Colored](https://raw.github.com/ianb821/IBActionSheet/master/Pictures/Colored.png)\n\n####An extreme example with every element of the action sheet customized is show here (landscape):\n\n![Funky](https://raw.github.com/ianb821/IBActionSheet/master/Pictures/Funky_Landscape.png)\n\nAll but the 'button press' effects can be customized for the whole action sheet, or for individual buttons and title.  The 'button press' effects current include:\n\n - Fade\n - Highlight (With designated background and text highlight colors)\n - Shrink Effect\n - Reverse Colors (Same as highlight, but it reverses background and text colors)\n\n\n##Usage\n\nIBActionSheet offers the same functionality as the UIActionSheet, including things like:\n\n```\n- (id)initWithTitle:(NSString *)title delegate:(id\u003cIBActionSheetDelegate\u003e)delegate cancelButtonTitle:(NSString *)cancelTitle destructiveButtonTitle:(NSString *)destructiveTitle otherButtonTitles:(NSString *)otherTitles, ... NS_REQUIRES_NIL_TERMINATION;\n\n- (void)showInView:(UIView *)theView;\n\n- (NSInteger)addButtonWithTitle:(NSString *)title;\n\n- (void)dismissWithClickedButtonIndex:\n\n- (NSInteger)buttonIndex animated:(BOOL)animated;\n\n- (NSInteger)numberOfButtons;\n\n- (NSString *)buttonTitleAtIndex:(NSInteger)index;\n\n- (BOOL)visible;\n\n- (NSInteger)cancelButtonIndex;\n\n- (NSInteger)destructiveButtonIndex;\n\n```\n\nTo receive notifications from the IBActionSheet, just add\n```\u003cIBActionSheetDelegate\u003e``` to your view controller's header file, and implement the following method:\n\n\n```\n-(void)actionSheet:(IBActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;\n\n```\n\nIt behaves just like the UIActionSheet method, and in fact, it will receive notifications from a UIActionSheet as well.\n\nYou can add these optional methods, which also behave like their UIActionSheet equivalents:\n\n```\n-(void)actionSheet:(IBActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex;\n-(void)actionSheet:(IBActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex;\n\n```\n\nThen you get to the good stuff, to customize the action sheet, you can choose from the following:\n\n```\n// rotation\n- (void)rotateToCurrentOrientation;\n\n// effects\n- (void)setButtonResponse:(IBActionSheetButtonResponse)response;\n\n// fonts\n- (void)setFont:(UIFont *)font;\n- (void)setTitleFont:(UIFont *)font;\n- (void)setFont:(UIFont *)font forButtonAtIndex:(NSInteger)index;\n- (void)setCancelButtonFont:(UIFont *)font;\n- (void)setDestructiveButtonFont:(UIFont *)font;\n\n\n// standard colors\n- (void)setTitleTextColor:(UIColor *)color;\n- (void)setButtonTextColor:(UIColor *)color;\n- (void)setTitleBackgroundColor:(UIColor *)color;\n- (void)setButtonBackgroundColor:(UIColor *)color;\n- (UIColor *)buttonTextColorAtIndex:(NSInteger)index;\n- (UIColor *)buttonBackgroundColorAtIndex:(NSInteger)index;\n- (void)setButtonTextColor:(UIColor *)color forButtonAtIndex:(NSInteger)index;\n- (void)setButtonBackgroundColor:(UIColor *)color forButtonAtIndex:(NSInteger)index;\n\n\n// highlight colors\n- (void)setButtonHighlightBackgroundColor:(UIColor *)color;\n- (void)setButtonHighlightTextColor:(UIColor *)color;\n- (void)setButtonHighlightTextColor:(UIColor *)color forButtonAtIndex:(NSInteger)index;\n- (void)setButtonHighlightBackgroundColor:(UIColor *)color forButtonAtIndex:(NSInteger)index;\n\n```\n\n##Included\nI have included a super simple sample project that will show you how it works.  Please let me know if you have any questions or suggestions!\n\n***Note: If you are running this app on iOS 7, make sure that you change the deployment target to 7.0 before installing it on a device running 7.0.  If not, the animation will be slightly off\n\n\n##Known Issues\n\n - On iPad, it follows the iPhone style UIActionSheet instead of the iPad one.  I personally prefer this behavior, but if there is a demand, I'm happy to make it follow the UIActionSheet behavior for iPad, just let me know!\n\n - IBActionSheet doesn't lock orientation as UIActionSheet does.  I haven't found an elegant solution to this just yet.  You can use the actionSheet.visible property to lock it yourself, or you call:\n\n```\n  [actionSheet rotateToCurrentOrientation];\n```\n from whatever method you are using to detect rotation and it will resize accordingly.\n\n - When adding IBActionSheet to a UIView contained in a UINavigation Controller, use:\n\n```\n  [actionSheet showInView:self.navigationController.view];\n```\ninstead of:\n\n```\n  [actionSheet showInView:self.view];\n```\nhopefully I can eliminate the need to do this in the future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianb821%2FIBActionSheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianb821%2FIBActionSheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianb821%2FIBActionSheet/lists"}