UIButton Touch and Hold

前端 未结 5 1199
暗喜
暗喜 2020-11-28 07:45

I haven\'t found a very easy way to do this. The ways I\'ve seen require all these timers and stuff. Is there any easy way I can hold a UIButton and cause it to repeat the

5条回答
  •  误落风尘
    2020-11-28 08:07

    I cannot reply to the first one, but this line:

    timer = [NSTimer scheduledTimerWithInterval: 1.0 target:self selector:@selector(targetMethod:) userInfo:nil repeats: YES];
    

    for at least iOS 4.1 and newer needs to be:

    timer = [NSTimer scheduledTimerWithTimeInterval: 1.0 target:self selector:@selector(targetMethod:) userInfo:nil repeats: YES];
    

提交回复
热议问题