[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6965":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":36,"readmeContent":37,"aiSummary":38,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":39,"discoverSource":40},6965,"Persei","Yalantis\u002FPersei","Yalantis","Animated top menu for UITableView \u002F UICollectionView \u002F UIScrollView written in Swift","https:\u002F\u002Fyalantis.com\u002F?utm_source=github",null,"Swift",3434,310,120,2,0,59.48,"MIT License",false,"master",true,[23,24,25,26,27,28,29,30,31,32,33,34,35],"animation","carthage","cocoapods","custom","drag","ios","menu","navigator","persei","swift","uicollectionview","uiscrollview","uitableview","2026-06-12 04:00:31","# Persei\n[![Build Status](https:\u002F\u002Ftravis-ci.org\u002FYalantis\u002FPersei.svg)](https:\u002F\u002Ftravis-ci.org\u002FYalantis\u002FPersei)\n[![License](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FYalantis\u002FPersei\u002Fblob\u002Fmaster\u002FLICENSE)\n\n![Preview](https:\u002F\u002Fgithub.com\u002FYalantis\u002FPersei\u002Fblob\u002Fmaster\u002FAssets\u002Fanimation.gif)\n\nAnimated top menu for UITableView \u002F UICollectionView \u002F UIScrollView written in Swift!\n\nMade in [Yalantis](https:\u002F\u002Fyalantis.com\u002F?utm_source=github).\n\nCheck this [project on Dribbble](https:\u002F\u002Fdribbble.com\u002Fshots\u002F1706861-Top-Menu-Animation?list=users&offset=23)\n\nCheck this [project on Behance](https:\u002F\u002Fwww.behance.net\u002Fgallery\u002F20411445\u002FMobile-Animations-Interactions%20)\n\n## Supported Swift versions\n\n| Swift Version | Persei |\n|:---:|:---:|\n| 1.x | 1.1 |\n| 2.x | 2.0 |\n| 3.x | 3.0 |\n| 4.x | 3.1|\n| **5.x** | **4.0** |\n\n## Installation\n\n### [CocoaPods](http:\u002F\u002Fcocoapods.org)\n\n```ruby\nuse_frameworks!\n\npod 'Persei', '~> 4.0'\n```\n\n### [Carthage](http:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n\n```ruby\ngithub \"Yalantis\u002FPersei\" ~> 4.0\n```\n\n### Manual Installation\n> For application targets that do not support embedded frameworks, such as iOS 7, Persei can be integrated by including source files from the Persei folder directly, optionally wrapping the top-level types into `struct Persei` to simulate a namespace. Yes, this sucks.\n\n1. Add Persei as a [submodule](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-submodule) by opening the Terminal, `cd`-ing into your top-level project directory, and entering the command `git submodule add https:\u002F\u002Fgithub.com\u002Fyalantis\u002FPersei.git`\n2. Open the `Persei` folder, and drag `Persei.xcodeproj` into the file navigator of your app project.\n3. In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the \"Targets\" heading in the sidebar.\n4. Ensure that the deployment target of `Persei.framework` matches that of the application target.\n5. In the tab bar at the top of that window, open the \"Build Phases\" panel.\n6. Expand the \"Target Dependencies\" group, and add `Persei.framework`.\n7. Expand the \"Link Binary With Libraries\" group, and add `SideMenu.framework`\n8. Click on the `+` button at the top left of the panel and select \"New Copy Files Phase\". Rename this new phase to \"Copy Frameworks\", set the \"Destination\" to \"Frameworks\", and add `Persei.framework`.\n\n## Usage\n#### Import `Persei` module\n```swift\nimport Persei\n```\n\n#### Init\n```swift\nlet menu = MenuView()    \ntableView.addSubview(menu)\n```\n\n#### Configuring items\nIn order to set items you need to instantiate array of `MenuItem`:\n\n```swift\nlet items = feedModes.map { mode: SomeYourCustomFeedMode -> MenuItem in\n\treturn MenuItem(image: mode.image)\n}\n\nmenu.items = items\n```\n\n#### Handling selection\nYou can specify selected item manually:\n```swift\nmenu.selectedIndex = 3\n```\n\nNote, that selectedIndex declared as `Int?` and will be `nil` in case of `menu.items = nil`.\n\nAlso, you can implement `MenuViewDelegate` to be notified about selection change:\n```swift\n\u002F\u002F during init\nmenu.delegate = self\n\n\u002F\u002F actual implementation\nextension FeedViewController: MenuViewDelegate {\n    func menu(menu: MenuView, didSelectItemAt index: Int) {\n    \tdataSource.mode = feedModes[index] \u002F\u002F alter mode of dataSource\n\n    \ttableView.reload() \u002F\u002F update tableView\n    }\n}\n```\n\n#### Reveal menu manually\nMenu can be reveal as a result of button tap:\n```swift\nfunc menuButtonSelected(sender: UIControl) {\n\tmenu.revealed = !menu.revealed\n\n\t\u002F\u002F or animated\n\tmenu.setRevealed(true, animated: true)\n}\n```\n\n#### Content Gravity\nUse `contentViewGravity` to control sticking behavior. There are 3 available options:\n\n- Top: `contentView` sticked to the top position of the view\n- Center: `contentView` is aligned to the middle of the streched view\n- Bottom: `contentView` sticked to the bottom\n\n#### Customization\n`MenuItem` declares set of attributes, that allow you to customize appearance of items:\n```swift\nstruct MenuItem {\n    var image: UIImage \u002F\u002F default image\n    var highlightedImage: UIImage? \u002F\u002F image used during selection\n\n    var backgroundColor: UIColor \u002F\u002F default background color\n    var highlightedBackgroundColor: UIColor \u002F\u002F background color used during selection\n\n    var shadowColor: UIColor \u002F\u002F color of bottom 2px shadow line\n}\n```\n\nAlso you're free to configure background of `MenuView` by utilizing `backgroundColor` or `backgroundImage`. Note, that image should be resizeable:\n```swift\nlet menu = MenuView()\nmenu.backgroundImage = UIImage(named: \"top_menu_background\")\n```\n\n#### Advanced customization\n- Can I place the UIImageView instead?\n- Sure! Just subclass \u002F use `StickyHeaderView` directly. It offers layout, positioning and reveal control. All you have to do is to assign your custom view (animated nian-cat UIImageView) to `contentView`:\n\n```swift\nlet headerView = StickyHeaderView()\nlet imageView = UIImageView(...)\n\nheaderView.contentView = imageView\n```\n\nObviously, your custom view can have heigh different from default:\n```swift\nheaderView.contentHeight = image.size.height\n```\n\nAs well as control distance to trigger open\u002Fclose of the header:\n```swift\nheaderView.threshold = 0.5\n```\nThreshold is a float value from 0 to 1, specifies how much user needs to drag header for reveal.\n\n#### Let us know!\n\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\n\tThe MIT License (MIT)\n\n\tCopyright © 2017 Yalantis\n\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and\u002For sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE.\n","Persei 是一个为 UITableView、UICollectionView 和 UIScrollView 提供动画顶部菜单的 Swift 库。其核心功能是通过简单配置即可实现流畅的下拉菜单动画效果，支持多种自定义选项如拖拽手势等。该库采用 Swift 语言编写，支持从 Swift 1.x 到最新的 5.x 版本，并且可以通过 CocoaPods 或 Carthage 方便地集成到 iOS 项目中。适用于需要增强用户界面交互体验的应用场景，特别是那些希望在列表或滚动视图顶部添加动态菜单的应用。","2026-06-11 03:09:53","top_language"]