{"id":2793,"url":"https://github.com/T-Pham/Switch","last_synced_at":"2025-08-06T16:31:26.700Z","repository":{"id":62453004,"uuid":"66821359","full_name":"T-Pham/Switch","owner":"T-Pham","description":"💊 An iOS switch control implemented in Swift with full Interface Builder support","archived":false,"fork":false,"pushed_at":"2021-07-09T22:39:09.000Z","size":301,"stargazers_count":145,"open_issues_count":0,"forks_count":26,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-11T05:47:38.806Z","etag":null,"topics":["cartfile","carthage","cocoapods","interface-builder","ios","podfile","storyboard","swift","uiswitch"],"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/T-Pham.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-08-29T07:25:21.000Z","updated_at":"2022-12-07T15:45:54.000Z","dependencies_parsed_at":"2022-11-01T23:46:32.998Z","dependency_job_id":null,"html_url":"https://github.com/T-Pham/Switch","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Pham%2FSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Pham%2FSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Pham%2FSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Pham%2FSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/T-Pham","download_url":"https://codeload.github.com/T-Pham/Switch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923696,"owners_count":17992567,"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":["cartfile","carthage","cocoapods","interface-builder","ios","podfile","storyboard","swift","uiswitch"],"created_at":"2024-01-05T20:16:23.003Z","updated_at":"2024-12-09T16:31:05.016Z","avatar_url":"https://github.com/T-Pham.png","language":"Swift","funding_links":[],"categories":["UI","Libs","Toggle","UI [🔝](#readme)","Swift"],"sub_categories":["Switch","UI","Layout","Other free courses"],"readme":"```\n'   :::===  :::  ===  === ::: :::==== :::===== :::  ===\n'   :::     :::  ===  === ::: :::==== :::      :::  ===\n'    =====  ===  ===  === ===   ===   ===      ========\n'       ===  ===========  ===   ===   ===      ===  ===\n'   ======    ==== ====   ===   ===    ======= ===  ===\n'                                                              \n```\n\n# Switch\n\n[![CI Status](https://img.shields.io/travis/T-Pham/Switch/master.svg?style=flat-square)](https://travis-ci.org/T-Pham/Switch)\n[![GitHub issues](https://img.shields.io/github/issues/T-Pham/Switch.svg?style=flat-square)](https://github.com/T-Pham/Switch/issues)\n[![Codecov](https://img.shields.io/codecov/c/github/T-Pham/Switch.svg?style=flat-square)](https://codecov.io/gh/T-Pham/Switch)\n[![Documentation](https://img.shields.io/cocoapods/metrics/doc-percent/RoundedSwitch.svg?style=flat-square)](http://cocoadocs.org/docsets/RoundedSwitch)\n\n[![GitHub release](https://img.shields.io/github/tag/T-Pham/Switch.svg?style=flat-square\u0026label=release)](https://github.com/T-Pham/Switch/releases)\n[![Platform](https://img.shields.io/cocoapods/p/RoundedSwitch.svg?style=flat-square)](https://github.com/T-Pham/Switch)\n[![License](https://img.shields.io/cocoapods/l/Switch.svg?style=flat-square)](LICENSE)\n\n[![SwiftPM](https://img.shields.io/badge/SwiftPM-compatible-4BC51D.svg?style=flat-square)](https://swift.org/package-manager)\n[![Carthage](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat-square)](https://github.com/Carthage/Carthage)\n[![CocoaPods](https://img.shields.io/badge/CocoaPods-compatible-4BC51D.svg?style=flat-square)](https://cocoapods.org/pods/RoundedSwitch)\n\n## Description\n\nAn iOS switch control implemented in Swift with full Interface Builder support.\n\nTo run the demo project:\n\n`pod try RoundedSwitch`\n\n![Switch](https://github.com/T-Pham/Switch/blob/master/switch.gif?raw=true)\n\n![Switch](https://github.com/T-Pham/Switch/blob/master/switch.png?raw=true)\n\n## Usage\n\nEither config the switch in the Interface Builder or programatically as follow:\n\n```swift\nimport Switch\n...\nlet mySwitch = Switch()\nmySwitch.leftText = \"Windows\"\nmySwitch.rightText = \"Mac\"\nmySwitch.rightSelected = true\nmySwitch.tintColor = UIColor.purple\nmySwitch.disabledColor = mySwitch.tintColor.withAlphaComponent(0.4)\nmySwitch.backColor = mySwitch.tintColor.withAlphaComponent(0.05)\nmySwitch.sizeToFit()\nmySwitch.addTarget(self, action: #selector(ViewController.switchDidChangeValue(_:)), for: .valueChanged)\n```\n\nPlease note that the module name is `Switch`. However, when installed with CocoaPods, it is `RoundedSwitch`.\n\nPlease see the [Reference Documentation](http://cocoadocs.org/docsets/RoundedSwitch) for details.\n\n## Installation\n\n### [Swift Package Manager](https://swift.org/package-manager)\n\nIn Xcode, select `File-\u003eSwift Packages-\u003eAdd Package Dependency...` and follow the instructions on-screen.\nUse the following repo URL when prompted.\n\n```\nhttps://github.com/T-Pham/Switch\n```\n\n### [Carthage](https://github.com/Carthage/Carthage)\n\nAdd the line below to your Cartfile:\n\n```ruby\ngithub \"T-Pham/Switch\"\n```\n\n### [CocoaPods](https://cocoapods.org/pods/RoundedSwitch)\n\nAdd the line below to your Podfile:\n\n```ruby\npod 'RoundedSwitch'\n```\n\n### Manually\n\nAdd the file [`Switch.swift`](Switch.swift) to your project. You are all set.\n\n## Compatibility\nFrom version 2.0.0, Swift 3 syntax is used. If your project is still using Swift version 2, please use a UITextField-Navigation version prior to 2.0.0.\n\nPodfile\n\n```ruby\npod 'RoundedSwitch', '~\u003e 1.0.3'\n```\n\nor Cartfile\n\n```ruby\ngithub \"T-Pham/Switch\" ~\u003e 1.0.3\n```\n\n## License\n\nSwitch is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FT-Pham%2FSwitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FT-Pham%2FSwitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FT-Pham%2FSwitch/lists"}