2016-09-21 137 views
-3
- (void) registerHotspot: (NEHotspotNetwork*) network andCommand:(NEHotspotHelperCommand*) cmd 
{ 
    if ([network.SSID isEqualToString:@"Chameleon Cafe"]) 
    { 
     [network setConfidence:kNEHotspotHelperConfidenceHigh]; 
     [network setPassword:@"chamcafe"]; 
     NEHotspotHelperResponse *response = [cmd createResponse:kNEHotspotHelperResultSuccess]; 
     NSLog(@"Response CMD %@", response); 

     [response setNetworkList:@[network]]; 
     [response setNetwork:network]; 
     [response deliver]; 
    } 

    NEHotspotNetwork * myNetwork = [[NEHotspotNetwork alloc] init]; 

    } 
+0

https://objectivec2swift.com/ – iDeveloper

回答

0
func registerHotspot(network : NEHotspotNetwork, andCommand cmd : NEHotspotHelperCommand){ 
     if(network.SSID == "Chameleon Cafe"){ 
      network.setConfidence(.High) 
      network.setPassword("chamcafe") 
      let response : NEHotspotHelperResponse = cmd.createResponse(.Success) 
      print("Response CMD \(response)") 
      response.setNetworkList([network]) 
      response.setNetwork(network) 
      response.deliver() 
     } 

     let myNetwork = NEHotspotNetwork() 
    } 
相關問題