<a href="https://www.ramotion.com/agency/app-development?utm_source=gthb&utm_medium=repo&utm_campaign=expanding-collection"><img src="https://github.com/Ramotion/folding-cell/blob/master/header.png"></a>
<a href="https://github.com/Ramotion/expanding-collection">
<img align="left" src="https://github.com/Ramotion/expanding-collection/blob/master/expanding-collection.gif" width="480" height="360" /></a>
<p><h1 align="left">EXPANDING COLLECTION</h1></p>
<h4>An animated material design UI card peek/pop controller</h4>
___
<p><h6>We specialize in the designing and coding of custom UI for Mobile Apps and Websites.</h6>
<a href="https://www.ramotion.com/agency/app-development?utm_source=gthb&utm_medium=repo&utm_campaign=expanding-collection">
<img src="https://github.com/ramotion/gliding-collection/raw/master/contact_our_team@2x.png" width="187" height="34"></a>
</p>
<p><h6>Stay tuned for the latest updates:</h6>
<a href="https://goo.gl/rPFpid" >
<img src="https://i.imgur.com/ziSqeSo.png/" width="156" height="28"></a></p>
</br>
[![Twitter](https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat)](http://twitter.com/Ramotion)
[![CocoaPods](https://img.shields.io/cocoapods/p/expanding-collection.svg)](https://cocoapods.org/pods/expanding-collection)
[![CocoaPods](https://img.shields.io/cocoapods/v/expanding-collection.svg)](http://cocoapods.org/pods/expanding-collection)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Ramotion/expanding-collection)
[![Travis](https://travis-ci.org/Ramotion/expanding-collection.svg?branch=master)](https://travis-ci.org/Ramotion/expanding-collection)
[![codebeat badge](https://codebeat.co/badges/6a009992-5bf2-4730-aa35-f3b20ce7693d)](https://codebeat.co/projects/github-com-ramotion-expanding-collection)
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/Ramotion)
## Requirements
- iOS 9.0+
- Xcode 9.0+
## Installation
Just add the Source folder to your project.
or use [CocoaPods](https://cocoapods.org) with Podfile:
``` ruby
pod 'expanding-collection'
```
or [Carthage](https://github.com/Carthage/Carthage) users can simply add to their `Cartfile`:
```
github "Ramotion/expanding-collection"
```
## Usage
```swift
import expanding_collection
```
#### Create CollectionViewCell
![cell](https://raw.githubusercontent.com/Ramotion/expanding-collection/master/images/image2.png)
1) Create UICollectionViewCell inherit from `BasePageCollectionCell` (recommend create cell with xib file)
2) Adding FrontView
- add a view to YOURCELL.xib and connect it to `@IBOutlet weak var frontContainerView: UIView!`
- add width, height, centerX and centerY constraints (width and height constranints must equal cellSize)
![cell](https://raw.githubusercontent.com/Ramotion/expanding-collection/master/images/image1.png)
- connect centerY constraint to `@IBOutlet weak var frontConstraintY: NSLayoutConstraint!`
- add any desired uiviews to frontView
3) Adding BackView
- repeat step 2 (connect outlets to `@IBOutlet weak var backContainerView: UIView!`, `@IBOutlet weak var backConstraintY: NSLayoutConstraint!`)
4) Cell example [DemoCell](https://github.com/Ramotion/expanding-collection/tree/master/DemoExpandingCollection/DemoExpandingCollection/ViewControllers/DemoViewController/Cells)
###### If set `tag = 101` for any `FrontView.subviews` this view will be hidden during the transition animation
#### Create CollectionViewController
1) Create a UIViewController inheriting from `ExpandingViewController`
2) Register Cell and set Cell size:
``` swift
override func viewDidLoad() {
itemSize = CGSize(width: 214, height: 460) //IMPORTANT!!! Height of open state cell
super.viewDidLoad()
// register cell
let nib = UINib(nibName: "NibName", bundle: nil)
collectionView?.registerNib(nib, forCellWithReuseIdentifier: "CellIdentifier")
}
```
3) Add UICollectionViewDataSource methods
``` swift
extension YourViewController {
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count
}
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("CellIdentifier"), forIndexPath: indexPath)
// configure cell
return cell
}
}
```
4) Open Cell animation
```swift
override func viewDidLoad() {
itemSize = CGSize(width: 214, height: 264)
super.viewDidLoad()
// register cell
let nib = UINib(nibName: "CellIdentifier", bundle: nil)
collectionView?.registerNib(nib, forCellWithReuseIdentifier: String(DemoCollectionViewCell))
}
```
``` swift
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
cell.cellIsOpen(!cell.isOpened)
}
```
###### if you use this delegates method:
```Swift
func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath)
func scrollViewDidEndDecelerating(scrollView: UIScrollView)
```
###### must call super method:
```Swift
func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) {
super.collectionView(collectionView: collectionView, willDisplayCell cell: cell, forItemAtIndexPath indexPath: indexPath)
// code
}
func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
super.scrollViewDidEndDecelerating(scrollView: scrollView)
// code
}
```
#### Transition animation
1) Create a UITableViewController inheriting from `ExpandingTableViewController`
2) Set header height default 236
``` swift
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
headerHeight = ***
}
```
OR
``` swift
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
headerHeight = ***
}
```
3) Call the push method in YourViewController to YourTableViewController
``` swift
if cell.isOpened == true {
let vc: YourTableViewController = // ... create view controller
pushToViewController(vc)
}
```
4) For back transition use `popTransitionAnimation()`
## ð Check this library on other language:
<a href="https://github.com/Ramotion/expanding-collection-android">
<img src="https://github.com/ramotion/navigation-stack/raw/master/Android_Java@2x.png" width="178" height="81"></a>
## ð License
Expanding Collection is released under the MIT license.
See [LICENSE](./LICENSE) for details.
This library is a part of a <a href="https://github.com/Ramotion/swift-ui-animation-components-and-libraries"><b>selection of our best UI open-source projects.</b></a>
If you use the open-source library in your project, please make sure to credit and backlink to www.ramotion.com
## ð± Get the Showroom App for iOS to give it a try
Try this UI component and more like this in our iOS app. Contact us if interested.
<a href="https://itunes.apple.com/app/apple-store/id1182360240?pt=550053&ct=expanding-collection&mt=8" >
<img src="https://github.com/ramotion/gliding-collection/raw/master/app_store@2x.png" width="117" height="34"></a>
<a href="https://www.ramotion.com/agency/app-development?utm_source=gthb&utm_medium=repo&utm_campaign=expanding-collection">
<img src="https://github.com/ramotion/gliding-collection/raw/master/contact_our_team@2x.png" width="187" height="34"></a>
<br>
<br>
没有合适的资源?快使用搜索试试~ 我知道了~
iOS-卡片效果-24expanding-collection
共262个文件
swift:34个
json:24个
png:19个
需积分: 0 0 下载量 12 浏览量
2023-05-20
16:42:01
上传
评论
收藏 18.57MB ZIP 举报
温馨提示
iOS_卡片效果24expanding-collection
资源推荐
资源详情
资源评论
收起资源包目录
iOS-卡片效果-24expanding-collection (262个子文件)
05a14fd49c355d06be8278663e77e8b2666e04 150B
0628ca8b1f2804f4b5bd73dc4231bc53b00c02 802B
06cfb8deb102f7978cd0eed4b7de7450fbf260 1KB
08767942efb50b50b9a3c79288121cd70a2a9f 58B
08fe13b1fe70c2fc366a165fd5c088496dd89a 3KB
0a512d266f39a472bf63e03475ea1400f5316e 444B
0baf0b15119cbf90901d310cfd26438f2cb69b 441B
1198d306625ca83aa14ecb93572d224e62e2dc 2KB
12594212cfd57830a3a17bf2a43a7944f9b03c 28KB
12b8ff9dd5c1ad40ad4c6a85ffaf482e43369f 8KB
13406b586b893f26451af665cae83887231633 249B
15cff4b71332788c4bf9c976c0b7e30bfc8112 525B
19b061fec8bc245518acee6aaa2d4be36419f1 84B
1f9f972af2ebade364efafdbd370c7ac3de23b 133B
21b9bb1a35f5de270a41afa01305478221ae32 253B
21c8cdfe37546d2b8ff148b64d01e301e5c884 147B
230d4e18c0ffe97bf4bd8a6b5a81d5429f971e 322B
235b0fe687e83670e8809b59c61f75ad951426 534B
25dbe774f45528718284a95c60bd5c7662f9cd 151B
298d0586ad16b7bfea6952bb204937f5cb76f9 2KB
2ad20f1f10925e7ed67a7ef85e00965369bb04 2KB
2bf8b9ab7a3d456ef2ce9138478334970f8fbc 612B
2e5a135d52a961322b08ce39810b3a71ac88b2 68B
2fe05df2d5b8dd25124190b4ffb537c344d5c8 248B
31ee7d051351f849edc6437f2eb5309ba562d0 389B
3348d87704fa6b151e425325bd52055b823c47 101B
33acf77ed7a6d9eec8fb61bdc94054afbd7855 223B
33f51a154c7326e3d24a0ae332b0b4ce3e01f1 1.69MB
37ad6c7e4200336f37d71c6ccfe1ef8a1c4c87 1.72MB
39818a8394b7f8afa23c5232f733fb75a0eb3f 913B
3cc9b8ba4e4ae5c6df5ed5e3f199668b7fead0 68B
460d2feb54dbe297a77850d2303aa1090226a4 3KB
46e2df5c16a9a315bebadb2ea39f30febb2880 3KB
4a0d7bbc9555a9df6dbb401360649ea8b41f85 149B
4a164c918651cdd1e11dca5cc62c333f097601 65B
4b9dad3a8bc068c3b73012f3209d1f6220e4bc 625B
4d44b6d184e1b2cc57cba27403fe3ab2f1493f 155B
51f2c2f16e0e0e8d4434c53988a832e0db1538 150B
521645cbfd4e5fa58944f9caab740b610f741d 148B
527704c2b2accb5bcea7fbbaff3215fa1ab381 318B
53897503d2d949f0347aad2361bebc246a3082 151B
561475a27caf657ae8865c732cbe7acbbac2c9 4KB
56ac6efc4495c554ddd2bdfde39e0ea1779e1a 2KB
59ca2c03468670a89f5869b008cf41a0260669 887B
5a4d6031d6f8c18b72dfccff19d8f7b4d5cad0 59B
5a8af2db311470cb2af134b211df7f4bcdcbc3 8KB
5b2036acdd5b88974bca2d908af37fcee2bd77 496B
5c4b8babba0d4d34be5c90cf68f7d503fc3f7a 151B
601a348d3b63b433a845d494790b9fc32d7df8 936B
61651ef52cc32828f6e3a60b90d80269c7dcc4 155B
619306b504afd9e985f61dbb9f5714e04cb1ef 757KB
650e56ee9dd52f00d345bc63bdf1e7939e3178 2KB
66154a7f941acde567d24e15a34eeeb155e47f 323B
670fa6ee16bb6452052424ba5b6b80f4b140cf 128B
6c398757a26f3f85a4506bf7a4cb037d04f6d8 152B
6deb5d6362510bb8f452be76bb71e69cfd00d6 59KB
70cfa249dc1aa6c0986cae66c538b57852a51c 978B
71434ee3dc8e7a4250802fa809f5847a850294 149B
7e86c2a1454021f1cce792169ba5aeb0720689 95B
7ed58507e1adbbb1a354218652089be38a3e00 149B
7ff74454e198b65dd0e37bf9510bfcbc0df591 159B
853e034ebd8c6ed806e9aa160d8bad76ea9f9d 148B
870be1b12405f99639ecad201ca86ed0ee4f43 26KB
8789700816459c1e1480e0b34781d9fb78a1ca 105B
8991f60016d409df77565e7dade01d4d514e9c 2KB
89b35dd66fab0e6796e3d0715b0c2b7de8ffbd 8KB
8a38283dda171bca9234ee7169c0ff4806f13c 157B
8a5e3c5ac7113e8d2ace57a54d99cc8bab9bbc 524B
8ad7f22342ace979a25551c600c60a254d7206 154B
8e88322708f4b4bd73d18af0518f7ed8c8db8e 153B
8e91aa34f2bd4dc559d9fd235516d63ea91edf 51B
923544a99634737ca571d6355a90851e2bfd68 153B
935974ec0f9b64fa6fd32074adf9413db1469e 844B
9573fbc79f5ed237e67ca17a123f22b0b7e0c4 155B
97c28d4494a590fef00c7bdf08554a564a5226 637B
98adc4955de810584645dd3a045b4edb628c0d 127B
99fe48a454e1f2009dd0d21a0dc1de46a4c543 133B
9bb5f08b9b0300d1c10b00dd941123e55b56fd 153B
9d409150fad1db8461655788f5362cba25d142 149B
9d51f00cba9ceb5deb246aae4b46e971cfea45 860B
a31ffeba24a287fe2915c8eb413aae215b4c57 389B
a36129419f8bd7ad73581cb9f07b8c6eec3fcf 792B
a4ce6a06ffe79452c5a9fd5f6ca47cd6e7b9a1 105B
a4d6a8cc41aa2de9929c569e1e1c76445bb8e6 392B
a5f7144cdefdff3cd41b869a4ae0fe8b00225f 207B
a7f0180a29efcbb2962dc16b9754e98183e03e 587KB
a91a2cfe6fa7c7aa22082c8924d2fd848d0d60 152B
b09ee462512f3973d24280df3b03349c92e014 151B
b0b42ec057f4a739bb34e31ea9c8592f3bd3f4 146B
b1e506b65f08de2961c57703140630e840cec3 2KB
bb1ecd6f570d9f3c4a0835b8686f0e260f59ad 2KB
bc321a924fa37fcf07fb67655fffac652365af 146B
bcf38400d14f257132ac2ae8c09f25b844ba1c 758B
bdb465ef25a4f59b2cafca8bafb2296e0c4c5e 603B
be3b681122de83e380d47b840b7d0486f71f86 540B
c00596a7fca3f3d4bdd64053b69d86745f9e10 66B
c028a43beacd90fca1c019e25b8d49ad608cfd 53KB
c169823413b2d9b44850d2ef40b035b2e47398 1.87MB
c3fb282b59cf1aaf282c98667d2c256228ce92 150B
c41d5ab1c88cc7b723181a5a9c905249abc018 148B
共 262 条
- 1
- 2
- 3
资源评论
GotoLevel
- 粉丝: 23
- 资源: 37
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- tesseract安装包
- 1_32陀螺仪舵机.zip
- HITJ0302MP-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- XILINXFPGA源码PCIExpress标准概述
- HITJ0204MP-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- XILINXFPGA源码PCIExpressIP核应用参考设计
- XILINXFPGA源码LCD12864在Spartan-3E实现代码
- XILINXFPGA源码LCDIPCORE
- G6402-VB一款SOT23封装P-Channel场效应MOS管
- XILINXFPGA源码IPcamera的开源系统
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功