iOS/Swift
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/bocJUb/btsDqPmacEX/lic23ob9MidUygJHMvUI61/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
XCTest Xcode Project의 unit test, 성능 test, UI test 케이스를 만들어 실행하는 Framework XCTest | Apple Developer Documentation Create and run unit tests, performance tests, and UI tests for your Xcode project. developer.apple.com ViewController.swift class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } } XCTestCase fina..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/tLPNR/btsDpvaIBRt/XXFs3TY08UQToZvX3qYukk/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
1. 가상 인터페이스 생성 sudo rvictl -s [UUID] 2. 패킷 캡처 파일 생성 tcpdump -i rvi0 -w [file name].pcapng 3. WireShark로 확인 출처 [iOS_Packet Capture] iOS Network traffic capture without Jailbreak iOS 관련 분석을 진행하다보면 네트워크 트래픽을 관찰해야 할 일이 생기곤 하는데, 모니터 모드 본인 컴퓨터에서 캡쳐하면 무선랜 패킷은 잡을 수 있지만 패킷 손실 우려도 있고... 아무튼 좀 귀 biji-jjigae.tistory.com [번역/의역] 아이폰 패킷 덤프 (tcpdump) # 원문 How to capture network traffic from iPhone with tcpdump..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/bAPAOj/btsC7qNHBYn/ZmlR8XpULWngfQRXeg8RqK/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
이전 포스팅 [Swift] Dispatch (1) Dispatch (Framework) 시스템에서 관리하는 Dispatch 대기열에 작업을 제출하여 Multi Core 하드웨어에서 코드를 동시에 실행 GCD(Grand Central Dispatch)라고 알려진 Dispatch에서는 macOS, iOS, watchOS 및 tvOS의 멀티코 kimkhuna99.tistory.com sync(동기) vs async(비동기) → 작업을 보내는 시점에서 기다릴지 말지 serial(직렬) vs concurrent(동시) → Queue로 보내진 작업들을 여러 개의 Thread로 보낼지, 한 개의 Thread로 보낼 것 인지 DispatchQueue main queue - 오직 한개만 존재 - Serial 특성을 가진..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/bKRsB2/btsC4aLJBdm/QdgeTOzyJisySc4XjD8HD1/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
AVCaptureVideoPreviewLayer와 AVCaptureSession 선언 private var videoLayer = AVCaptureVideoPreviewLayer() private var captureSession = AVCaptureSession() 기기가 회전될 때 View도 인식, 그리고 QR코드를 인식하기 위해 함수 선언 override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) // Camera View rotate Notification NotificationCenter.default.addObserver(self, selector: #selector(orientationChanged(_:)),..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/Zk3FT/btsFogipHFv/bdfxH0848rhWkVxqi8dEe1/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
LocalAuthentication 생체인식이나 이미 알고 있는 암호를 사용하여 사용자 인증 LocalAuthentication을 import 하고, LAcontext를 선언 import LocalAuthentication private var context = LAContext() 인증 시도 함수 var error: NSError? if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) { let reason = "Log in to your account" context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason) { [weak self] isSucces..
![](http://i1.daumcdn.net/thumb/C400x400/?fname=https://blog.kakaocdn.net/dn/bz59CN/btsCUAWEU5v/c9s3LWzh6azW3SFQYMe9e0/img.png)
![](https://tistory1.daumcdn.net/tistory/5365537/skin/images/no-image.jpg)
URL let urlString = "https://ios-development.tistory.com/search/users?id=123&age=20" let url = URL(string: urlString) /// 주소 전체 "https://ios-development.tistory.com/search/users?id=123&age=20" print(url?.absoluteURL) /// 어떤식으로 네트워킹 하는지 "https" print(url?.scheme) /// baseURL과 같이 메인 주소 "ios-development.tistory.com" print(url?.host) /// host뒤에 query parameter를 제외한 주소 "/search/users" print(url?.path..