Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift connect wifi

let configuration = NEHotspotConfiguration.init(ssid: "SSIDname", passphrase: "Password", isWEP: false)
configuration.joinOnce = true

NEHotspotConfigurationManager.shared.apply(configuration) { (error) in
    if error != nil {
        if error?.localizedDescription == "already associated."
        {
            print("Connected")
        }
        else{
            print("No Connected")
        }
    }
    else {
        print("Connected")
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #connect #wifi
ADD COMMENT
Topic
Name
7+5 =