{"id":15293579,"url":"https://github.com/kysomers/buttonwheel","last_synced_at":"2025-04-13T14:07:29.491Z","repository":{"id":56904074,"uuid":"94374906","full_name":"kysomers/ButtonWheel","owner":"kysomers","description":"A wheel shaped object that holds a collection of buttons for iOS","archived":false,"fork":false,"pushed_at":"2017-07-15T16:44:51.000Z","size":86,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T14:07:23.808Z","etag":null,"topics":["button","swift","swift3","wheel"],"latest_commit_sha":null,"homepage":null,"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/kysomers.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-06-14T21:33:18.000Z","updated_at":"2020-07-04T02:34:03.000Z","dependencies_parsed_at":"2022-08-21T02:50:18.212Z","dependency_job_id":null,"html_url":"https://github.com/kysomers/ButtonWheel","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/kysomers%2FButtonWheel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kysomers%2FButtonWheel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kysomers%2FButtonWheel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kysomers%2FButtonWheel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kysomers","download_url":"https://codeload.github.com/kysomers/ButtonWheel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724637,"owners_count":21151561,"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":["button","swift","swift3","wheel"],"created_at":"2024-09-30T16:50:03.821Z","updated_at":"2025-04-13T14:07:29.467Z","avatar_url":"https://github.com/kysomers.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ButtonWheel\n\nButtonWheel lets you create a circular collection of buttons. It's recommended for use whenever an app would want to give a lot of options or centralized navigation with a sleek, modern look. It allows for customization on images and labels for the buttons as well as more basic attributes like color, dimension, and shape.\n\nYou can import it into your project by putting this into your podfile:\n\n`pod 'ButtonWheel'`\n\n\u003cimg src=\"http://i.imgur.com/FSdk7kE.png\" width=\"250\"\u003e\n\n\n## Use\n\nAfter importing it into your project by putting `pod 'ButtonWheel'` in your podfile under frameworks and entering `pod install` into the command line. You can use ButtonWheel in any file by writing `import ButtonWheel` in that file.\n\n#### ButtonWheel\n\n`init?(coder aDecoder: NSCoder)` or `override init(frame: CGRect) `\n\nButtonWheel inherits from UIView. It can be instantiated either in storyboard or programmatically with the methods above from its superclass.\n\nIf you do instantiate it using an IBOutlet to storyboard, be sure to set both the class and the module in storyboard like this.\n\n\u003cimg src=\"http://i.imgur.com/WKR1W5x.png\" width=\"250\"\u003e\n\n\n`func setupWith(buttonPieces : [ButtonPiece], middleRadius : MiddleRadiusSize)`\n\nA setup function that must be called after initialization to build the view according to how it should look. The `middleRadius` parameter controls how big the hole in the middle of the wheel will be. `MiddleRadiusSize` is an enum with the cases `.small`, `.medium`, and `.large`. `buttonPieces` takes in an array of `ButtonPiece` which is a type that we will use to construct each section of the ButtonWheel.\n\n#### ButtonWheelDelegate\n\n\n`func didTapButtonWheelAtName(name : String)`\n\nThis is the function that will be called in the ButtonWheel's delegate to handle the buttons being pressed. The parameter passed into the function will be the name that you assigned to the tapped button.\n\n#### ButtonPiece\n\n`init(name : String, color : UIColor, centerOffset : CGPoint)`\n\nEach ButtonPiece must be given a name, which will correspond to the label if you decide to add one using `setLabel(...)`. The name will also match the name that is passed into `didTapButtonWheelAtName(name : String)` when it is called in the ButtonWheel's delegate. The `color` parameter is going to be the background color for the button, and `centerOffset` will allow the user to move the image and label from its default position on the ButtonPiece.\n\n`func setImage(image: UIImage, imageViewSize : CGSize, tintColor : UIColor?)`\n\nThis sets an image, which will appear on the ButtonPiece when the ButtonWheel is set up with that piece. The parameters correspond respectively to the image itself, the size you want to set for it, and the tint color for the image. If you don't want to have a tint color, you can set this parameter to `nil`. Calling this after `setLabel(...)` won't replace the label, instead it will add the image along with the label.\n\n`func setLabel(maxLabelWidth : CGFloat, labelFont : UIFont, textColor : UIColor)`\n\nThis sets a label, which will appear on the ButtonPiece when the ButtonWheel is set up with that piece. The parameters respectively correspond to the maximum width the label should have, the font for the label, and the label's text color. Calling this after `setImage(...)` won't replace the image, instead it will add the label along with the image.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkysomers%2Fbuttonwheel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkysomers%2Fbuttonwheel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkysomers%2Fbuttonwheel/lists"}