[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7128":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},7128,"Segmentio","Yalantis\u002FSegmentio","Yalantis","Animated top\u002Fbottom segmented control written in Swift.","https:\u002F\u002Fyalantis.com\u002F",null,"Swift",2523,322,63,27,0,29.53,"MIT License",false,"master",true,[23,24,25,26,27,28,29],"animation","carthage","cocoapods","ios","segmentio","swift","yalantis","2026-06-12 02:01:35","## Segmentio\n[![Platform](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-iOS-blue.svg?style=flat)](https:\u002F\u002Fcocoapods.org\u002F?q=segmentio) [![License](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FYalantis\u002FSegmentio\u002Fblob\u002Fmaster\u002FLICENSE) ![Swift 5](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSwift-5-orange.svg) [![Carthage compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) ![Swift Package Manager](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fswiftpm-compatible-green.svg)\n\nAnimated top\u002Fbottom segmented control written in Swift.\n\n![Preview](https:\u002F\u002Fgithub.com\u002FYalantis\u002FSegmentio\u002Fblob\u002Fmaster\u002FAssets\u002Fanimation.gif)\n\nCheck this \u003Ca href=\"https:\u002F\u002Fdribbble.com\u002Fshots\u002F2820372-Segmentio-Component\">project on dribbble\u003C\u002Fa>.\n\n## Requirements\n\n- Xcode 10\n- iOS 8.x+\n- Swift 5.0\n\n## Installation\n\n#### [CocoaPods](http:\u002F\u002Fcocoapods.org)\n```ruby\nuse_frameworks! \n\npod 'Segmentio'\n```\n\n*CocoaPods v1.1.0 or later required*\n\n#### [Carthage](http:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n```ruby\ngithub \"Yalantis\u002FSegmentio\"\n```\n\n## Usage\n#### Import `Segmentio` module\n```swift\nimport Segmentio\n```\n\n#### Init\nYou can initialize a `Segmentio` instance from code:\n\n```swift\nvar segmentioView: Segmentio!\n\nlet segmentioViewRect = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 125)\nsegmentioView = Segmentio(frame: segmentioViewRect)\nview.addSubview(segmentioView)\n```\n\nor\n\nadd a `UIView` instance in your .storyboard or .xib, set `Segmentio` class and connect `IBOutlet`:\n\n```swift\n@IBOutlet weak var segmentioView: Segmentio!\n```\n\n#### Setup `Segmentio`\n```swift\nsegmentioView.setup(\n\tcontent: [SegmentioItem],\n\tstyle: SegmentioStyle,\n\toptions: SegmentioOptions?\n)\n```\n\nTo start with default options you can just pass `nil` to the `options` parameter.\n\n```swift\nsegmentioView.setup(\n\tcontent: [SegmentioItem],\n\tstyle: SegmentioStyle,\n\toptions: nil\n)\n```\n\n\n#### Configuring items \nIn order to set items you need to create an array of `SegmentioItem` instances:\n\n```swift\nvar content = [SegmentioItem]()\n\nlet tornadoItem = SegmentioItem(\n\ttitle: \"Tornado\",\n\timage: UIImage(named: \"tornado\")\n)\ncontent.append(tornadoItem)\n```\n\n#### Handling selection\nYou can specify selected item manually:\n\n```swift\nsegmentioView.selectedSegmentioIndex = 0\n```\n\n#### Handling callback\n\n```swift\nsegmentioView.valueDidChange = { segmentio, segmentIndex in\n\tprint(\"Selected item: \", segmentIndex)\n}\n```\n\n#### Customization\n`Segmentio` can be customized by passing an instance of `SegmentioOptions` struct:\n\n```swift\nSegmentioOptions(\n            backgroundColor: .white,\n            segmentPosition: SegmentioPosition,\n            scrollEnabled: true,\n            indicatorOptions: SegmentioIndicatorOptions,\n            horizontalSeparatorOptions: SegmentioHorizontalSeparatorOptions,\n            verticalSeparatorOptions: SegmentioVerticalSeparatorOptions,\n            imageContentMode: .center,\n            labelTextAlignment: .center,\n            segmentStates: SegmentioStates\n)\n```\n\nSegment width rely on `SegmentioPosition` enum. Width can be fixed according to maximum visible items or dynamic according to segment's content size:\n\n```swift\nenum SegmentioPosition {\n    case dynamic\n    case fixed(maxVisibleItems: Int)\n}\n```\n\nSelection indicator can be customized by passing an instance of `SegmentioIndicatorOptions`:\n\n```swift\nSegmentioIndicatorOptions(\n            type: .bottom,\n            ratio: 1,\n            height: 5,\n            color: .orange\n)\n```\n\nHorizontal borders can be customized by passing an instance of `SegmentioHorizontalSeparatorOptions`:\n\n```swift\nSegmentioHorizontalSeparatorOptions(\n            type: SegmentioHorizontalSeparatorType.topAndBottom, \u002F\u002F Top, Bottom, TopAndBottom\n            height: 1,\n            color: .gray\n)\n```\n\nSeparators between segments can be customized by passing an instance of  `SegmentioVerticalSeparatorOptions`:\n\n```swift\nSegmentioVerticalSeparatorOptions(\n            ratio: 0.6, \u002F\u002F from 0.1 to 1\n            color: .gray\n)\n```\n\nIn order to set `SegmentioStates` you need to create a tuple of `SegmentioState` instances:\n\n```swift\nSegmentioStates(\n            defaultState: SegmentioState(\n                backgroundColor: .clear,\n                titleFont: UIFont.systemFont(ofSize: UIFont.smallSystemFontSize),\n                titleTextColor: .black\n            ),\n            selectedState: SegmentioState(\n                backgroundColor: .orange,\n                titleFont: UIFont.systemFont(ofSize: UIFont.smallSystemFontSize),\n                titleTextColor: .white\n            ),\n            highlightedState: SegmentioState(\n                backgroundColor: UIColor.lightGray.withAlphaComponent(0.6),\n                titleFont: UIFont.boldSystemFont(ofSize: UIFont.smallSystemFontSize),\n                titleTextColor: .black\n            )\n)\n```\n\n#### Let us know!\nWe’d be really happy if you sent us links to your projects where you use our component. Just send an email to github@yalantis.com And do let us know if you have any questions or suggestion regarding the animation.\n\nP.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!\n\n## License\n\nThe MIT License (MIT)\n\nCopyright © 2019 Yalantis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\u002For sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","Segmentio 是一个用 Swift 编写的 iOS 动画顶部\u002F底部分段控件。它支持多种动画效果和自定义选项，包括背景颜色、指示器样式以及水平和垂直分割线等，并且可以通过 CocoaPods 或 Carthage 轻松集成到项目中。此外，Segmentio 提供了灵活的 API 来配置内容项、处理选择变化事件以及设置默认选中项等功能，非常适合需要在应用界面上实现美观且功能丰富的分段控制场景，如导航栏切换、选项卡布局等。",2,"2026-06-11 03:10:41","top_language"]