3

I am using this code to present App settings

- (IBAction)showSettings:(id)sender
{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];

}

enter image description here

I want to show the settings inside my Application, not jump to iPhone settings. Can anyone help?

Modified:

I try to write this code in objective C:

UIAlertController *alertControll = [UIAlertController alertControllerWithTitle:@"Sad Face Emoji!"
                                                                       message:@"The calendar permission was not authorized. Please enable it in Settings to continue."
                                                                preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *settingsAction = [UIAlertAction actionWithTitle:@"Settings"
                                                         style:UIAlertActionStyleDefault
                                                       handler:^(UIAlertAction *action) {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}];

UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:nil];

[alertControll addAction:settingsAction];
[alertControll addAction:cancelAction];


[self presentViewController:alertControll animated:YES completion:nil];

But still jumping to iPhone settings

Almudhafar
  • 887
  • 1
  • 12
  • 26

0 Answers0