Deep_Dev
article thumbnail

 

๐Ÿ“š ์•ฑ ๋‚ด ํ˜„์žฌ ์•ฑ๋ฒ„์ „ ์ •๋ณด ํ‘œ์‹œํ•˜๊ธฐ

 

 

์•ฑ์„ ์—…๋ฐ์ดํŠธ ํ•ด๊ฐ€๋ฉด์„œ ์‚ฌ์šฉ์ž๋งˆ๋‹ค ์—…๋ฐ์ดํŠธ ์—ฌ๋ถ€์— ๋”ฐ๋ผ, ์‚ฌ์šฉ์ค‘์ธ ๋ฒ„์ „์ด ๋‹ค๋ฅผ ๊ฒƒ์ด๋ผ๋Š” ์ƒ๊ฐ๋„ ๋“ค์—ˆ๊ณ ..

์ธ์•ฑ๋ฆฌ๋ทฐ๋ฅผ ๋‹ฌ๋ฉด์„œ ๊ฐ™์ด ๋ณด์ด๋Š”๊ฒƒ๋„ ๋‚˜์˜์ง€ ์•Š๊ฒ ๋‹ค ์ƒ๊ฐ์ด ๋“ค์–ด ๊ฐ„๋‹จํ•˜๊ฒŒ ์ถ”๊ฐ€ํ•˜์˜€๋Š”๋ฐ์š”.

 

var appVersion: String {
        let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
        let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown"
        return "Version \(version) (Build \(build))"
}

 

 

์ด๋ ‡๊ฒŒ ์•ฑ ๋‚ด์˜ ๋ฒ„์ „๊ณผ ๋นŒ๋“œ๋ฒˆํ˜ธ๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๊ฒŒ ํ•จ์ˆ˜์˜ ํ˜•ํƒœ๋กœ๋“  ์ž‘์„ฑ์„ ํ•ด์ฃผ๊ณ  

 

 Text(appVersion)

 

์ด๋ ‡๊ฒŒ ๋ฐ”๋กœ ๋‚˜ํƒ€๋‚ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค ! 

 

๋นŒ๋“œ๋ฒˆํ˜ธ๊นŒ์ง€ ํ‘œ์‹œํ•  ํ•„์š”๋Š” ์—†์„ ๊ฒƒ ๊ฐ™์•„์„œ..

 var appVersion: String {
        let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
        return "\(version)"
 }

์ด๋ ‡๊ฒŒ version๋งŒ ๋”ฑ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๊ฒŒ ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

 

 

๊ฐ„๋‹จํ•˜์ฃ ์ž‡?