점진적 과부하 개발 블로그

Swift UserDefaults 값 초기화 본문

Swift

Swift UserDefaults 값 초기화

지용빡 2023. 6. 27. 10:43
반응형
Swift UserDefaults 값 초기화

 

UserDefaults 값 초기화(모든 키 값 삭제)
for key in UserDefaults.standard.dictionaryRepresentation().keys {
	UserDefaults.standard.removeObject(forKey: key.description)
}

 

 

dictionaryRepresentation() | Apple Developer Documentation

Returns a dictionary that contains a union of all key-value pairs in the domains in the search list.

developer.apple.com

 

반응형