LoginSignup
1
0

More than 5 years have passed since last update.

Swift3のmacosで現在のWiFi SSIDを取得する方法

Last updated at Posted at 2017-08-16

意外と調べても見つからなかったのでメモ

Build PhasesLink Binary With LibrariesからCoreWLAN.frameworkを追加

その後、コードに下記を記述

ssid.swift
import CoreWLAN

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
    func applicationDidFinishLaunching(_ aNotification: Notification) {
        print(CWWiFiClient.init()?.interface()?.ssid() ?? String())
    }
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0