{"id":23845773,"url":"https://github.com/lobianco/albuttonmenu","last_synced_at":"2025-09-07T19:32:45.126Z","repository":{"id":56900581,"uuid":"79929585","full_name":"lobianco/ALButtonMenu","owner":"lobianco","description":"A simple, fully customizable menu solution for iOS.","archived":false,"fork":false,"pushed_at":"2023-08-30T17:50:38.000Z","size":459,"stargazers_count":46,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-03-15T14:42:25.289Z","etag":null,"topics":["apple","cocoapods","ios","ipad","iphone","menu","objective-c","ui","uikit","uinavigationcontroller","uiviewcontroller"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/anthonylobianco","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/lobianco.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":"2017-01-24T16:25:21.000Z","updated_at":"2023-11-17T16:39:19.000Z","dependencies_parsed_at":"2022-08-21T02:20:49.267Z","dependency_job_id":null,"html_url":"https://github.com/lobianco/ALButtonMenu","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/lobianco%2FALButtonMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobianco%2FALButtonMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobianco%2FALButtonMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobianco%2FALButtonMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lobianco","download_url":"https://codeload.github.com/lobianco/ALButtonMenu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232252682,"owners_count":18495100,"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":["apple","cocoapods","ios","ipad","iphone","menu","objective-c","ui","uikit","uinavigationcontroller","uiviewcontroller"],"created_at":"2025-01-02T20:26:24.897Z","updated_at":"2025-01-02T20:26:25.479Z","avatar_url":"https://github.com/lobianco.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ALButtonMenu\n\nALButtomMenu is a fast, customizable, fully documented menu solution for iOS.\n\n### Preview\n\n![Preview1](https://github.com/lobianco/ALButtonMenu/blob/main/Screenshots/demo1.gif?raw=true) ![Preview2](https://github.com/lobianco/ALButtonMenu/blob/main/Screenshots/demo2.gif?raw=true)\n\n## Installation\n\nInstallation is easy.\n\n### Cocoapods\n\n1. `pod 'ALButtonMenu'` in your Podfile\n2. `#import \u003cALButtonMenu/ALButtonMenu.h\u003e` in your view of choice\n\n### Manually\n\n1. [Download the .zip](https://github.com/lobianco/ALButtonMenu/archive/master.zip) from Github and copy `ALButtonMenu/Source` directory to your project\n2. `#import \"ALButtonMenu.h\"` in your view of choice\n\n## Example Usage\n\nRefer to the demo project for an interactive example, or just take a look at the code and comments below. \n\n```objc\n\n//\n//  MyRootViewController.m\n//\n\n// this, or whatever init method you choose to use\n- (instancetype)init \n{\n    if ((self = [super init]) == NO)\n    {\n        return nil;\n    }\n\n    // the layout that we'll use for the menu view controller\n    ALMenuViewControllerLayout layout;\n\n    // the menu items will be displayed in a grid with this many columns. however, in landscape mode, \n    // this value will be used for the number of rows instead.\n    //\n    layout.columns = 2;\n\n    // the spacing between menu items\n    layout.itemSpacing = 15.f;\n\n    // the size of the menu items\n    layout.itemSize = CGSizeMake(100.f, 100.f);\n\n    // can be an array of any number of items that inherit from ALButton or conform to the \u003cALMenuItem\u003e protocol\n    NSArray\u003cUIView\u003cALMenuItem\u003e *\u003e *items = [self allMenuItems];\n\n    // create the view model for the menu view controller\n    ALMenuViewControllerViewModel *menuViewModel = [[ALMenuViewControllerViewModel alloc] initWithItems:items layout:layout];\n\n    // tweak the default values. see ALMenuViewControllerViewModel.h for configurable properties\n    menuViewModel.appearingAnimation = ALMenuViewControllerAppearingAnimationOrigin;\n\n    // the menu view controller can be an instance of ALMenuViewController, or any class that conforms\n    // to the \u003cALMenuViewController\u003e protocol\n    //\n    ALMenuViewController *menuViewController = [[ALMenuViewController alloc] initWithViewModel:menuViewModel];\n\n    // an instance of your view controller class\n    MyViewController *viewController = [[MyViewController alloc] init];\n\n    // create the view model for the navigation coordinator\n    ALNavigationCoordinatorViewModel *navViewModel = [[ALNavigationCoordinatorViewModel alloc] init];\n\n    // tweak the default values. see ALNavigationCoordinatorViewModel.h for configurable properties. \n    navViewModel.buttonCanBeRepositioned = YES;\n\n    // create the navigation coordinator with the menu view controller and your app's root view controller. the \n    // root view controller can be an instance of UIViewController or UINavigationController\n    //\n    _navigationCoordinator = [[ALNavigationCoordinator alloc] initWithViewModel:navViewModel menuViewController:menuViewController rootViewController:rootViewController];\n\n    // and be sure to assign yourself as the delegate. if you configure the navigation coordinator with a navigation\n    // controller (instead of a root view controller), the coordinator will need to assign itself as that navigation \n    // controller's delegate, so you can optionally receive those delegate callbacks via this assignment. just \n    // implement the methods. \n    //\n    _navigationCoordinator.delegate = self;\n\n    return self;\n}\n\n- (void)viewDidLoad\n{\n    [super viewDidLoad];\n\n    // the navigation coordinator creates a navigation controller configured with the provided \n    // menu view controller and root view controller. we need to add that navigation controller\n    // to the view heirarchy\n    //\n    UIViewController *childViewController = self.navigationCoordinator.navigationController;\n\n    // then add it as a child view controller\n    [self addChildViewController:childViewController];\n    [self.view addSubview:childViewController.view];\n    [childViewController didMoveToParentViewController:self];\n\n    // then notify the navigation coordinator about our viewDidLoad event\n    [self.navigationCoordinator viewDidLoad];\n}\n\n#pragma mark - ALNavigationCoordinatorDelegate\n\n// be sure to implement the navigation coordinator's delegate method. it will fire when an item in the menu view controller is \n// tapped. return your specific UIViewController instance for that index. \n//\n- (UIViewController *)navigationCoordinator:(ALNavigationCoordinator *)navigationCoordinator viewControllerForMenuItemAtIndex:(NSUInteger)index\n{\n    return [[MyViewController alloc] init];\n}\n\n#pragma mark - Status bar\n\n// optionally, return the menu view controller in this method to hide the status bar when the menu is shown. \n- (UIViewController *)childViewControllerForStatusBarHidden\n{\n    return self.navigationCoordinator.menuViewController;\n}\n\n#pragma mark - Rotation\n\n// be sure to alert the navigation coordinator about size change events.\n- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id\u003cUIViewControllerTransitionCoordinator\u003e)coordinator\n{\n    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];\n\n    [self.navigationCoordinator viewWillTransitionToSize:size withTransitionCoordinator:coordinator];\n}\n\n```\n\n## Contact Me\n\nYou can reach me anytime at the addresses below. If you use ALButtonMenu, feel free to give me a shoutout on Twitter to let me know how you like it. I'd love to hear your thoughts! \n\nGithub: [lobianco](https://github.com/lobianco) \u003cbr\u003e\nEmail: [anthony@lobian.co](mailto:anthony@lobian.co) \n\n## Credits \u0026 License\n\nALButtonMenu is developed and maintained by Anthony Lobianco. Licensed under the MIT License. Basically, I would appreciate attribution if you use it.\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flobianco%2Falbuttonmenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flobianco%2Falbuttonmenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flobianco%2Falbuttonmenu/lists"}