Latest 1.0.1
Homepage https://github.com/nhfc99/NHFTouchTableView
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation, CoreGraphics, UIKit
Authors

介绍

为UITableView上边加上Touch的响应事件

安装

  • pod ‘NHFTouchTableView’
  • 手动下载然后将文件夹拖至工程中即可

使用方法

  • (void)createTableVeiw {
    TouchTableView mainTableView = [[TouchTableView alloc] initWithFrame:CGRectMake(0, mainTableViewMinY, CGRectGetWidth(self.frame), [DeviceInfo ScreenSize].height- mainTableViewMinY-(MARGIN2+bottomViewHeight)) style:UITableViewStylePlain];

    [_mainTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

    [_mainTableView setBackgroundColor:[UIColor clearColor]];

    [_mainTableView setDelegate:self];

    [_mainTableView setDataSource:self];

    [_mainTableView setBounces:false];

    _mainTableView.touchDelegate = self;

    [self setExtraCellLineHidden:_mainTableView];

    [self addSubview:_mainTableView];

    }

  • (void)setExtraCellLineHidden:(UITableView )tableView {

    UIView
    view = [UIView new];

    view.backgroundColor = [UIColor clearColor];

    [tableView setTableFooterView:view];

    }



    ……..

  • (void)touchesBegan:(NSSet<UITouch > )touches withEvent:(UIEvent *)event {

    [super touchesBegan:touches withEvent:event];

    //触摸事件

    }

  • (void)touchesEnded:(NSSet<UITouch > )touches withEvent:(UIEvent *)event {

    [super touchesEnded:touches withEvent:event];

    //触摸事件

    }

  • (void)tableView:(UITableView )tableView touchesEnded:(NSSet )touches withEvent:(UIEvent *)event {

    [super touchesEnded:touches withEvent:event];

    //触摸事件

    }

Latest podspec

{
    "name": "NHFTouchTableView",
    "version": "1.0.1",
    "summary": "u4e3aUITableViewu4e0au8fb9u52a0u4e0aTouchu7684u54cdu5e94u4e8bu4ef6",
    "homepage": "https://github.com/nhfc99/NHFTouchTableView",
    "license": "MIT",
    "authors": {
        "u725bu5b8fu98de": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nhfc99/NHFTouchTableView.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "TouchTableView/*.{h,m}",
    "frameworks": [
        "Foundation",
        "CoreGraphics",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This