{"id":21885123,"url":"https://github.com/qiudaniel/dqsegmentedcontrol","last_synced_at":"2025-03-22T01:40:58.872Z","repository":{"id":56907809,"uuid":"179924068","full_name":"QiuDaniel/DQSegmentedControl","owner":"QiuDaniel","description":"A drop-in replacement for UISegmentedControl mimicking the style of the segmented control","archived":false,"fork":false,"pushed_at":"2019-08-30T09:04:03.000Z","size":527,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T09:24:43.865Z","etag":null,"topics":["hmsegmentedcontrol","segmentcontrol","swift"],"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/QiuDaniel.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":"2019-04-07T05:54:52.000Z","updated_at":"2020-06-26T10:34:09.000Z","dependencies_parsed_at":"2022-08-21T03:50:22.007Z","dependency_job_id":null,"html_url":"https://github.com/QiuDaniel/DQSegmentedControl","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QiuDaniel%2FDQSegmentedControl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QiuDaniel%2FDQSegmentedControl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QiuDaniel%2FDQSegmentedControl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QiuDaniel%2FDQSegmentedControl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QiuDaniel","download_url":"https://codeload.github.com/QiuDaniel/DQSegmentedControl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244894308,"owners_count":20527669,"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":["hmsegmentedcontrol","segmentcontrol","swift"],"created_at":"2024-11-28T10:19:40.936Z","updated_at":"2025-03-22T01:40:58.855Z","avatar_url":"https://github.com/QiuDaniel.png","language":"Swift","readme":"# DQSegmentedControl\nA drop-in replacement for UISegmentedControl mimicking the style of the segmented control\n\n# Features\n- Supports text\n- Supports advanced title styling with text attributes for font, color, kerning, shadow, etc.\n- Supports selection indicator both on top and bottom\n- Works with ARC and iOS \u003e= 9\n\n## Todo\n- Supports images\n\n# Installation\n\n### CocoaPods\nThe easiest way of installing DQSegmentedControl is via [CocoaPods](http://cocoapods.org/). \n\n```\nNormal:\npod 'DQSegmentedControl'\n\nSupport RxSwift:\npod 'DQSegmentedControl/Rx'\n```\n\n# Usage\n\nThe code below will create a segmented control with the default looks:\n\n```  Swift\nlet control = DQSegmentedControl(frame: CGRect(x: 0, y: 34, width: UIScreen.main.bounds.width, height: 60))\ncontrol.sectionTitles = [\"大前天\",\"前天\", \"昨天\", \"今天\", \"明天\", \"后天\", \"大后天\"]\ncontrol.delegate = self\ncontrol.titleTextAttributes = [.font: UIFont.systemFont(ofSize: 16),.foregroundColor:UIColor.black]\ncontrol.selectedTitleTextAttributes = [.font: UIFont.boldSystemFont(ofSize: 16),.foregroundColor:UIColor.red]\ncontrol.selectionIndicatorHeight = 2\ncontrol.selectionIndicatorColor = UIColor.red\ncontrol.selectionIndicatorEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: -10, right: 0);\nview.addSubview(control)\n\n```\n\n# RxSwift\n\nNow SegmentedControlDelegate supports RxSwift, It can be use looks like:\n```  Swift\n    segmentControl.rx.didSelectedAt.subscribe(onNext: { index in\n        print(\"selectedAt======\u003e\\(index)\")\n    }).disposed(by: disposeBag)\n```\n\n\nIncluded is a demo project showing how to fully customise the control.\n![Show](https://github.com/QiuDaniel/DQSegmentedControl/blob/master/snap.gif)\n\n## Special Thanks to [@HeshamMegid](http://twitter.com/HeshamMegid), the project refer to his HMSegmentedControl much more.\n\n# License\n\nDQSegmentedControl is licensed under the terms of the MIT License. Please see the [LICENSE](LICENSE.md) file for full details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiudaniel%2Fdqsegmentedcontrol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqiudaniel%2Fdqsegmentedcontrol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiudaniel%2Fdqsegmentedcontrol/lists"}