0

I am currently working on an a video app in which I'd like to give the user the option of setting the duration for which the video will be recorded. I am trying to implement this using a stepper button. Currently I am able to set this timer statically as follows:

    - (IBAction)captureVideo:(id)sender {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {

    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.allowsEditing = YES;
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
    picker.videoMaximumDuration = 10.0f;
    [self presentViewController:picker animated:YES completion:NULL];
}
}

How can I use a stepper's value instead? Or are there any better ways of doing this?

Thanks.

fonji
  • 162
  • 1
  • 7

1 Answers1

0

You can see this example, You'll know how to use UIStepper.

Andrew Romanov
  • 4,774
  • 3
  • 25
  • 40
  • Thank you @AndrewRomanov. Your response was very helpful in accomplishing this task! By adding "@synthesize stepper" (stepper being the name of my UIStepper), I can use the value of the UIStepper for videomaximumduration (picker.videomaximumduration = stepper.value;). – fonji Feb 14 '15 at 15:08