{"id":23327787,"url":"https://github.com/joncardasis/sizeslidebutton","last_synced_at":"2025-08-22T21:32:10.388Z","repository":{"id":62455550,"uuid":"64312492","full_name":"joncardasis/SizeSlideButton","owner":"joncardasis","description":"A fun Swift UIControl for picking a size","archived":false,"fork":false,"pushed_at":"2017-03-14T14:50:01.000Z","size":560,"stargazers_count":53,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-17T16:27:26.988Z","etag":null,"topics":["animation","button","cocoapods","control","ios-animation","picker","size","slide","slider","slider-animation","swift","swift-uicontrol"],"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/joncardasis.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-07-27T13:52:07.000Z","updated_at":"2025-03-13T06:29:34.000Z","dependencies_parsed_at":"2022-11-02T00:16:52.317Z","dependency_job_id":null,"html_url":"https://github.com/joncardasis/SizeSlideButton","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/joncardasis/SizeSlideButton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2FSizeSlideButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2FSizeSlideButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2FSizeSlideButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2FSizeSlideButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joncardasis","download_url":"https://codeload.github.com/joncardasis/SizeSlideButton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2FSizeSlideButton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271703779,"owners_count":24806527,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["animation","button","cocoapods","control","ios-animation","picker","size","slide","slider","slider-animation","swift","swift-uicontrol"],"created_at":"2024-12-20T20:23:43.939Z","updated_at":"2025-08-22T21:32:09.346Z","avatar_url":"https://github.com/joncardasis.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SizeSlideButton\n![Supported Version](https://img.shields.io/badge/Swift-3-yellow.svg)\n![Platform](https://img.shields.io/badge/platform-iOS-lightgray.svg)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n![CocoaPods](https://img.shields.io/badge/CocoaPods-1.5-green.svg)\n\nA fun Swift UIControl for picking a size.\n![Demo Animation](../assets/demo.gif?raw=true)\n\n## Installation\n### Cocoapods\nAdd `pod 'SizeSlideButton'` to your Podfile.\n### Manually\nAdd the `SizeSlideButton.swift` class to your project.\n\n## Examples\n```Swift\nlet condensedFrame = CGRect(x: 280, y: 70, width: 32, height: 32) //Width and Height should be equal\nlet fancyControl = SizeSlideButton(condensedFrame: condensedFrame)\n\nfancyControl.trackColor = UIColor(red: 38/255, green: 50/255, blue: 56/255, alpha: 1)\nfancyControl.handle.color = UIColor.white\nfancyControl.addTarget(self, action: #selector(newSizeSelected), for: .touchDragFinished)\nfancyControl.addTarget(self, action: #selector(sizeSliderTapped), for: .touchUpInside)\nself.view.addSubview(fancyControl)\n\n\nfunc newSizeSelected(_ sender: SizeSlideButton){\n    //Do something once a size is selected and the control let go\n    // You can now use the senders .value for a value between 0 and 1\n    // Or use the handle's height (handle.height) as a multiplier for size\n    print(\"Value: \\(sender.value)\")\n    print(\"Size multiplier: \\(sender.handle.height)\")\n\n    // Ex: self.paintbrush.brushSize = kDefaultBrushSize * sender.handle.height\n}\n\nfunc sizeSliderTapped(_ sender: SizeSlideButton){\n    //Do something when the button is tapped\n    print(\"Tip Tap\")\n }\n```\nOutput:\n\n\u003cimg src=\"../assets/darkScreenshot.png?raw=true\" width=\"350\"\u003e\n\n### Via Interface Builder\nSizeSlideButton can also be created right from the Interface Builder and allows basic properties to be edited. \n\u003cimg src=\"../assets/StoryboardScreenshot.png?raw=true\" width=\"450\"\u003e\n\n\n## Documentation\n+ `init(condensedFrame: CGRect)` will set the frame of where the condensed frame should lie (width and height should be equal)\n+ `init(frame: CGRect)` will set the frame of where the frame should lie when fully expanded\n+ `currentSize` to obtain the size the person has selected\n+ `handlePadding` sets the padding around the handle (default is the left side's radius). Works best as \u003c= leftSideRadius\n+ `handle.color` is the slider's handle color\n+ `handle.height`/`handle.width` gets the sizes of the handle and can be best used as a multiplier against a constant default size\n+ `trackColor` is the color of the track\n+ `value` is a value between 0 and 1.0 of where the handle was positioned relative on the track\n+ `leftSideRadius` and `rightSideRadius` return the radii of the left and right sides of the frame when expanded\n+ `currentState` returns if the control is condensed or expanded\n+ `animationType` specifies the animation type used when letting go of the control\n\n## Supported UIControlEvents\n+ `touchUpInside` is called when a tap on the control is released\n+ `valueChanged` is called when the slider is moved\n+ `touchDown` is called both when a long press is detected or a regular touch is detected\n+ `touchDragFinished` (A custom UIControlEvent) is called when the slider has selected a new value and been released\n\n\n## License\nSizeSlideButton is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncardasis%2Fsizeslidebutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoncardasis%2Fsizeslidebutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncardasis%2Fsizeslidebutton/lists"}