title: how to use Vibration while recording iphone5 IOS?
body: <p>I am working on a iphone5 app and i need some advice on the vibration motor. 
  i goggled the things but cant find how can i manually rotate my iPhone from the code.please guide me... or give any link or ideas.. </p>
  
  <p>What i want to do is vibrate the phone while recordign the video .</p>
  
  <p>but my problem is when i start the vibration it cant recrod the video.. i found that it will not work when audio is capturing running.. so i tried with mute the sound while recording but its not working still</p>
  
  <p>following is my code..</p>
  
  <pre><code>//
  //  APPViewController.m
  //  
  //
  //  Created by Rafael Garcia Leiva on 29/04/13.
  //  Copyright (c) 2013 Appcoda. All rights reserved.
  //
  
  #import "APPViewController.h"
  #import &lt;AudioToolbox/AudioToolbox.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;
  
  @interface APPViewController ()
  
  @end
  
  @implementation APPViewController
  
  - (void)viewDidLoad {
  
      [super viewDidLoad];
  
  
  
  }
  
  - (void)viewDidAppear:(BOOL)animated {
  
      self.movieController = [[MPMoviePlayerController alloc] init];
      [self.movieController setContentURL:self.movieURL];
  
      [self.movieController.view setFrame:CGRectMake ( 0, 0, 320, 476)];
  
      [self.view addSubview:self.movieController.view];
  
      [[NSNotificationCenter defaultCenter] addObserver:self
                                            selector:@selector(moviePlayBackDidFinish:)
                                            name:MPMoviePlayerPlaybackDidFinishNotification
                                            object:self.movieController];
  
      [[MPMusicPlayerController applicationMusicPlayer] setVolume:0];
  
      [self.movieController play];
  
      [self setupAudio];
  
  
  
  }
  
  - (IBAction)takeVideo:(UIButton *)sender {
  
      UIImagePickerController *picker = [[UIImagePickerController alloc] init];
      picker.delegate = self;
      picker.allowsEditing = YES;
      picker.sourceType = UIImagePickerControllerSourceTypeCamera;
      picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
  
  
  
  
      [self presentViewController:picker animated:YES completion:NULL];
      while(TRUE){
  
          AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
  
      }
  
  
  
  }
  
  - (void)setupAudio {
      [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil];
      UInt32 doSetProperty = 1;
      AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(doSetProperty), &amp;doSetProperty);
      [[AVAudioSession sharedInstance] setActive: YES error: nil];
  }
  
  
  - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
  
      self.movieURL = info[UIImagePickerControllerMediaURL];
  
      [picker dismissViewControllerAnimated:YES completion:NULL];
  
  }
  
  - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
  
      [picker dismissViewControllerAnimated:YES completion:NULL];
  
  }
  
  - (void)moviePlayBackDidFinish:(NSNotification *)notification {
  
      [[NSNotificationCenter defaultCenter]removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
  
      [self.movieController stop];
      [self.movieController.view removeFromSuperview];
      self.movieController = nil;
  
  }
  
  @end
  </code></pre>
  
  <p>i am vibrating my phone with this but its working vibrating or video recording...if video will record with no sound then even its ok for me..</p>
  
  <pre><code>while(TRUE){
  
          AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
  
      }
  </code></pre>
  
  <p>thanks</p>