Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
WiFiKit.framework - iPhone Development Wiki

WiFiKit.framework

From iPhone Development Wiki
Revision as of 03:06, 8 July 2022 by Cynder (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
WiFiKit.framework
Private Framework
Availabile 11.0 – present
Headers [headers.cynder.me]


WiFiKit is a private framework that provides a high-level ObjC API to MobileWiFi.framework. Its functionality used to be in AirPortSettings.bundle but it has now been factored out to this new framework and AirPortSettings now contains simply one class APNetworksController that uses WFNetworkListController from this framework.

It requires the com.apple.wifi.manager-access entitlement.

#import <WiFiKit/WiFiKit.h>

@interface AppDelegate () <WFScanManagerDelegate>

@property (strong, nonatomic) WFScanManager *scanManager;

@end

@implementation AppDelegate

- (WFScanManager *)scanManager{
    if(!_scanManager){
        WFClient *client = [[WFClientClass alloc] init];
        _scanManager = [[WFScanManager alloc] initWithClient:client scanInterval:6 delegate:self]; // minimum 6
    }
    return _scanManager;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [self.scanManager start];
    return YES;
}

// called first for 2.4GHz then second for 5GHz
-(void)scanManager:(WFScanManager *)scanManager updatedPartialResults:(NSSet<WFNetworkScanRecord *> *)partialResults{
    NSLog(@"%@", NSStringFromSelector(_cmd));
}

// called immediately after 5GHz partial
- (void)scanManagerScanningDidFinish:(WFScanManager *)scanManager withResults:(NSSet<WFNetworkScanRecord *> *)results error:(NSError *)error{
    NSLog(@"%@", NSStringFromSelector(_cmd));
}