{"id":20105089,"url":"https://github.com/jdee/ios-knob-control","last_synced_at":"2025-05-06T09:31:07.309Z","repository":{"id":13690574,"uuid":"16384387","full_name":"jdee/ios-knob-control","owner":"jdee","description":"A generic, reusable knob control for iOS","archived":false,"fork":false,"pushed_at":"2017-11-13T07:40:09.000Z","size":1698,"stargazers_count":95,"open_issues_count":15,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2023-03-11T09:12:50.668Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdee.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-30T17:21:07.000Z","updated_at":"2022-12-11T05:08:37.000Z","dependencies_parsed_at":"2022-08-29T23:20:55.175Z","dependency_job_id":null,"html_url":"https://github.com/jdee/ios-knob-control","commit_stats":null,"previous_names":[],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fios-knob-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fios-knob-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fios-knob-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdee%2Fios-knob-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdee","download_url":"https://codeload.github.com/jdee/ios-knob-control/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224498992,"owners_count":17321591,"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-13T17:45:48.443Z","updated_at":"2024-11-13T17:45:49.259Z","avatar_url":"https://github.com/jdee.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Knobs in the App Store\n======================\n\nDubsar\n------\n\n![Dubsar](http://i.imgur.com/KRwnpfX.png)\n\n[Dubsar](https://github.com/jdee/dubsar_ios) is an open-source dictionary app by the\nsame author that supports different themes (fonts, color schemes). A knob is used to\nselect themes within the app. The theme changes as the knob rotates, including the\ntheming of the generated discrete knob itself.\n\nDubsar is available for free on the [App Store.](https://itunes.apple.com/us/app/dubsar/id453868483?mt=8)\n\ncpyn\n----\n\n![cpyn audio settings](http://i.imgur.com/WnbyWvP.png)\n![cpyn cross feed settings](http://i.imgur.com/VYrcxFb.png)\n![cpyn reverb settings 1](http://i.imgur.com/zAdDiOB.png)\n![cpyn reverb settings 2](http://i.imgur.com/yICaI2W.png)\n\n[cpyn](https://itunes.apple.com/us/app/cpyn/id929721548?mt=8) is an audio-player app by\nthe same author inspired by the Spin tab in the demo\napps here. Unlike the demo here, cpyn provides an array of audio features like\nequalization, reverb and cross fading. It also allows you to play in reverse and scratch\nrecords as they play.\n\nQuite a few generated continuous knobs appear to adjust various audio settings. Unlike the\ndemos here, the knob control is not used\nfor the turntable, which is entirely built on OpenGL, not UIKit. Note that some settings\nsupport fine tuning via the vertical pan gesture vs. one-finger rotation.\n\nHave an app in the App Store using this knob control? Get in touch, and I'll post your\nscreenshot here.\n\niOS Knob Control\n================\n\n![Spin](http://i.imgur.com/S4nydoP.png)\n\u0026nbsp;\n![Continuous](http://i.imgur.com/5rGuswG.png)\n\u0026nbsp;\n![Rotary Dial](http://i.imgur.com/X7foOjx.png)\n\u0026nbsp;\n![Months](http://i.imgur.com/IUPMSMV.png)\n\nThis is a generic, reusable knob control you can insert into any application.\nYou may provide custom knob images or use the customizable default images.\nThe control animates rotation of the image in response to one of several\nconfigurable gestures from the user. The knob has a number of configurable modes:\n\n- Linear return mode: Like a circular generalization of the UIPickerView control.\n  Only certain discrete positions are allowed. The knob rotates\n  to follow the user's gesture, but on release returns to an allowed position.\n  The time scale for the return animation may be configured as a property of the control.\n- Wheel of Fortune mode: Like linear return, except for the animation after the\n  user releases the knob. Only a narrow strip between each pair of segments is excluded, like\n  the pegs on the rim of a carnival wheel. If the knob was released in one of those\n  small excluded strips, it rotates just far enough to exit the excluded strip.\n  Otherwise, the knob stays where the user leaves it. This mode is like continuous\n  mode except for the behavior in the excluded strips and the availability of the\n  positionIndex property.\n- Continuous mode: Like a circular generalization of the UISlider control or a\n  potentiometer/volume knob. Often used with min. and max. angles, but can also\n  be circular. Knob remains wherever the user leaves it and can attain any value\n  between the min. and max. equally.\n- Rotary dial mode: Like an old rotary telephone dial.\n\nIt responds to four different gestures, depending on the value of a property:\n\n- One-finger rotation: Custom gesture recognition. The spot under your finger tracks your touch\n  as you rotate the knob.\n- Two-finger rotation: The standard iOS two-finger rotation gesture.\n- Vertical pan: Drag your finger up or down to increase or decrease the value of the position\n  property, respectively.\n- Tap: Select a position for the knob or dial a number in rotary dial mode by tapping.\n\nThe knob control can be circular, permitting the user to rotate it all the way around,\nor it can have a min. and max. angle in continuous and discrete modes.\n\nThe control is distributed as a single pair of files (IOSKnobControl.h and IOSKnobControl.m\nin this directory), which you can simply drop into your project. Without any externally supplied image,\nthe control generates appropriate, customizable images in all modes. It can also accept externally\nsupplied images. You can use any of the images in the demo project here or supply your own.\n\nThe knob control and all images must be square. Images will usually be circles or regular polygons, with a\ntransparent background or a solid one that matches the view behind it. However, the aspect\nratio must be 1:1. The effect of the animation is circular rotation. This only works if the control\nis square. You can produce other effects, for example, by partially clipping a square control\nor using an oblong background. But the control itself always has to be square.\n\nThe control honors the enabled property. That is, if you set enabled to NO, it enters the\nUIControlStateDisabled and stops responding to user input. If specified, a disabled image is displayed\ninstead of the normal image. Even when disabled, the control's position may always be specified\nat any time programmatically, with or without animation. With appropriate images, a disabled knob control\nmay be used as a dial view to display a numeric value.\n\nThere are two demo apps, one in Objective-C, in the KnobControlDemo-ObjC subdirectory,\nand one in Swift, in the KnobControlDemo-Swift subdirectory. Both exercise the\nsame functionality using the same Objective-C knob control. Both demos contain projects that can be used to build\na simple demo app to exercise the different modes of the control and provide examples of use. Both use storyboards\nand autolayout and so require iOS 6.0 or greater. The control works on 64-bit\ndevices. (Swift requires both iOS 7.0 or greater on the device or simulator and Xcode6-Beta4 or later to compile\nSwift.)\n\nThe control itself, the IOSKnobControl class, may be compiled down to iOS 5.0, but the demo\nprojects will not build if the iOS Deployment Target is set below 6.0 for reasons that have\nnothing to do with the control. The control uses ARC, so it cannot be used below iOS 5.0\nwithout modification. It has not been tested below iOS 6.1, however, and there may be problems\nthere that have not yet been discovered.\n\nViolation\n---------\n\nSee [iOS Knob Control and Violation](https://gist.github.com/jdee/f3eeadeb0eaec725edd8).\n\nDocumentation\n-------------\n\nAll API documentation can be found in IOSKnobControl.h. Browsable HTML documentation generated from this source is\nchecked into this repository in the doc/html subdirectory. See doc/html/index.html.\n\n### Appledoc\n\nThe HTML documentation here is built with Appledoc. If you install Appledoc (from a distro like Homebrew or MacPorts\nor from source; see https://github.com/tomaz/appledoc#quick-install) you can use the build-appledoc script in this\ndirectory to update the HTML if it is out of date and install the documentation as a docset that you can view with\nXCode.\n\nReleases\n--------\n\nStable releases are indicated by tags in the repo (e.g., 1.1.0.2) and notes in the ChangeLog. When in doubt, use the last\nstable release tag as opposed to the HEAD revision. If no development has been done since the last release, those may be\nthe same revision.\n\nKnown Issues\n------------\n\nKnown bugs, planned enhancements and other issues are tracked on [Github](https://github.com/jdee/ios-knob-control/issues).\n\nMedia\n-----\n\nSome images (the nice ones) courtesy of Mike Calvert (@bloodymonster).\n\nLicense\n=======\n\nThe software and media here are available under [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause):\n\n```\nCopyright (c) 2013-14, Jimmy Dee\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted\nprovided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions\n   and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions\n   and the following disclaimer in the documentation and/or other materials provided with the\n   distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse\n   or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n    FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n    POSSIBILITY OF SUCH DAMAGE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Fios-knob-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdee%2Fios-knob-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdee%2Fios-knob-control/lists"}