Sometimes you need to connect to the network during iOS development. When the access request detects that the network is unavailable, you need to prompt the user to manually set up the network and inform the user of the operation path setting available networks.
Just one line of code:
-(void) Viewdidload {
[Super Viewdidload];
UIButton *button = [UIButton buttonwithtype:uibuttontypecustom];
Button.backgroundcolor = [Uicolor Redcolor];
Button.frame = CGRectMake (50, 100, 100, 30);
[Self.view Addsubview:button];
[Button addtarget:self action: @selector (pushsetting) forcontrolevents:uicontroleventtouchupinside];
}
-(void) pushsetting{
Nsurl *url = [Nsurl urlwithstring:@ "Prefs:root=wifi"];
BOOL Iscanopenurl = [[UIApplication sharedapplication] openurl:url];//a line of code to implement the jump
}
Additional: Add the URL types (nsarray) in the Info.plist in the project and select the key in Item0 (nsdictionary) as the URL schemes (nsarray), then set the item0 corresponding to the value prefs. or directly in the info item of the URL types Click + directly set the URL schemes
App push settings for iOS dev WiFi