Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Tags
- error
- push
- Xcode
- Example
- swift3
- 신도림
- 얻는법
- 샘플
- swift
- 포켓볼
- UIView
- 공략
- afterdelay
- 스마트폰
- 앱스토어
- loop
- Bitcode
- 해몽
- UITableView
- 페이백
- LG유플러스
- Check
- 신도림 테크노마트
- IOS
- 포켓몬 GO
- simulator
- setting
- 보라카이
- GCD
- 아이폰7
Archives
- Today
- Total
도래울
swift Get button click inside UI table view cell 본문
1) In your cellForRowAtIndexPath: method, assign button tag as index:
cell.yourbutton.tag = indexPath.row;2) Add target and action for your button as below:
[cell.yourbutton addTarget:self action:@selector(yourButtonClicked:) forControlEvents:UIControlEventTouchUpInside];3) Code actions based on index as below in ViewControler:
-(void)yourButtonClicked:(UIButton*)sender
{
if (sender.tag == 0)
{
// Your code here
}
}
'개발 > iOS' 카테고리의 다른 글
| swift string search rangeOfString (0) | 2016.07.19 |
|---|---|
| ios get the previous viewcontroller that pushed my current view (0) | 2016.07.15 |
| Loop through subview to check for empty UITextField - Swift (0) | 2016.07.13 |
| remove all subviews of a view in Swift (0) | 2016.07.13 |
| swift for in loop (0) | 2016.07.13 |
Comments