1

Perhaps I'm missing something here, but I want the user to be able to select a UIProgressView and thus have an IBAction function call (essentially make it behave like a UIButton).

This can't be rocket science, but I can't figure it out.

BTW, I have xCode 4.

Alex Cio
  • 6,014
  • 5
  • 44
  • 74
Rasman
  • 5,349
  • 1
  • 25
  • 38
  • Are you trying to say user can change the progress of the progress view? Sorry if i am mistaken, but i have to leave now so i am taking a long shot. If you want to the user to manually change the progress, then you can take a look at UISlider. –  Jun 15 '11 at 15:00
  • put an invisible button over the top of it. – Jesse Naugher Jun 15 '11 at 15:02
  • @pratikshabhisikar I want the phone/tablet to do calculations should the user touch the view. the progress value may not be modified by the user and has it's own routines to worry about – Rasman Jun 15 '11 at 15:04
  • @Jesse, I though about that, but there has to be a more elegant solution... – Rasman Jun 15 '11 at 15:05

1 Answers1

2

Add a gesture recognizer. With UITapGestureRecognizer you can make any UIView (or subclass) instance respond to taps. You'll have to do it in code instead of in IB, which means you'll need an IBOutlet connection to the progress view. You might need to set userInteractionEnabled to YES to make it work.

It's kind of hard to imagine a scenario where this makes sense, but I'll just assume you have a good reason and leave it at that.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170
  • That's what I was thinking, it just won't be intuitive to the user to click something that's not made to be clicked. :/ – Jesse Naugher Jun 15 '11 at 17:17
  • and @Jesse: Reason: I need to limit the amount of information already on screen (6 other variables including one stopwatch and a countdown, one button and a tab bar), and a ballpark value is sufficient for the target audience (hence the progress bar). For the curious few who want details at a specific instance, clicking on the view will give them just that. Another button just increases clutter and goes against everything I'm trying to do. You're right in that it would be non-intuitive if this was a primary feature, but it is nothing more then a supportive function (phew!) – Rasman Jun 15 '11 at 17:39