Latest 1.0.0
Homepage https://github.com/zxbest/XLinearFlowView
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Doc

为减小学习、使用成本,控件接口、协议均参照UICollectionView.h,以下不单独说明,详细请见XLinearFlowView.h

  1. 初始布局

    1. 设置默认整体内边距为UIEdgeInsetsZero,设置默认标签间距为10,标记渲染位置layoutPoint(insets.left, insets.top)
    2. 将标签渲染在layoutPoint位置,并更新layoutPoint.x为该标签尾部+标签间距
    3. 判断layoutPoint是否超出布局边界,如果超出,换行并更新layoutPoint = (insets.left, 第二行起始y)
    4. 重复2、3
  2. 交互时的布局

    1. 交互开始时,标记被交互的Cell,初始索引、目标索引(初始索引),初始位置(point),目标位置(frame)
    2. 交互进行时,更新Cell位置、更新初始位置为当前点
    3. 检测碰撞(是否与已有标签重叠),如果是,更新目标索引为被碰撞标签索引,触发重排,更新目标位置,更新初始索引为目标索引
    4. 重复2、3
    5. 交互结束或取消时,将被交互Cell移动到目标位置,重置各记录变量。

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

XLinearFlowView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'XLinearFlowView'

Author

吴新庭, [email protected]

License

XLinearFlowView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "XLinearFlowView",
    "version": "1.0.0",
    "summary": "For views, those have or not same width, displayed in linear flow mode.",
    "description": "views which have same width or not, can be displayed in this view. And drag&drop animation were enabled.nu5c55u793au4e0du7b49u5bbdu7684u5143u7d20uff0cu6309u6d41u5f0fu5e03u5c40u6392u7248uff0cu5e76u63d0u4f9bu62d6u62fdu52a8u753b",
    "homepage": "https://github.com/zxbest/XLinearFlowView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "for": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zxbest/XLinearFlowView.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "XLinearFlowView/*.{h,m}",
    "public_header_files": "XLinearFlowView/*.h",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This