Latest 1.0.1
Homepage https://github.com/x5forever/SListView
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit
Authors
  • the custom tableView of horizontal sliding and support carousel figure

Function

  • 水平滑动的自定义tableView
  • 新增 SLoopView 支持无限轮播
  • 实现了复用机制
  • 有待继续完善“垂直滑动”、“卡片样式”

Add to the Podfile

pod 'SListView','~>1.0.0'

How to use SListView

- (void)viewDidLoad {
    [super viewDidLoad];
    self.dataSource = @[randomColor,randomColor,randomColor,randomColor,randomColor];
    [self.view addSubview:self.listView];
}
- (IBAction)reload:(id)sender {
    self.dataSource = @[randomColor,randomColor,randomColor,randomColor,randomColor,randomColor,randomColor,randomColor];
    [self.listView reloadData];
}

#pragma mark - SListViewDataSource
- (NSInteger)numberOfColumnsInListView:(SListView *)listView {
    return self.dataSource.count;
}
- (CGFloat)listView:(SListView *)listView widthForColumnAtIndex:(NSInteger)index  { 
    return index % 2? 70:90; 
}
- (SListViewCell *)listView:(SListView *)listView viewForColumnAtIndex:(NSInteger)index {
    static NSString *identifier = @"ListViewCellIdentifier";
    SListViewCell *cell = [listView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[SListViewCell alloc] initWithIdentifier:identifier];
    }
    [self configureCell:cell atIndex:index];
    return cell;
}
- (void)configureCell:(SListViewCell *)cell atIndex:(NSInteger )index {
    cell.backgroundColor = _dataSource[index];
}
#pragma mark - SListViewDelegate
- (void)listView:(SListView *)listView didSelectColumnAtIndex:(NSInteger)index {
    NSLog(@"listView didSelectColumnAtIndex >> %ld",index);
}
- (void)listView:(SListView *)listView didScrollToColumn:(SRange)range {
    NSLog(@"didScrollToColumn start:%ld  end:%ld",range.start,range.end);
}
#pragma mark - lazy init
- (SListView *)listView {
    if (!_listView) {
        _listView = [[SListView alloc] initWithFrame:CGRectMake(0, 150, CGRectGetWidth(self.view.frame), 200)];
        _listView.dataSource = self;
        _listView.delegate = self;
    }
    return _listView;
}

Update

  • V1.0.1
    1.修复切换tab时,页面偏移bug
  • V1.0.0
    1._visibleRect = CGRectZero, 解决 SLoopView 出现瞬间空白页bug
    2.添加 listViewCellSpace 属性, 替换 kSpace. 目的:将 kSpace 提供为 api 使用
    3.让 delegate 可调用 scrollViewDidScroll: 方法
    4.删掉 if (_columns <= 0) return; 让 _columns 可为0
    5.完善 SWeakTimerObject
  • V0.3.0
    1.新增 SLoopView : 支持无限轮播
    2.优化 SListView
  • V0.2.0
    1.变宽
    2.新增&修改方法
    3.优化逻辑
  • V0.1.1
    1.修复reload bug,优化复用机制
  • V0.1.0
    1.首次上传

Latest podspec

{
    "name": "SListView",
    "version": "1.0.1",
    "summary": "the custom tableView of horizontal sliding and support carousel figure",
    "description": "u53efu4ee5u6c34u5e73u6ed1u52a8u7684u81eau5b9au4e49tableView,u4e14u5df2u652fu6301u65e0u9650u8f6eu64ad,u540eu7eedu4f1au7ee7u7eedu5b8cu5584u201cu5782u76f4u6ed1u52a8u201du4ee5u53cau201cu5361u7247u6837u5f0fu201d. u5b9eu4f8bu5e94u7528u573au666fu5982uff1au6a2au5411u6ed1u52a8u7684u5361u7247u3001banner u4ee5u53cau907fu514d Timer u5faau73afu5f15u7528u7684 SWeakTimerObject u7c7b",
    "homepage": "https://github.com/x5forever/SListView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "x5": "[email protected]"
    },
    "source": {
        "git": "https://github.com/x5forever/SListView.git",
        "tag": "V1.0.1"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "SListViewDemo/SListViewDemo/Classes/*.{h,m}",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This