iOS 7 Microphone request

//To prompt Microphone request at anytime

[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {}];

//To detect if microphone is allowed for the application 
// This can be found inside privacy settings of the device

-(BOOL)isMicrophonePrivacyOn
{
    __block BOOL micStatus;
    if([[AVAudioSession sharedInstance] respondsToSelector: @selector(requestRecordPermission:)])
    {
        [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
            if(!granted)
            {
                micStatus = NO;
            }
            
            else
            {
                micStatus = YES;
            }
        }];
        return micStatus;
        
    }
    else
    {
        return YES;
    }
}