[iOS] 앱 버전 정보 출력하기

Han's·2023년 8월 7일
0

TIL

목록 보기
14/20
post-thumbnail
let version: String = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0.0"
print(version)

위의 코드는 앱의 Bundle 객체를 이용하여 infoDictionary에 접근한 다음, CFBundleShortVersionString 키를 사용하여 앱의 버전 정보를 가져오는 방식입니다.

해당 코드를 사용하여 Target -> General -> Version 정보를 가져와서 출력할 수 있습니다.

profile
 iOS Developer

0개의 댓글