{"id":18390838,"url":"https://github.com/sarunw/swsegmentedcontrol","last_synced_at":"2025-04-07T02:35:27.833Z","repository":{"id":56444973,"uuid":"50564842","full_name":"sarunw/SWSegmentedControl","owner":"sarunw","description":"A Android-like tab bar, drop-in replacement for UISegmentedControl.","archived":false,"fork":false,"pushed_at":"2020-06-23T04:06:24.000Z","size":138,"stargazers_count":123,"open_issues_count":10,"forks_count":24,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-24T03:23:37.801Z","etag":null,"topics":["android","ios","segmented-control","swift","tabbar"],"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/sarunw.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-01-28T07:29:37.000Z","updated_at":"2024-01-19T11:43:06.000Z","dependencies_parsed_at":"2022-08-15T18:50:44.382Z","dependency_job_id":null,"html_url":"https://github.com/sarunw/SWSegmentedControl","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarunw%2FSWSegmentedControl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarunw%2FSWSegmentedControl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarunw%2FSWSegmentedControl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarunw%2FSWSegmentedControl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarunw","download_url":"https://codeload.github.com/sarunw/SWSegmentedControl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247583712,"owners_count":20962066,"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","ios","segmented-control","swift","tabbar"],"created_at":"2024-11-06T01:49:24.409Z","updated_at":"2025-04-07T02:35:22.950Z","avatar_url":"https://github.com/sarunw.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SWSegmentedControl\n\nA Android-like tab bar, drop-in replacement for UISegmentedControl written in Swift.\n\n![Live Demo](https://cloud.githubusercontent.com/assets/795368/12671575/2345a69a-c6a3-11e5-94f6-e8cd9e7c0be9.gif)\n\n## Requirements\n\nRequires iOS 8.0 and ARC.\n\n## Installation\n\nSWSegmentedControl is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"SWSegmentedControl\"\n```\n\n## Usage\n\nSWSegmentedControl can only be init in code due to the limitation of @IBDesignable which can't generate array of item like what UISegmentedControl can do, but I make it renderable anyway just in case you want to play around with it.\n\n### Basic usage\n\n```swift\nlet sc = SWSegmentedControl(items: [\"A\", \"B\", \"C\"])\nsc.frame = CGRect(x: 0, y: 0, width: 300, height: 44)\nsc.selectedSegmentIndex = 2 // default to 0\n```\n\n### Change segment programmatically\n\nSetting property directly will change segment without animation\n\n```swift\nsc.selectedSegmentIndex = 1\n```\n\nIf you want fine-grain control over animation, you can use `setSelectedSegmentIndex(index: Int, animated: Bool`\n\n```swift\nsc.setSelectedSegmentIndex(1, animated: true)\n```\n\n### Customization\n\nBy default both text and indicator color are the same with `tintColor`. If you want to change theme independently you can use `titleColor` and `indicatorColor` and you can also change font by set `font`.\n\n## Author\n\nSarun Wongpatcharapakorn (artwork.th@gmail.com) Twitter: [@sarunw](https://twitter.com/sarunw)\n\n## License\n\nSWSegmentedControl 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%2Fsarunw%2Fswsegmentedcontrol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarunw%2Fswsegmentedcontrol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarunw%2Fswsegmentedcontrol/lists"}