Giter Club home page Giter Club logo

sbcollectionview's Introduction

SBCollectionView 1.0.0

作者邮箱:[email protected] 有问题可以联系作者

作者常常需要在项目用到Item集合这样的布局方式,单是用UICollectionView去做发现代码很多而且不好自定义,所以花了一些时间写了专门处理
这种item集合的一套框架.
仿UICollectionView的布局方式,适用于少量有限的Item集合。支持了UICollectionVIew主要部分的操作,刷新,增,删。
相较于UICollectionView的优势:
1.简易快捷轻便,可以用block或代理的方式快速的搭建高度自定义的CollectionView布局
2.框架更轻量级,因为取消了滑动相关,两个层级的UIview相比UICollectionView复杂的视图层级更轻便.
3.灵活的布局能力,可以方便的定义item的大小,delegate提供了一套自定义的布局方法。
下面是效果图:
image
image
image
image
image
框架提供了两套布局方式 block和delegate
注意://代理的优先级将会高于block
/**
通过block控制的实例化
@param frame sbcollectionview.frame
@param itemCount itemCount
@param itemSize item 的大小 size
@param item 通过item获取一个item
@param reloadItem 刷新item
@param didSelectItem 选择item的回调
@return sbcollectionview

*/

- (instancetype)initWithFrame:(CGRect)frame itemCount:(CountBlock)itemCount itemSize:(CGSize)
itemSize item:(ItemBlock)item reloadItem:(ReloadBlock)reloadItem didSelectItem:(DidSelectBlock)didSelectItem;
/**
通过代理方式实例化
@param frame frame
@param itemSize item的大小
@param delegate 代理
@return sbcollectionview
*/
- (instancetype)initWithFrame:(CGRect)frame itemSize:(CGSize)itemSize ### delegate:(id )delegate;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.