-
Notifications
You must be signed in to change notification settings - Fork 0
/
ItemCell.m
54 lines (44 loc) · 1.32 KB
/
ItemCell.m
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// ItemCell.m
// daily Expenses
//
// Created by renan veloso silva on 18/05/13.
// Copyright (c) 2013 renan veloso silva. All rights reserved.
//
#import "ItemCell.h"
#import "PopoverView.h"
#import "PopoverItem.h"
@implementation ItemCell
#pragma mark - init methods
-(id)initWithCoder:(NSCoder *)aDecoder{
self = [super initWithCoder:aDecoder];
if (self) {
[self addGesture];
}
return self;
}
-(void)addGesture{
UILongPressGestureRecognizer *tap = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
[self addGestureRecognizer:[tap autorelease]];
}
#pragma mark - popover
- (void)tapped:(UITapGestureRecognizer *)tap
{
if (tap.state == UIGestureRecognizerStateEnded) {
NSLog(@"UIGestureRecognizerStateEnded");
}
else if (tap.state == UIGestureRecognizerStateBegan){
NSLog(@"UIGestureRecognizerStateBegan.");
point = [tap locationInView:self.popoverView];
PopoverItem *test = [[PopoverItem alloc] initWithId:_item.item_id];
[PopoverView showPopoverAtPoint:point inView:self.popoverView withContentView:test.view delegate:nil]; }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
}
- (void)dealloc {
[_typeView release];
[super dealloc];
}
@end