button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self action:@selector(XXXXX:)forControlEvents:UIControlEventTouchDown];
[button addTarget:self action:@selector(YYYY:)
forControlEvents:UIControlEventTouchUpInside];
[button addTarget:self action:@selector(ZZZZ:)
forControlEvents:UIControlEventTouchUpOutside];