Apple은 왜 개발자 UX는 생각 안 하지? Apple Document 왜 이렇게 하는지 잘 이해가 안 갈 때가 많다.
아래와 같이 조건문으로 처리하면 원하는 에러 코드를 번역해서 문자로 조회가 가능하다.
let status = SecItemAdd(query as CFDictionary, nil)
if status == errSecSuccess {
print("Successfully added to keychain.")
} else {
if let error: String = SecCopyErrorMessageString(status, nil) as String? {
print(error)
}
}
ref
https://stackoverflow.com/questions/34051482/secitemadd-keep-return-50-error-in-swift
'Swift > UIKit' 카테고리의 다른 글
[UIKit] viewDidLayoutSubviews란? (0) | 2023.03.18 |
---|---|
[UIKit] NavigationController에서 push 할때 버벅이는 문제 (0) | 2023.03.11 |
Delegate 패턴이란? (0) | 2022.11.07 |
[UIKit] 스토리보드로 Cell에 올린 Label이 좌측상단으로 정렬되지 않는 문제 (0) | 2022.08.08 |