[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6708":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":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":18,"lastSyncTime":34,"discoverSource":35},6708,"folding-cell","Ramotion\u002Ffolding-cell","Ramotion",":octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion","https:\u002F\u002Fwww.ramotion.com\u002Ffolding-cell\u002F",null,"Swift",10196,1137,264,7,0,1,2,44.17,"MIT License",false,"master",true,[25,26,27,28,29,30],"animation","ios","library","material-design","swift","ui","2026-06-12 02:01:28","\u003Ca href=\"https:\u002F\u002Fwww.ramotion.com\u002Fagency\u002Fapp-development\u002F?utm_source=gthb&utm_medium=repo&utm_campaign=folding-cell\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002FRamotion\u002Ffolding-cell\u002Fblob\u002Fmaster\u002Fheader.png\">\u003C\u002Fa>\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FRamotion\u002Ffolding-cell\">\n\u003Cimg align=\"left\" src=\"https:\u002F\u002Fgithub.com\u002FRamotion\u002Ffolding-cell\u002Fblob\u002Fmaster\u002FScreenshots\u002FfoldingCell.gif\" width=\"480\" height=\"360\" \u002F>\u003C\u002Fa>\n\n\u003Cp>\u003Ch1 align=\"left\">FOLDING CELL\u003C\u002Fh1>\u003C\u002Fp>\n\n\u003Ch4>Expanding content cell with animation inspired by folding paper card material design.\u003C\u002Fh4>\n\n\n___\n\n\n\n\u003Cp>\u003Ch6>We specialize in the designing and coding of custom UI for Mobile Apps and Websites.\u003C\u002Fh6>\n\u003Ca href=\"https:\u002F\u002Fwww.ramotion.com\u002Fagency\u002Fapp-development\u002F?utm_source=gthb&utm_medium=repo&utm_campaign=folding-cell\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Framotion\u002Fgliding-collection\u002Fraw\u002Fmaster\u002Fcontact_our_team@2x.png\" width=\"187\" height=\"34\">\u003C\u002Fa>\n\u003C\u002Fp>\n\u003Cp>\u003Ch6>Stay tuned for the latest updates:\u003C\u002Fh6>\n\u003Ca href=\"https:\u002F\u002Fgoo.gl\u002FrPFpid\" >\n\u003Cimg src=\"https:\u002F\u002Fi.imgur.com\u002FziSqeSo.png\u002F\" width=\"156\" height=\"28\">\u003C\u002Fa>\u003C\u002Fp>\n\n\u003C\u002Fbr>\n\n[![CocoaPods](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fp\u002FFoldingCell.svg)](https:\u002F\u002Fcocoapods.org\u002Fpods\u002FFoldingCell)\n[![CocoaPods](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FFoldingCell.svg)](http:\u002F\u002Fcocoapods.org\u002Fpods\u002FFoldingCell)\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTwitter-@Ramotion-blue.svg?style=flat)](http:\u002F\u002Ftwitter.com\u002FRamotion)\n[![Travis](https:\u002F\u002Fimg.shields.io\u002Ftravis\u002FRamotion\u002Ffolding-cell.svg)](https:\u002F\u002Ftravis-ci.org\u002FRamotion\u002Ffolding-cell)\n[![codebeat badge](https:\u002F\u002Fcodebeat.co\u002Fbadges\u002F6f67da5d-c416-4bac-9fb7-c2dc938feedc)](https:\u002F\u002Fcodebeat.co\u002Fprojects\u002Fgithub-com-ramotion-folding-cell)\n[![Carthage compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n[![Swift 4.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSwift-5.0-green.svg?style=flat)](https:\u002F\u002Fdeveloper.apple.com\u002Fswift\u002F)\n[![Analytics](https:\u002F\u002Fga-beacon.appspot.com\u002FUA-84973210-1\u002Framotion\u002Ffolding-cell)](https:\u002F\u002Fgithub.com\u002Figrigorik\u002Fga-beacon)\n[![Donate](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDonate-PayPal-blue.svg)](https:\u002F\u002Fpaypal.me\u002FRamotion)\n\n## Requirements\n\n- iOS 8.0+\n- Xcode 10.2\n\n## Installation\n\nJust add the FoldingCell.swift file to your project.\n\nor use [CocoaPods](https:\u002F\u002Fcocoapods.org) with Podfile:\n```\npod 'FoldingCell'\n```\nor [Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) users can simply add Mantle to their `Cartfile`:\n```\ngithub \"Ramotion\u002Ffolding-cell\"\n```\nor [Swift Package Manager](https:\u002F\u002Fswift.org\u002Fpackage-manager\u002F) by adding:\n```\ndependencies: [\n.package(url: \"https:\u002F\u002Fgithub.com\u002FRamotion\u002Ffolding-cell.git\", from: \"5.0.2\")\n]\n```\nto `Package.swift`\n\nor just drag and drop FoldingCell.swift file to your project\n\n## Solution\n![Solution](https:\u002F\u002Fraw.githubusercontent.com\u002FRamotion\u002Ffolding-cell\u002Fmaster\u002FTutorial-resources\u002FSolution.png)\n## Usage\n\n1) Create a new cell inheriting from `FoldingCell`\n\n2) Add a UIView to your cell in your storyboard or nib file, inheriting from `RotatedView`.\nConnect the outlet from this view to the cell property `foregroundView`.\nAdd constraints from this view to the superview, as in this picture:\n\n![1.1](https:\u002F\u002Fraw.githubusercontent.com\u002FRamotion\u002Ffolding-cell\u002Fmaster\u002FTutorial-resources\u002F1.1.png)\n\n(constants of constraints may be different). Connect the outlet from this top constraint to the cell property `foregroundViewTop`\n. (This view will be shown when the cell is in its normal state).\n\n3) Add other UIViews to your cell, connect the outlet from this view to the cell\nproperty `containerView`. Add constraints from this view to the superview like in the picture:\n\n![1.2](https:\u002F\u002Fraw.githubusercontent.com\u002FRamotion\u002Ffolding-cell\u002Fmaster\u002FTutorial-resources\u002F1.2.png)\n\n(constants of constraints may be different). Connect the outlet from this top constraint to the cell property `containerViewTop`.\n(This view will be shown when the cell is opened)\n\nYour result should be something like this picture:\n\n![1.3](https:\u002F\u002Fraw.githubusercontent.com\u002FRamotion\u002Ffolding-cell\u002Fmaster\u002FTutorial-resources\u002F1.3.png)\n\n\n4) Set ``` @IBInspectable var itemCount: NSInteger ``` property is a count of folding (it IBInspectable you can set in storyboard). range 2 or greater. Default value is 2\n\nOk, we've finished configuring the cell.\n\n5) Adding code to your UITableViewController\n\n5.1) Add constants:\n``` swift\nfileprivate struct C {\n  struct CellHeight {\n    static let close: CGFloat = *** \u002F\u002F equal or greater foregroundView height\n    static let open: CGFloat = *** \u002F\u002F equal or greater containerView height\n  }\n}\n```\n5.2) Add property for calculate cells height\n\n``` swift\n     var cellHeights = (0..\u003CCELLCOUNT).map { _ in C.CellHeight.close }\n```\n\n5.3) Override method:\n``` swift\n    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {\n        return cellHeights[indexPath.row]\n    }\n```\n\n5.4) Added code to method:\n``` swift\n    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {\n        guard case let cell as FoldingCell = tableView.cellForRowAtIndexPath(indexPath) else {\n          return\n        }\n\n        var duration = 0.0\n        if cellIsCollapsed {\n            cellHeights[indexPath.row] = Const.openCellHeight\n            cell.unfold(true, animated: true, completion: nil)\n            duration = 0.5\n        } else {\n            cellHeights[indexPath.row] = Const.closeCellHeight\n            cell.unfold(false, animated: true, completion: nil)\n            duration = 0.8\n        }\n\n        UIView.animateWithDuration(duration, delay: 0, options: .CurveEaseOut, animations: { _ in\n            tableView.beginUpdates()\n            tableView.endUpdates()\n        }, completion: nil)\n    }\n```\n5.5) Control if the cell is open or closed\n``` swift\n  override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {\n\n        if case let cell as FoldingCell = cell {\n            if cellHeights![indexPath.row] == C.cellHeights.close {\n                foldingCell.selectedAnimation(false, animated: false, completion:nil)\n            } else {\n                foldingCell.selectedAnimation(true, animated: false, completion: nil)\n            }\n        }\n    }\n```\n\n6) Add this code to your new cell class\n``` swift\n    override func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval {\n\n        \u002F\u002F durations count equal it itemCount\n        let durations = [0.33, 0.26, 0.26] \u002F\u002F timing animation for each view\n        return durations[itemIndex]\n    }\n```\n\n## if don't use storyboard and xib files\n\nCreate foregroundView and containerView from code (steps 2 - 3) look example:\n[Folding-cell-programmatically](https:\u002F\u002Fgithub.com\u002Fober01\u002FFolding-cell-programmatically)\n\n## 🗂 Check this library on other language:\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FRamotion\u002Ffolding-cell-android\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Framotion\u002Fnavigation-stack\u002Fraw\u002Fmaster\u002FAndroid_Java@2x.png\" width=\"178\" height=\"81\">\u003C\u002Fa>\n\n\n## 📄 License\n\nFolding cell is released under the MIT license.\nSee [LICENSE](.\u002FLICENSE) for details.\n\nThis library is a part of a \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FRamotion\u002Fswift-ui-animation-components-and-libraries\">\u003Cb>selection of our best UI open-source projects.\u003C\u002Fb>\u003C\u002Fa>\n\nIf you use the open-source library in your project, please make sure to credit and backlink to https:\u002F\u002Fwww.ramotion.com\u002F\n\n## 📱 Get the Showroom App for iOS to give it a try\nTry this UI component and more like this in our iOS app. Contact us if interested.\n\n\u003Ca href=\"https:\u002F\u002Fitunes.apple.com\u002Fapp\u002Fapple-store\u002Fid1182360240?pt=550053&ct=folding-cell&mt=8\" >\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Framotion\u002Fgliding-collection\u002Fraw\u002Fmaster\u002Fapp_store@2x.png\" width=\"117\" height=\"34\">\u003C\u002Fa>\n\n\u003Ca href=\"https:\u002F\u002Fwww.ramotion.com\u002Fagency\u002Fapp-development\u002F?utm_source=gthb&utm_medium=repo&utm_campaign=folding-cell\">\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Framotion\u002Fgliding-collection\u002Fraw\u002Fmaster\u002Fcontact_our_team@2x.png\" width=\"187\" height=\"34\">\u003C\u002Fa>\n","FoldingCell 是一个带有动画效果的可扩展内容单元，灵感来源于折叠纸卡的材质设计。该项目使用 Swift 语言开发，其核心功能在于提供了一个简单易用且视觉效果出众的 UI 组件，支持自定义动画和布局。它特别适用于 iOS 应用中需要展示复杂信息层次或希望增加用户交互趣味性的场景。通过继承 FoldingCell 类并进行简单的配置，开发者可以轻松地将这一组件集成到自己的项目中，提升应用界面的美观度与用户体验。","2026-06-11 03:08:29","top_language"]