{"id":2639,"url":"https://github.com/robertherdzik/RHSideButtons","last_synced_at":"2025-08-03T00:32:17.395Z","repository":{"id":62451978,"uuid":"59952319","full_name":"robertherdzik/RHSideButtons","owner":"robertherdzik","description":"Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app small side menu. 🌶","archived":false,"fork":false,"pushed_at":"2019-10-05T17:05:09.000Z","size":4753,"stargazers_count":165,"open_issues_count":6,"forks_count":22,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-24T14:50:38.943Z","etag":null,"topics":["action-buttons","android","buttons","demo","floating","material","menu","rhsidebuttons-library","sidemenu"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/robertherdzik.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":"2016-05-29T16:13:07.000Z","updated_at":"2024-04-13T02:51:35.000Z","dependencies_parsed_at":"2022-11-01T23:45:35.163Z","dependency_job_id":null,"html_url":"https://github.com/robertherdzik/RHSideButtons","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertherdzik%2FRHSideButtons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertherdzik%2FRHSideButtons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertherdzik%2FRHSideButtons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertherdzik%2FRHSideButtons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertherdzik","download_url":"https://codeload.github.com/robertherdzik/RHSideButtons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510759,"owners_count":17931760,"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":["action-buttons","android","buttons","demo","floating","material","menu","rhsidebuttons-library","sidemenu"],"created_at":"2024-01-05T20:16:18.988Z","updated_at":"2024-12-06T18:30:39.546Z","avatar_url":"https://github.com/robertherdzik.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["Menu","Layout","Other free courses"],"readme":"![](./ReadmeAssets/RHSideButtonsHeadLogo.gif)\n\n[![Version](https://img.shields.io/cocoapods/v/RHSideButtons.svg?style=flat)](http://cocoadocs.org/docsets/RHSideButtons)\n[![License](https://img.shields.io/cocoapods/l/BadgeSwift.svg?style=flat)](/LICENSE)\n[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat)](https://developer.apple.com/iphone/index.action)\n[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat)](https://developer.apple.com/swift)\n[![Twitter](https://img.shields.io/twitter/follow/Roherdzik.svg?style=social\u0026label=Follow)](https://twitter.com/Roherdzik)\n\n# RHSideButtons 🌶\nLibrary provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app small side menu. 🌶\n\n## Play with it 😎\n\n## Installation\nYou can install RHSideButtons library using CocoaPods:\n```\npod 'RHSideButtons'\n```\nor you can simply copy ```RHSideButtons``` folder to your project.\n\n## Usage\nYou just need implement `RHSideButtonsDataSource` and `RHSideButtonsDelegate` similar to well-known UIKit design.\n\n```swift\n// You need to firstly create trigger button. You can do this using block or your builder object which should conform to 'RHButtonViewConfigProtocol'\n// RHTriggerButtonView allows you to change image for pressed state! 👌🏻\nlet triggerButton = RHTriggerButtonView(pressedImage: UIImage(named: \"exit_icon\")!) {\n    $0.image = UIImage(named: \"trigger_img\")\n    $0.hasShadow = true\n}\n\n// Then you need to create instance of SideButtons coordinator class with your View Controller view (it can be even TableView)\nsideButtonsView = RHSideButtons(parentView: view, triggerButton: triggerButton)\nsideButtonsView.delegate = self\nsideButtonsView.dataSource = self\n\n// When SideButtons controller is initialized properly you should set thier position in view in e.g. viewWillAppear method:\noverride func viewWillAppear(animated: Bool) {\n    super.viewWillAppear(animated)\n\n    sideBttns?.setTriggerButtonPosition(CGPoint(x: bounds.width - 85, y: bounds.height - 85))\n}\n```\n\n... let us prepare our data models for buttons 💥 below you can see one of many ways to do this:\n\n```swift\n//Finally you should create array of buttons which will feed our dataSource and Delegate methods :) e.g.:\nlet button_1 = RHButtonView {\n    $0.image = UIImage(named: \"icon_1\")\n    $0.hasShadow = true\n}\n\nlet button_2 = RHButtonView {\n    $0.image = UIImage(named: \"icon_2\")\n    $0.hasShadow = true\n}\n\nlet button_3 = RHButtonView {\n    $0.image = UIImage(named: \"icon_3\")\n    $0.hasShadow = true\n}\n\nbuttonsArr.appendContentsOf([button_1, button_2, button_3])\n\n//Similar as it is in TableView, now you should reload buttons with new values\nsideButtonsView.reloadButtons()\n```\n💡 important thing is that you need to reload buttons when your datasource has changed using ```reloadButtons()``` method (😱 simple right❓)\n\n### RHSideButtonsDataSource\n```swift\nfunc sideButtonsNumberOfButtons(sideButtons: RHSideButtons) -\u003e Int\nfunc sideButtons(sideButtons: RHSideButtons, buttonAtIndex index: Int) -\u003e RHButtonView\n```\n\n### RHSideButtonsDelegate\n```swift\nfunc sideButtons(sideButtons: RHSideButtons, didSelectButtonAtIndex index: Int)\nfunc sideButtons(sideButtons: RHSideButtons, didTriggerButtonChangeStateTo state: RHButtonState)\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src =\"./Demo/RHSideButtons_R.gif\" width=\"252\"align=\"center\"/\u003e\n\u003c/p\u003e\n\n## Support for left-handers :)\nIf you decide to position RHSideButtons on the left site of view, buttons will dissapears to the left side of screen automatically.\n\ne.g.:\n```swift\nsideBttns?.setTriggerButtonPosition(CGPoint(x:25, y: frame.size.height - 85))\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg src =\"./Demo/RHSideButtons_L.gif\" width=\"252\" align=\"center\"/\u003e\n\u003c/p\u003e\n\n\n## Swift support\n| Library ver| Swift ver| \n| ------------- |:-------------:| \n| 1.0   | 2.2 |\n| 1.0.1   | 3.0 |\n| 1.1.0   | 4.0 |\n\n## Check the Demo project \n\nPlease check out the demo project, you can see there what is the best (in my opinion 🤔) way to implement my buttons. Please keep in mind that Readme contains the simplest way to implement this control.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertherdzik%2FRHSideButtons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertherdzik%2FRHSideButtons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertherdzik%2FRHSideButtons/lists"}