{"id":13466827,"url":"https://github.com/JaleelNazir/MJMaterialSwitch","last_synced_at":"2025-03-26T00:31:33.372Z","repository":{"id":96016312,"uuid":"86032649","full_name":"JaleelNazir/MJMaterialSwitch","owner":"JaleelNazir","description":"A Customizable Switch UI for iOS, Inspired from Google's Material Design in Swift","archived":false,"fork":false,"pushed_at":"2021-04-20T02:07:33.000Z","size":205,"stargazers_count":69,"open_issues_count":1,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-29T20:33:30.747Z","etag":null,"topics":["android","animation","ios","material","material-design","material-ui","mjmaterialswitch","ripple","rippleview","swift","switch","uicontrol","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/JaleelNazir.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-03-24T06:01:03.000Z","updated_at":"2024-04-24T05:31:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc698bca-9d91-4a47-b4bc-0131f9510496","html_url":"https://github.com/JaleelNazir/MJMaterialSwitch","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaleelNazir%2FMJMaterialSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaleelNazir%2FMJMaterialSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaleelNazir%2FMJMaterialSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaleelNazir%2FMJMaterialSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaleelNazir","download_url":"https://codeload.github.com/JaleelNazir/MJMaterialSwitch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245566098,"owners_count":20636390,"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":["android","animation","ios","material","material-design","material-ui","mjmaterialswitch","ripple","rippleview","swift","switch","uicontrol","uiswitch"],"created_at":"2024-07-31T15:00:50.458Z","updated_at":"2025-03-26T00:31:33.036Z","avatar_url":"https://github.com/JaleelNazir.png","language":"Swift","funding_links":["https://paypal.me/mjaleelnazir"],"categories":["Libs","Toggle","UI [🔝](#readme)","Content"],"sub_categories":["UI","Switch"],"readme":"# MJMaterialSwitch\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/JaleelNazir/MJMaterialSwitch/blob/master/TiitleTheme.png\"  style=\"width: 600px;\" /\u003e\n\u003c/p\u003e\n\n## Overview\n\u003cimg src=\"MJMaterialSwitch.png\" width=\"250\" align=\"right\" /\u003e\n\n`MJMaterialSwitch` is google's material design like switch UI with animation features.\n\nThis library has cool and sophisticated animations, ripple effect and bounce effect. Also, customizable properties can be tweaked behaviors and enhance your application UI cool.\n\nWith this library, you can easily implement material design switch to your app. \n\n\u003cimg src=\"MJMaterialSwitch1.png\" width=\"600\" align=\"center\" /\u003e\n\n\u003cbr/\u003e\n\n\u003cbr/\u003e\n\n## Usage\n\nThe simplest setup by code:\n\n```Swift \nlet xPos: CGFloat = (UIScreen.main.bounds.width / 2 ) - 22.5\nlet yPos: CGFloat = (UIScreen.main.bounds.height / 2 ) + 50.0\nself.switch2 = MJMaterialSwitch(frame: CGRect(x: xPos , y: yPos, width: 64, height: 60))\nself.switch2.addTarget(self, action: #selector(switchStateChanged(_:)), for: UIControl.Event.valueChanged)\nself.switch2.tarckEdgeInset = UIEdgeInsets(top: 18, left: 0, bottom: 18, right: 0)\nself.switch2.tag = 2\nswitch2.trackOnTintColor = UIColor.red.withAlphaComponent(0.6)\nswitch2.thumbOnTintColor = UIColor.red\n\n// Call update UI method in last.\nswitch2.updateUI()\n\nself.view.addSubview(self.switch2)\n```\n\nThis is the simplest and easiest initialization. \n\n## Usage by xib and Storyboard\n\n - Create `UIView` and set the `MJMaterialSwitch` class.\n - Create `IBOutlet` to add `valueChanged` target for the click actions\n\n### Customize Behaviors\nMJMaterialSwitch has many prateters to customize behaviors as you like.\n\n#### Style and size\n```\n\nvar thumbOnTintColor: UIColor!\nvar thumbOffTintColor: UIColor!\n\nvar trackOnTintColor: UIColor!\nvar trackOffTintColor: UIColor!\n\nvar thumbDisabledTintColor: UIColor!\nvar trackDisabledTintColor: UIColor!\n\nvar isBounceEnabled: Bool = false\nvar isRippleEnabled: Bool = true\nvar rippleFillColor: UIColor = .gray\n    \n```\n\n## Author\nJaleel Nazir \u003cnazirjaleel@gmail.com\u003e\n\u003cbr\u003e\nBuy me coffe:\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://paypal.me/mjaleelnazir)\n\n## License\nMJMaterialSwitch is available under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaleelNazir%2FMJMaterialSwitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJaleelNazir%2FMJMaterialSwitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaleelNazir%2FMJMaterialSwitch/lists"}