본문 바로가기
#포트폴리오 [Portfolio]/SystemKit (오픈소스)

🗂 [Guide] SKNetworkMonitor

by cy_mos 2022. 12. 12.
반응형
반응형
카테고리 게시글 작성 날짜 게시글 최근 수정 날짜 작성자
OpenSource 2022.12.12. 22:52 2022.12.12. 23:02 Dev.Yang

🗂 SKNetworkMonitor

SKNetworkMonitor는 iOS 운영체제 또는 macOS 운영체제 환경에서 네트워크 환경 (WiFi, Ethernet, Cellular, LoopBack 등)에 대한 정보를 얻을 수 있도록 기능을 제공합니다.

🛠️ Example Source

SKNetworkMonitor 예제 소스코드는 아래와 같습니다.

// 네트워크 상태에 대한 정보 수집을 종료합니다.
let monitor = SKNetworkMonitor { result in

    // NWPath 정보를 가져옵니다.
    print(result.newPath)

    // 네트워크 상태 정보를 가져옵니다.
    print(result.status)

    // 네트워크 연결 상태를 가져옵니다.
    print(result.connectionType)
}

// 네트워크 상태에 대한 정보 수집을 시작합니다.
monitor.startMonitor()

// 네트워크 상태에 대한 정보 수집을 종료합니다.
monitor.stopMonitor()

 

📝 License

SystemKit is released under the MIT license. See LICENSE for details.

MIT License

Copyright (c) 2022 Universal-SystemKit

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
반응형

'#포트폴리오 [Portfolio] > SystemKit (오픈소스)' 카테고리의 다른 글

🗂 [Guide] SKFileLock  (0) 2023.05.02
🗂 [Guide] SKCrashReporter  (0) 2022.12.22
🗂 [Guide] SKSystem  (0) 2022.11.28
🗂 [Guide] SKAsyncOperation  (0) 2022.11.04
🗂 [Guide] SKProcessMonitor  (0) 2022.10.24

댓글