All Projects → betranthanh → ios-swift-uicollectionviewcell-from-xib

betranthanh / ios-swift-uicollectionviewcell-from-xib

Licence: MIT license
Create CollectionView Xib cell for UICollectionView using Swift 3

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to ios-swift-uicollectionviewcell-from-xib

ShortcutsCollectionView
Create custom collectionView like Apple’s Shortcuts app in Code.
Stars: ✭ 24 (+100%)
Mutual labels:  collectionview, collectionviewcell
Collectionviewslantedlayout
A CollectionView Layout displaying a slanted cells
Stars: ✭ 2,029 (+16808.33%)
Mutual labels:  collectionview, collectionviewcell
SNAdapter
iOS swift tableview and collectionView Adapter
Stars: ✭ 35 (+191.67%)
Mutual labels:  collectionview, collectionviewcell
MGGridView
MGGridView is a grid view created by a combination of collection views.
Stars: ✭ 25 (+108.33%)
Mutual labels:  collectionview
LQIMInputView
一个聊天输入框的工具栏,类似微信聊天工具栏,可自定义,集成方便
Stars: ✭ 28 (+133.33%)
Mutual labels:  collectionview
Pickme
iOS Picker for ninjas
Stars: ✭ 29 (+141.67%)
Mutual labels:  collectionview
IBProperty
XIB、Storyboard Helper
Stars: ✭ 31 (+158.33%)
Mutual labels:  xib
Cyltabbarcontroller
[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
Stars: ✭ 6,605 (+54941.67%)
Mutual labels:  xib
THCalendar
Calendar like iOS
Stars: ✭ 21 (+75%)
Mutual labels:  collectionview
SNCollectionViewLayout
Collection View Layouts is a set of custom flow layouts for iOS which imitate general data grid approaches for mobile apps.
Stars: ✭ 100 (+733.33%)
Mutual labels:  collectionview
FavFighters
Xamarin.Forms goodlooking UI sample using the new SwipeView.
Stars: ✭ 32 (+166.67%)
Mutual labels:  collectionview
Multiple-collectionView-in-Multiple-tableView-cells
UICollectionView is embed in UITableViewCell. The collection views are horizontal scrollable. The UITableView can have a section title for each UICollectionView and the number of UICollectionView is equal to the number of sections.
Stars: ✭ 23 (+91.67%)
Mutual labels:  collectionview
IBKit
A declarative style interface builder in Swift
Stars: ✭ 38 (+216.67%)
Mutual labels:  xib
Pinterest-Application
Build an application like Pinterest in Swift 4
Stars: ✭ 31 (+158.33%)
Mutual labels:  collectionview
SwiftWaterfallFlow
swift写的瀑布流布局
Stars: ✭ 37 (+208.33%)
Mutual labels:  collectionview
CollectionViewDiffableGameDB
Game DB iOS App using iOS 13 NSDiffableDataSourceSnapshot to filter, sort, and search with animations
Stars: ✭ 17 (+41.67%)
Mutual labels:  collectionview
MMAdvertScrollView
一个简单、轻量级的swift版公告轮播框架
Stars: ✭ 42 (+250%)
Mutual labels:  collectionview
SSCTaglistView
Customizable iOS tag list view, in Swift.
Stars: ✭ 54 (+350%)
Mutual labels:  collectionview
KNURE-TimeTable
🎓 iOS приложение для просмотра расписания ХНУРЭ
Stars: ✭ 21 (+75%)
Mutual labels:  collectionview
KNBannerView
无限循环图片轮播器:本地图片,网络图片,混合图片(本地+网络) , 适配SDWebImage5.0 . 动态修改背景色,屏幕旋转适配
Stars: ✭ 82 (+583.33%)
Mutual labels:  collectionview

Watch the video

1. Add UICollectionView into your view

  • Set datasource and delegate for your collectionView

2. Create your collectionview cell: MyCollectionViewCell.swift & MyCollectionViewCell.xib

  • Set Identifier value

3. Let start to add some code

1. Create Identifier for your cell
let MyCollectionViewCellId: String = "MyCollectionViewCell"
2. Register your cell
let nibCell = UINib(nibName: MyCollectionViewCellId, bundle: nil)
collectionView.register(nibCell, forCellWithReuseIdentifier: MyCollectionViewCellId)
3. Add some functions for your collectionView*
extension ViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
    func numberOfSections(in collectionView: UICollectionView) -> Int {
        return 1
    }
    
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 10
    }
    
    func collectionView(_ collectionView: UICollectionView,
                        layout collectionViewLayout: UICollectionViewLayout,
                        insetForSectionAt section: Int) -> UIEdgeInsets {
        let inset = 10
        return UIEdgeInsetsMake(CGFloat(inset), CGFloat(inset), CGFloat(inset), CGFloat(inset))
    }
    
    func collectionView(_ collectionView: UICollectionView,
                        layout collectionViewLayout: UICollectionViewLayout,
                        sizeForItemAt indexPath: IndexPath) -> CGSize {
        return CGSize.init(width: UIScreen.main.bounds.width - 20, height: 80)
    }
    
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MyCollectionViewCellId, for: indexPath) as! MyCollectionViewCell
        
        
        return cell
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].