Open a set of app preferences in my app

I am using this code to present application settings

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

}

      

enter image description here

I want to show the settings inside my app, not go to the iPhone settings. Can anyone please help?

Modified:

I am trying to write this code in a C object:

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 into iPhone settings

+3


source to share





All Articles