{"id":20945194,"url":"https://github.com/tbxark/pinterestsegment","last_synced_at":"2025-05-16T17:07:42.888Z","repository":{"id":14045197,"uuid":"75727869","full_name":"TBXark/PinterestSegment","owner":"TBXark","description":"A Pinterest-like segment control with masking animation.","archived":false,"fork":false,"pushed_at":"2024-08-21T09:12:28.000Z","size":406,"stargazers_count":692,"open_issues_count":14,"forks_count":56,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-16T17:07:02.613Z","etag":null,"topics":["cocoapods","coreanimation","ios-animation","pinterest","segment","swift","widget"],"latest_commit_sha":null,"homepage":"http://tbxark.com/2016/12/08/2016-12-08-Swift-Pinterst/","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/TBXark.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-06T12:08:42.000Z","updated_at":"2025-04-09T13:02:49.000Z","dependencies_parsed_at":"2025-04-04T10:00:46.132Z","dependency_job_id":"1b0aa80d-3b61-4e6e-a212-03d79dbb1e39","html_url":"https://github.com/TBXark/PinterestSegment","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2FPinterestSegment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2FPinterestSegment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2FPinterestSegment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2FPinterestSegment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TBXark","download_url":"https://codeload.github.com/TBXark/PinterestSegment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254573589,"owners_count":22093731,"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":["cocoapods","coreanimation","ios-animation","pinterest","segment","swift","widget"],"created_at":"2024-11-18T23:47:06.144Z","updated_at":"2025-05-16T17:07:42.870Z","avatar_url":"https://github.com/TBXark.png","language":"Swift","readme":"# PinterestSegment\n\u003e  A Pinterest-like segment control with masking animation.\n\n![Xcode 9.0+](https://img.shields.io/badge/Xcode-9.0%2B-blue.svg)\n![iOS 8.0+](https://img.shields.io/badge/iOS-8.0%2B-blue.svg)\n![Swift 4.0+](https://img.shields.io/badge/Swift-4.0%2B-orange.svg)\n[![Build Status](https://travis-ci.org/TBXark/PinterestSegment.svg?branch=master)](https://travis-ci.org/TBXark/PinterestSegment)\n[![CocoaPods](http://img.shields.io/cocoapods/v/PinterestSegment.svg?style=flat)](http://cocoapods.org/?q=PinterestSegment)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/TBXark/PinterestSegment/master/LICENSE)\n\n\n![](Example/demo.gif)\n\n## Requirements\n\n- iOS 8.0+\n- Xcode 9.0\n- Swift 4.0\n\n## Installation\n\n#### CocoaPods\nYou can use [CocoaPods](http://cocoapods.org/) to install `PinterestSegment` by adding it to your `Podfile`:\n\n```ruby\nplatform :ios, '8.0'\nuse_frameworks!\npod 'PinterestSegment'\n```\n\nTo get the full benefits import `PinterestSegment` wherever you import UIKit\n\n```swift\nimport UIKit\nimport PinterestSegment\n```\n#### Carthage\nCreate a `Cartfile` that lists the framework and run `carthage update`. Follow the [instructions](https://github.com/Carthage/Carthage#if-youre-building-for-ios) to add `$(SRCROOT)/Carthage/Build/iOS/PinterestSegment.framework` to an iOS project.\n\n```ruby\ngithub \"tbxark/PinterestSegment\"\n```\n#### Manually\n1. Download and drop ```PinterestSegment.swift``` in your project.  \n2. Congratulations!  \n\n## Usage example\n\n``` swift\nlet  style = PinterestSegmentStyle()\n\nstyle.indicatorColor = UIColor(white: 0.95, alpha: 1)\nstyle.titleMargin: CGFloat = 15\nstyle.titlePendingHorizontal: CGFloat = 14\nstyle.titlePendingVertical: CGFloat = 14\nstyle.titleFont = UIFont.boldSystemFont(ofSize: 14)\nstyle.normalTitleColor = UIColor.lightGray\nstyle.selectedTitleColor = UIColor.darkGray\n\nlet segment = PinterestSegment(frame: CGRect(x: 20, y: 200, width: w - 40, height: 40), style: style, titles: [\"Everything\", \"Geek\", \"Humor\", \"Art\", \"Food\", \"Home\", \"DIY\", \"Wemoent' Style\", \"Man's Style\", \"Beauty\", \"Travel\"])\n\nsegment.valueChange = { index in\n  // Do something here\n}\n\n```\n\n\nYou can also add icon for each title, Just like the blow demo gif\n\n![](Example/demo2.gif)\n\n```swift\n\n@IBOutlet weak var ibSegment: PinterestSegment!\n\nvar titles = [PinterestSegment.TitleElement]()\nfor i in 1...7 {\n    guard let image = UIImage(named: \"icon_\\(i)\"),\n    let selectedImage = image.maskWithColor(color: ibSegment.style.selectedTitleColor),\n    let normalImage = image.maskWithColor(color: ibSegment.style.normalTitleColor)  else { continue }\n    titles.append(PinterestSegment.TitleElement(title: \"Face-\\(i)\", selectedImage: selectedImage, normalImage: normalImage))\n}\nibSegment.setRichTextTitles(titles)\n\n```\n\n\n## Article\n  \n  Fix automaticallyAdjustsScrollViewInsets bug in PinterestSegment [https://tbxark.com/2016/12/08/2016-12-08-Swift-Pinterst/](https://tbxark.com/2016/12/08/2016-12-08-Swift-Pinterst/)\n\n## Release History\n\n* 1.2.0\n  support swift 4.0\n\n* 1.0.1\n  fix bug\n\n* 1.0.0\n  first commit\n\n\n## Contribute\n\nWe would love for you to contribute to **PinterestSegment**, check the ``LICENSE`` file for more info.\n\n## Meta\n\nTBXark – [@tbxark](https://twitter.com/tbxark) – tbxark@outlook.com\n\nDistributed under the MIT license. See ``LICENSE`` for more information.\n\n[https://github.com/TBXark](https://github.com/TBXark)\n\n[swift-image]:https://img.shields.io/badge/swift-3.0-orange.svg\n[swift-url]: https://swift.org/\n[license-image]: https://img.shields.io/badge/License-MIT-blue.svg\n[license-url]: LICENSE\n[travis-image]: https://img.shields.io/travis/dbader/node-datadog-metrics/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/dbader/node-datadog-metrics\n[codebeat-image]: https://codebeat.co/badges/c19b47ea-2f9d-45df-8458-b2d952fe9dad\n[codebeat-url]: https://codebeat.co/projects/github-com-vsouza-awesomeios-com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbxark%2Fpinterestsegment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbxark%2Fpinterestsegment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbxark%2Fpinterestsegment/lists"}