{"id":13696296,"url":"https://github.com/yulingtianxia/YXYDashLayer","last_synced_at":"2025-05-03T17:30:50.111Z","repository":{"id":56929989,"uuid":"130333673","full_name":"yulingtianxia/YXYDashLayer","owner":"yulingtianxia","description":"Colorful Rounded Rect Dash Border","archived":false,"fork":false,"pushed_at":"2018-05-15T06:54:14.000Z","size":2898,"stargazers_count":177,"open_issues_count":1,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T03:39:37.114Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://yulingtianxia.com/blog/2018/04/30/Colorful-Rounded-Rect-Dash-Border/","language":"Objective-C","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/yulingtianxia.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":"2018-04-20T08:31:32.000Z","updated_at":"2024-11-08T15:24:36.000Z","dependencies_parsed_at":"2022-08-21T05:50:15.049Z","dependency_job_id":null,"html_url":"https://github.com/yulingtianxia/YXYDashLayer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yulingtianxia%2FYXYDashLayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yulingtianxia%2FYXYDashLayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yulingtianxia%2FYXYDashLayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yulingtianxia%2FYXYDashLayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yulingtianxia","download_url":"https://codeload.github.com/yulingtianxia/YXYDashLayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252226622,"owners_count":21714834,"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-08-02T18:00:38.214Z","updated_at":"2025-05-03T17:30:49.574Z","avatar_url":"https://github.com/yulingtianxia.png","language":"Objective-C","funding_links":[],"categories":["UI Components"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/yulingtianxia/YXYDashLayer.svg?branch=master)](https://travis-ci.org/yulingtianxia/YXYDashLayer)\n[![Version](https://img.shields.io/cocoapods/v/YXYDashLayer.svg?style=flat)](http://cocoapods.org/pods/YXYDashLayer)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License](https://img.shields.io/cocoapods/l/YXYDashLayer.svg?style=flat)](http://cocoapods.org/pods/YXYDashLayer)\n[![Platform](https://img.shields.io/cocoapods/p/YXYDashLayer.svg?style=flat)](http://cocoapods.org/pods/YXYDashLayer)\n[![CocoaPods](https://img.shields.io/cocoapods/dt/YXYDashLayer.svg)](http://cocoapods.org/pods/YXYDashLayer)\n[![CocoaPods](https://img.shields.io/cocoapods/at/YXYDashLayer.svg)](http://cocoapods.org/pods/YXYDashLayer)\n[![Twitter Follow](https://img.shields.io/twitter/follow/yulingtianxia.svg?style=social\u0026label=Follow)](https://twitter.com/yulingtianxia)\n\n# YXYDashLayer\n\n`YXYProgressDashLayer` is composed of `YXYColorfulDashLayer`, which is masked by `YXYMaskDashLayer`. They can draw dash rounded rects.\n\n`YXYMaskDashLayer` controls the dash path. `YXYColorfulDashLayer` is a subclass of `CAGradientLayer`, so it can draw colorful dash path. `YXYProgressDashLayer` uses two instances of `YXYColorfulDashLayer`.\n\n## 📚 Article\n\n[Colorful Rounded Rect Dash Border](http://yulingtianxia.com/blog/2018/04/30/Colorful-Rounded-Rect-Dash-Border/)\n\n## 🐒 Usage\n\n![](Assets/YXYDashLayer.gif)\n\n```\nself.progressDash = [YXYProgressDashLayer layer];\nself.progressDash.underLayer.colors = @[(id)[UIColor blueColor].CGColor, (id)[UIColor greenColor].CGColor];\nself.progressDash.progressColor = [UIColor grayColor];\n\nCGFloat radius = self.cornerRadiusSlider.value;\nself.progressDash.dashCornerRadius = radius;\n\nCGFloat dashGap = self.dashGapSlider.value;\nself.progressDash.dashGap = dashGap;\n\nCGFloat dashWidth = self.dashWidthSlider.value;\nself.progressDash.dashWidth = dashWidth;\n\nNSInteger count = self.totalCountSlider.value;\nself.progressDash.totalCount = count;\n\nself.progressDash.progress = self.grayCountSlider.value;\n\nCGRect dashRect = CGRectMake((self.view.frame.size.width - 200) / 2, 50, 200, 300);\nself.progressDash.frame = dashRect;\n[self.progressDash refresh];\n[self.view.layer addSublayer:self.progressDash];\n```\n\nFor better performance, you can use `refreshProgress` after modifying `totalCount`、`dashGap` and `progress`. NOTE: `refresh` must be called when `frame`, `dashWidth` or `dashCornerRadius` changes.\n\n![](Assets/YXYDashLayer.PNG)\n\n```\nCGRect dashRect = CGRectMake((self.view.frame.size.width - 200) / 2, 50, 200, 300);\nYXYColorfulDashLayer *layer1 = [YXYColorfulDashLayer layer];\nlayer1.colors = @[(id)[UIColor blueColor].CGColor, (id)[UIColor redColor].CGColor, (id)[UIColor greenColor].CGColor];\nlayer1.totalCount = 16;\nlayer1.dashCornerRadius = 10;\nlayer1.showIndexes = @[@4, @1, @2, @3, @5, @6, @7, @9, @10, @12, @13, @14, @15];\nlayer1.frame = dashRect;\n[layer1 refresh];\n    \nYXYColorfulDashLayer *layer2 = [YXYColorfulDashLayer layer];\nlayer2.colors = @[(id)[UIColor yellowColor].CGColor, (id)[UIColor yellowColor].CGColor];\nlayer2.totalCount = 16;\nlayer2.dashCornerRadius = 10;\nlayer2.showIndexes = @[@0, @8, @11];\nlayer2.frame = dashRect;\n[layer2 refresh];\n    \n[self.view.layer addSublayer:layer1];\n[self.view.layer addSublayer:layer2];\n```\n\n## 🔮 Example\n\nTo run the example project, clone the repo and run YXYDashLayerSample target.\n\n## 💰 Requirement\n\n- iOS 4.0+ \n- Xcode 9.0+\n\n## 📲 Installation\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate YXYDashLayer into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n\n```\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '11.0'\nuse_frameworks!\ntarget 'MyApp' do\n\tpod 'YXYDashLayer'\nend\n```\n\nYou need replace \"MyApp\" with your project's name.\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate YXYDashLayer into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"yulingtianxia/YXYDashLayer\"\n```\n\nRun `carthage update` to build the framework and drag the built `YXYDashLayerKit.framework` into your Xcode project.\n\n### Manual\n\nJust drag the \"Source\" document folder into your project.\n\n## ❤️ Contributed\n\n- If you **need help** or you'd like to **ask a general question**, open an issue.\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## 👨🏻‍💻 Author\n\nyulingtianxia, yulingtianxia@gmail.com\n\n## 👮🏻 License\n\nYXYDashLayer is available under the MIT license. See the LICENSE file for more info.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyulingtianxia%2FYXYDashLayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyulingtianxia%2FYXYDashLayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyulingtianxia%2FYXYDashLayer/lists"}