UIButton en código
Necesito agregar un gesto (mover, rotar, escalar) a unUIButton
. Creé el botón en código, pero no sé cómo usarlo. Si se toca el botón, quiero mover, escalar o rotar. Aquí está mi código:
-(void)addButton{
UIScrollView *scrollview=[[UIScrollView alloc]initWithFrame:CGRectMake(0,0,320,480)];
scrollview.showsVerticalScrollIndicator=YES;
scrollview.scrollEnabled=YES;
scrollview.userInteractionEnabled=YES;
[self.view addSubview:scrollview];
scrollview.contentSize = CGSizeMake(self.view.bounds.size.width,1000.0);
buttonImage1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
buttonImage1.frame = CGRectMake(100, 20, 100, 100);
UIImage *btnImage1 = [UIImage imageWithData:[NSData dataWithContentsOfURL:
[NSURL URLWithString:adres1]]];
[buttonImage1 setImage:btnImage1 forState:UIControlStateNormal];
[scrollview addSubview:buttonImage1];
buttonImage2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
buttonImage2.frame = CGRectMake(100, 180, 150, 150);
UIImage *btnImage2 = [UIImage imageWithData:[NSData dataWithContentsOfURL:
[NSURL URLWithString:adres2]]];
[buttonImage2 setImage:btnImage2 forState:UIControlStateNormal];
[scrollview addSubview:buttonImage2];
buttonImage3 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
buttonImage3.frame = CGRectMake(100, 450, 194, 146);
UIImage *btnImage3 = [UIImage imageWithData:[NSData dataWithContentsOfURL:
[NSURL URLWithString:adres3]]];
[buttonImage3 setImage:btnImage3 forState:UIControlStateNormal];
[scrollview addSubview:buttonImage3];
}
-(void) move
{
}